bsp.lst
来自「stm32+ucos-ii」· LST 代码 · 共 982 行 · 第 1/4 页
LST
982 行
###############################################################################
# #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM 07/Aug/2011 12:10:21 #
# Copyright 1999-2010 IAR Systems AB. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = F:\stm32\我的程序\Micrium\Software\EWARM\BSP\bsp.c #
# Command line = F:\stm32\我的程序\Micrium\Software\EWARM\BSP\bsp.c -D #
# USE_STDPERIPH_DRIVER -D STM32F10X_CL -lCN #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\ -o F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Fla #
# sh\Obj\ --no_cse --no_unroll --no_inline #
# --no_code_motion --no_tbaa --no_clustering #
# --no_scheduling --debug --endian=little --cpu=Cortex-M3 #
# -e --fpu=None --dlib_config #
# D:\arm\INC\c\DLib_Config_Normal.h -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\APP\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ #
# -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP #
# \ST\CMSIS\CM3\CoreSupport\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \CMSIS\CM3\DeviceSupport\ST\STM32F10x\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \STM32F10x_StdPeriph_Driver\inc\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\uC #
# OS-II\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II #
# \..\..\uCOS-II\Ports\ARM-Cortex-M3\Generic\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uCO #
# S-II\Source\ -I F:\stm32\我的程序\Micrium\Software\EWARM #
# \OS-II\..\..\uC-LIB\ -I F:\stm32\我的程序\Micrium\Softwa #
# re\EWARM\OS-II\..\..\uC-LIB\Ports\ARM-Cortex-M3\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uC- #
# CPU\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\. #
# .\..\uC-CPU\ARM-Cortex-M3\IAR\ -On --use_c++_inline #
# List file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\bsp.lst #
# Object file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
# \bsp.o #
# #
# #
###############################################################################
F:\stm32\我的程序\Micrium\Software\EWARM\BSP\bsp.c
1 /*
2 *********************************************************************************************************
3 * MICIRUM BOARD SUPPORT PACKAGE
4 *
5 * (c) Copyright 2007; Micrium, Inc.; Weston, FL
6 *
7 * All rights reserved. Protected by international copyright laws.
8 * Knowledge of the source code may NOT be used to develop a similar product.
9 * Please help us continue to provide the Embedded community with the finest
10 * software available. Your honesty is greatly appreciated.
11 *********************************************************************************************************
12 */
13
14 /*
15 *********************************************************************************************************
16 *
17 * BOARD SUPPORT PACKAGE
18 *
19 * ST Microelectronics STM32
20 * on the
21 *
22 * Micrium uC-Eval-STM32F107
23 * Evaluation Board
24 *
25 * Filename : bsp.c
26 * Version : V1.00
27 * Programmer(s) : EHS
28 *********************************************************************************************************
29 */
30
31 /*
32 *********************************************************************************************************
33 * INCLUDE FILES
34 *********************************************************************************************************
35 */
36
37 #define BSP_MODULE
38 #include <bsp.h>
39
40
41 /*
42 *********************************************************************************************************
43 * LOCAL DEFINES
44 *********************************************************************************************************
45 */
46
47
48 /*
49 *********************************************************************************************************
50 * LOCAL CONSTANTS
51 *********************************************************************************************************
52 */
53
54 #define BSP_LED_START_BIT (13 - 1) /* LEDs[3:1] are sequentially connected to PTD[15:13]. */
55
56
57 /*
58 *********************************************************************************************************
59 * LOCAL DATA TYPES
60 *********************************************************************************************************
61 */
62
63
64 /*
65 *********************************************************************************************************
66 * LOCAL TABLES
67 *********************************************************************************************************
68 */
69
70
71 /*
72 *********************************************************************************************************
73 * LOCAL GLOBAL VARIABLES
74 *********************************************************************************************************
75 */
76
\ In section .bss, align 4
77 CPU_INT32U BSP_CPU_ClkFreq_MHz;
\ BSP_CPU_ClkFreq_MHz:
\ 00000000 DS8 4
78
79
80 /*
81 *********************************************************************************************************
82 * LOCAL FUNCTION PROTOTYPES
83 *********************************************************************************************************
84 */
85
86 static void BSP_LED_Init (void);
87 static void BSP_StatusInit (void);
88
89 /*
90 *********************************************************************************************************
91 * REGISTERS
92 *********************************************************************************************************
93 */
94
95 #define DWT_CR *(CPU_REG32 *)0xE0001000
96 #define DWT_CYCCNT *(CPU_REG32 *)0xE0001004
97 #define DEM_CR *(CPU_REG32 *)0xE000EDFC
98 #define DBGMCU_CR *(CPU_REG32 *)0xE0042004
99
100
101 /*
102 *********************************************************************************************************
103 * REGISTER BITS
104 *********************************************************************************************************
105 */
106
107 #define DBGMCU_CR_TRACE_IOEN_MASK 0x10
108 #define DBGMCU_CR_TRACE_MODE_ASYNC 0x00
109 #define DBGMCU_CR_TRACE_MODE_SYNC_01 0x40
110 #define DBGMCU_CR_TRACE_MODE_SYNC_02 0x80
111 #define DBGMCU_CR_TRACE_MODE_SYNC_04 0xC0
112 #define DBGMCU_CR_TRACE_MODE_MASK 0xC0
113
114 #define DEM_CR_TRCENA (1 << 24)
115
116 #define DWT_CR_CYCCNTENA (1 << 0)
117
118
119 /*
120 *********************************************************************************************************
121 * LOCAL CONFIGURATION ERRORS
122 *********************************************************************************************************
123 */
124
125 #if ((CPU_CFG_TS_TMR_EN != DEF_ENABLED) && \
126 (APP_CFG_PROBE_OS_PLUGIN_EN == DEF_ENABLED) && \
127 (OS_PROBE_HOOKS_EN > 0u))
128 #error "CPU_CFG_TS_EN illegally #define'd in 'cpu.h'"
129 #error " [MUST be DEF_ENABLED] when "
130 #error " using uC/Probe COM modules "
131 #endif
132
133
134 /*
135 *********************************************************************************************************
136 * BSP_Init()
137 *
138 * Description : Initialize the Board Support Package (BSP).
139 *
140 * Argument(s) : none.
141 *
142 * Return(s) : none.
143 *
144 * Caller(s) : Application.
145 *
146 * Note(s) : (1) This function SHOULD be called before any other BSP function is called.
147 *
148 * (2) CPU instruction / data tracing requires the use of the following pins :
149 * (a) (1) Aysynchronous : PB[3]
150 * (2) Synchronous 1-bit : PE[3:2]
151 * (3) Synchronous 2-bit : PE[4:2]
152 * (4) Synchronous 4-bit : PE[6:2]
153 *
154 * (b) The uC-Eval board MAY utilize the following pins depending on the application :
155 * (1) PE[5], MII_INT
156 * (1) PE[6], SDCard_Detection
157 *
158 * (c) The application may wish to adjust the trace bus width depending on I/O
159 * requirements.
160 *********************************************************************************************************
161 */
162
\ In section .text, align 2, keep-with-next
163 void BSP_Init (void)
164 {
\ BSP_Init:
\ 00000000 80B5 PUSH {R7,LR}
165 BSP_IntInit();
\ 00000002 ........ BL BSP_IntInit
166
167 SystemInit();
\ 00000006 ........ BL SystemInit
168 BSP_CPU_ClkFreq_MHz = BSP_CPU_ClkFreq() / (CPU_INT32U)1000000;
\ 0000000A ........ BL BSP_CPU_ClkFreq
\ 0000000E .... LDR.N R1,??DataTable6 ;; 0xf4240
\ 00000010 B0FBF1F0 UDIV R0,R0,R1
\ 00000014 .... LDR.N R1,??DataTable6_1
\ 00000016 0860 STR R0,[R1, #+0]
169
170 BSP_CPU_ClkFreq_MHz = BSP_CPU_ClkFreq_MHz; /* Surpress compiler warning BSP_CPU_ClkFreq_MHz ... */
\ 00000018 .... LDR.N R0,??DataTable6_1
\ 0000001A .... LDR.N R1,??DataTable6_1
\ 0000001C 0968 LDR R1,[R1, #+0]
\ 0000001E 0160 STR R1,[R0, #+0]
171 /* ... set and not used. */
172
173 BSP_LED_Init(); /* Initialize the I/Os for the LED controls. */
\ 00000020 ........ BL BSP_LED_Init
174
175 BSP_StatusInit(); /* Initialize the status input(s) */
\ 00000024 ........ BL BSP_StatusInit
176
177 #ifdef TRACE_EN /* See project / compiler preprocessor options. */
178 DBGMCU_CR |= DBGMCU_CR_TRACE_IOEN_MASK; /* Enable tracing (see Note #2). */
179 DBGMCU_CR &= ~DBGMCU_CR_TRACE_MODE_MASK; /* Clr trace mode sel bits. */
180 DBGMCU_CR |= DBGMCU_CR_TRACE_MODE_SYNC_04; /* Cfg trace mode to synch 4-bit. */
181 #endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?