aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32lib/examples/NVIC/VectorTable_Relocation/readme.txt
blob: f9aec02c8dcec26dd6370c323d31f43606ccbb99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
* File Name          : readme.txt
* Author             : MCD Application Team
* Version            : V2.0.1
* Date               : 06/13/2008
* Description        : Description of the NVIC VectorTable_Relocation Example.
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

Example description
===================
This example describes how to use the NVIC firmware library to set the CortexM3 
vector table in a specific address other than default.

This can be used to build program which will be loaded into Flash memory by an
application previously programmed from the Flash memory base address. 
Such application can be In-Application Programming (IAP, through USART) or
Device Firmware Upgrade (DFU, through USB).
These applications are available for download from the ST microcontrollers 
website: www.st.com/stm32

The associated program implements a "Delay" function based on SysTick end of count
interrupt, and toggles four leds with timing defined by the "Delay" function.

When using the IAP to load your porgram, the vector table must be relocated at
address 0x08002000.
When using the DFU to load your porgram, the vector table must be relocated at
address 0x08003000.


Directory contents
==================
 + \linker           
    + \EWARMv4               
       + lnkarm_flash_offset.xcl       XLINK command file template for EWARM4
    + \EWARMv5               
       + stm32f10x_flash_offset.icf    ILINK command file template for EWARM5
    + \RIDE               
       + stm32f10x_flash.ld            linker script for RIDE
    + \HiTOP               
       + STM32F10x_offset.lsl          linker file for HiTOP
       + link_offset                   script for HiTOP
                                          
 + platform_config.h    Evaluation board specific configuration file
 + stm32f10x_conf.h     Library Configuration file
 + stm32f10x_it.c       Interrupt handlers
 + stm32f10x_it.h       Interrupt handlers header file
 + main.c               Main program
 + main.h               Header for main.c


Hardware environment
====================
This example runs on STMicroelectronics STM3210B-EVAL and STM3210E-EVAL evaluation
boards and can be easily tailored to any other hardware.
To select the STMicroelectronics evaluation board used to run the example, uncomment
the corresponding line in platform_config.h file.

 + STM3210B-EVAL 
    - Use LD1, LD2, LD3 and LD4 leds connected respectively to PC.06, PC.07, PC.08
      and PC.09 pins
 
 + STM3210E-EVAL
    - Use LD1, LD2, LD3 and LD4 leds connected respectively to PF.06, PF0.7, PF.08
      and PF.09 pins

    
How to use it
=============
In order to make the program work, you must do the following :
- Create a project and setup all your toolchain's start-up files:
 + RVMDK
    - in the project option menu, select 'Target' window and enter 0x08002000 
      as IROM start address
    - in the project option menu, select 'Linker' window and enter 0x08002000 
      as R/O base address                    

 + EWARM4
    - use "lnkarm_flash_offset.xcl" as linker file
    
 + EWARM5
    - use "stm32f10x_flash_offset.icf" as linker file

 + RIDE
    - In the Application options -> script menu, set "Use Default Script File" 
      to "No" and use "stm32f10x_flash_offset.ld" as Script File. 
      This linker is configured for STM32 High-density devices. To use it with
      Medium-density devices, this linker should be updated as follows: 
        - line39: RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
        - line40: FLASH (rx) : ORIGIN = 0x8002000, LENGTH = 128K-0x2000
        - line49: _estack = 0x20005000;
              
 + HiTOP
    - copy the "link_offset" and "STM32F10x_offset.lsl" files under "Settings" 
      folder which is created by default by HiTOP.
    - in project->settings->project->tool settings ->linker, 
      use "link_offset.lnk" as linker file.     
      This linker is configured for STM32 High-density devices. To use it with
      Medium-density devices, this linker should be updated as follows: 
        - line2: #define __ROM_SIZE               128k
        - line5: #define __RAM_SIZE               20k
        
- Compile the directory content files and required Library files:
  + stm32f10x_lib.c
  + stm32f10x_systick.c
  + stm32f10x_gpio.c
  + stm32f10x_rcc.c
  + stm32f10x_nvic.c
  + stm32f10x_flash.c

- In the main.c and linker files, the vector table is relocated at address 0x08002000.
  You can modify this address depending on the requirement of your application. 
    
- Rebuild all files 

- Convert the program image to a binary file, *.bin, then you can download and
  run it using the IAP or DFU application.

NOTE:
 - Medium-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 32 and 128 Kbytes.
 - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 256 and 512 Kbytes.

******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE******