/*******************************************************************************
- File Name : readme.md
- Author : timmy00274672 ([email protected])
- Date : 06/05/2014
- Version : Version 2.1
- Description : This file describe the environment-related setting. *******************************************************************************/
In the repo, I just copy the examples from STM32 Note.
- IDE : IAR
- FWLib : V2.0.3 (STMicroelectronics)
- Board : CEPARK STM32F103RCT6
-
Create a IAR project. (PWD in below is the IAR project directory.)
-
Include C/C++ libriary directories:
$WS_DIR$\..\CMSIS_V1P10\Core\CM3 $WS_DIR$\..\FWLib\library\inc $WS_DIR$\..\FWLib\project $WS_DIR$\inc
-
Add Group
CMSIS_Include
(optional)$WS_DIR$\..\CMSIS_V1P10\Core\CM3\core_cm3.h $WS_DIR$\..\CMSIS_V1P10\Core\CM3\stm32.h $WS_DIR$\..\CMSIS_V1P10\Core\CM3\system_stm32.h
-
Add Group
CMSIS_Source
$WS_DIR$\..\CMSIS_V1P10\Core\CM3\core_cm3.c $WS_DIR$\..\CMSIS_V1P10\Core\CM3\system_stm32.c
-
Add Group
CMSIS_Startup
(Depend on IDE)$WS_DIR$\..\CMSIS_V1P10\Core\CM3\startup\iar\startup_stm32f10x.s
-
Add Group
FWLib_src
(Add the used files)$WS_DIR$\..\FWLib\library\src\*.c
-
Add Group
Include
(optional)$WS_DIR$\inc\*.h
-
Add Group
User
orSource
All the files of the project, espacially the file containing
main
function. -
More information can be found in
$WS_DIR$\..\FWLib\project\readme
.
Set device = ST STM32F10xxB
Select Full library, and just use printf and scanf via Terminal I/O (select in View
)
Use the linker configuration files: $WS_DIR$\..\FWLib\project\EWARMv5\stm32f10x_flash.icf
.
This file is the IAR specific linking and loading file used to load in Flash and execute code and variables to target memories and regions. You can customize this file to your need.
-
In
Downlolad
-
verify download
-
use flash loader (make sure that processor setting is correct or manually select proper one)
For example,
$TOOLKIT_DIR$\config\flashloader\ST\FlashSTM32F10xxB.board
-
Observe the the Default interrupt handlers section in startup_stm32f10x.s
:
THUMB
PUBWEAK NMI_Handler
SECTION .text:CODE:REORDER(1)
NMI_Handler
B NMI_Handler
PUBWEAK HardFault_Handler
SECTION .text:CODE:REORDER(1)
HardFault_Handler
B HardFault_Handler
PUBWEAK MemManage_Handler
SECTION .text:CODE:REORDER(1)
MemManage_Handler
B MemManage_Handler
PUBWEAK BusFault_Handler
SECTION .text:CODE:REORDER(1)
.........
The keyword PUBWEAK
means that if there is no method in the linking phase, the
default interrupt handler will be publicize. Therefore, you can implement the
handler anywhere provided the name matchs the default interrupt handler.