bsp_fsmc.txt
11.6 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\flash\obj\bsp_fsmc.o --asm_dir=.\Flash\List\ --list_dir=.\Flash\List\ --depend=.\flash\obj\bsp_fsmc.d --cpu=Cortex-M4.fp --apcs=interwork -O1 --diag_suppress=9931,870 -I..\..\Libraries\CMSIS\Include -I..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include -I..\..\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\uCOS-III\uC-CPU -I..\..\uCOS-III\uC-LIB -I..\..\uCOS-III\uCOS-III\Ports -I..\..\uCOS-III\uCOS-III\Source -I..\..\uCOS-III\uC-CPU\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uC-LIB\Ports\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uCOS-III\Ports\ARM-Cortex-M4\Generic\RealView -I..\..\User -I..\..\User\bsp -I..\..\User\bsp\inc -I..\..\User\libapp -I..\..\RL-ARM\Config -I..\..\RL-ARM\Driver -I..\..\RL-ARM\RL-RTX\inc -I..\..\User\bsp\BSP -I..\..\RL-ARM\RL-CAN -I..\..\Libraries\DSP_LIB\Include -I..\..\MODBUS\modbus\rtu -I..\..\MODBUS\BARE\port -I..\..\MODBUS\modbus\include -I..\..\User\bsp\BSP -I..\..\PLC -I..\..\Avoid -I..\..\User\parameter -I..\..\User\LaserMotionCtr -I..\..\User\W5100S -I..\..\User\bsp -I..\..\User\CHASSIS -I..\..\User\CONTROLFUNCTION -I..\..\User\DATAUPDATE -I..\..\User\HARAWARE -I..\..\User\MOTORDRIVER -I..\..\User\NAVAGATION -I..\..\User\PLATFORM -I..\..\User\SENSOR -I.\RTE\_Flash -IC:\Users\YDJ\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\YDJ\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.13.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -D__UVISION_VERSION=527 -D_RTE_ -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -D__RTX -D__FPU_USED=1 --omf_browse=.\flash\obj\bsp_fsmc.crf ..\..\User\bsp\BSP\bsp_fsmc.c]
THUMB
AREA ||i.FSMCInitialize||, CODE, READONLY, ALIGN=1
FSMCInitialize PROC
;;;62
;;;63 void FSMCInitialize()
000000 b500 PUSH {lr}
;;;64 {
000002 b08f SUB sp,sp,#0x3c
;;;65 FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
;;;66 FSMC_NORSRAMTimingInitTypeDef p;
;;;67 #ifdef STM32F103VET6
;;;68 p.FSMC_AddressSetupTime = 0x03; // 地址的建立时间
;;;69 p.FSMC_AddressHoldTime = 0x01; // 地址的保持时间
;;;70 p.FSMC_DataSetupTime = 0x08; // 数据的保持时间
;;;71 p.FSMC_BusTurnAroundDuration = 0;
;;;72 p.FSMC_CLKDivision = 0x00; //CLK时钟输出信号的周期
;;;73 p.FSMC_DataLatency = 0;
;;;74 p.FSMC_AccessMode = FSMC_AccessMode_B; //访问模式
;;;75
;;;76 FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; // 使用NE1
;;;77 FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Enable; // 数据/地址复用
;;;78 FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR; // 存储器类型
;;;79 FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b; // 数据总线宽度
;;;80 FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
;;;81 FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low; // 等待信号有效级性
;;;82 FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
;;;83 FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
;;;84 FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
;;;85 FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
;;;86 FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
;;;87 FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
;;;88 FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p; //读时序配置指针
;;;89 FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p; //写时序配置指针
;;;90 FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
;;;91 #endif
;;;92 #ifdef STM32F103ZET6
;;;93 p.FSMC_AddressSetupTime = 0x00; // 地址的建立时间
;;;94 p.FSMC_AddressHoldTime =0; // 地址的保持时间
;;;95 p.FSMC_DataSetupTime = 0x03; // 数据的保持时间
;;;96 p.FSMC_BusTurnAroundDuration = 0x00;
;;;97 p.FSMC_CLKDivision = 0; //CLK时钟输出信号的周期
;;;98 p.FSMC_DataLatency = 0;
;;;99 p.FSMC_AccessMode = FSMC_AccessMode_A; //访问模式
;;;100
;;;101 FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1; // 使用NE1
;;;102 FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; // 数据/地址不复用
;;;103 FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM; // 存储器类型
;;;104 FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b; // 数据总线宽度
;;;105 FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
;;;106 FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low; // 等待信号有效级性
;;;107 FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
;;;108 FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
;;;109 FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
;;;110 FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
;;;111 FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
;;;112 FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
;;;113 FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
;;;114 FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p; //读时序配置指针
;;;115 FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p; //写时序配置指针
;;;116 #endif
;;;117 FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
000004 4668 MOV r0,sp
000006 f7fffffe BL FSMC_NORSRAMInit
;;;118 FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
00000a 2101 MOVS r1,#1
00000c 2000 MOVS r0,#0
00000e f7fffffe BL FSMC_NORSRAMCmd
;;;119 }
000012 b00f ADD sp,sp,#0x3c
000014 bd00 POP {pc}
ENDP
AREA ||i.FSMC_gpio_init||, CODE, READONLY, ALIGN=2
FSMC_gpio_init PROC
;;;19
;;;20 void FSMC_gpio_init(void)
000000 b57c PUSH {r2-r6,lr}
;;;21 {
;;;22 GPIO_InitTypeDef GPIO_InitStructure;
;;;23 // RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOF | RCC_APB2Periph_GPIOE, ENABLE);
;;;24 RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOF|RCC_AHB1Periph_GPIOE,ENABLE);
000002 2101 MOVS r1,#1
000004 203a MOVS r0,#0x3a
000006 f7fffffe BL RCC_AHB1PeriphClockCmd
;;;25 // RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
;;;26 RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
00000a 2101 MOVS r1,#1
00000c 4608 MOV r0,r1
00000e f7fffffe BL RCC_AHB3PeriphClockCmd
;;;27
;;;28 // GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
;;;29 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
000012 2402 MOVS r4,#2
000014 f88d4004 STRB r4,[sp,#4]
;;;30 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
000018 f88d4005 STRB r4,[sp,#5]
;;;31 /* PD-14 -> D0 | PD-15 -> D1 | PD-00 -> D2 | PD-01 -> D3 */
;;;32 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_14 | GPIO_Pin_15;
00001c f24c0003 MOV r0,#0xc003
000020 9000 STR r0,[sp,#0]
;;;33 GPIO_Init(GPIOD, &GPIO_InitStructure);
000022 4d11 LDR r5,|L2.104|
000024 4669 MOV r1,sp
000026 4628 MOV r0,r5
000028 f7fffffe BL GPIO_Init
;;;34 /* PE-07 -> D4 | PE-08 -> D5 | PE-09 -> D6 | PE-10 -> D7 */
;;;35 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 ;
00002c f44f61f0 MOV r1,#0x780
000030 9100 STR r1,[sp,#0]
;;;36 GPIO_Init(GPIOE, &GPIO_InitStructure);
000032 4669 MOV r1,sp
000034 480d LDR r0,|L2.108|
000036 f7fffffe BL GPIO_Init
;;;37 /* PD-04 -> FSMC_NOE --RD | PD-05 -> FSMC_NWE --WR*/
;;;38 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 |GPIO_Pin_5;
00003a 2130 MOVS r1,#0x30
00003c 9100 STR r1,[sp,#0]
;;;39 GPIO_Init(GPIOD, &GPIO_InitStructure);
00003e 4669 MOV r1,sp
000040 4628 MOV r0,r5
000042 f7fffffe BL GPIO_Init
;;;40 /* PD-07 -> FSMC_NE1 -- CS */
;;;41 // GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
;;;42 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
000046 2101 MOVS r1,#1
000048 f88d1004 STRB r1,[sp,#4]
;;;43 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
00004c f88d4005 STRB r4,[sp,#5]
;;;44 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
000050 2180 MOVS r1,#0x80
000052 9100 STR r1,[sp,#0]
;;;45 GPIO_Init(GPIOD, &GPIO_InitStructure);
000054 4669 MOV r1,sp
000056 4628 MOV r0,r5
000058 f7fffffe BL GPIO_Init
;;;46 GPIO_WriteBit(GPIOD,GPIO_Pin_7,Bit_RESET);
00005c 2200 MOVS r2,#0
00005e 2180 MOVS r1,#0x80
000060 4628 MOV r0,r5
000062 f7fffffe BL GPIO_WriteBit
;;;47 #ifdef STM32F103VET6
;;;48 /* PB-07 -> FSMC_NADV */
;;;49 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
;;;50 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
;;;51 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
;;;52 GPIO_Init(GPIOB, &GPIO_InitStructure);
;;;53 #endif
;;;54 #ifdef STM32F103ZET6
;;;55 /* PF-00 -> A0 | PF-01 -> A1 */
;;;56 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
;;;57 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
;;;58 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
;;;59 GPIO_Init(GPIOF, &GPIO_InitStructure);
;;;60 #endif
;;;61 }
000066 bd7c POP {r2-r6,pc}
;;;62
ENDP
|L2.104|
DCD 0x40020c00
|L2.108|
DCD 0x40021000
;*** Start embedded assembler ***
#line 1 "..\\..\\User\\bsp\\BSP\\bsp_fsmc.c"
AREA ||.rev16_text||, CODE
THUMB
EXPORT |__asm___10_bsp_fsmc_c_5b54203c____REV16|
#line 129 "..\\..\\Libraries\\CMSIS\\Include\\core_cmInstr.h"
|__asm___10_bsp_fsmc_c_5b54203c____REV16| PROC
#line 130
rev16 r0, r0
bx lr
ENDP
AREA ||.revsh_text||, CODE
THUMB
EXPORT |__asm___10_bsp_fsmc_c_5b54203c____REVSH|
#line 144
|__asm___10_bsp_fsmc_c_5b54203c____REVSH| PROC
#line 145
revsh r0, r0
bx lr
ENDP
AREA ||.rrx_text||, CODE
THUMB
EXPORT |__asm___10_bsp_fsmc_c_5b54203c____RRX|
#line 300
|__asm___10_bsp_fsmc_c_5b54203c____RRX| PROC
#line 301
rrx r0, r0
bx lr
ENDP
;*** End embedded assembler ***