搜索
查看
编辑修改
首页
UNITY
NODEJS
PYTHON
AI
GIT
PHP
GO
CEF3
JAVA
HTML
CSS
搜索
小蓝xlanll
这个屌丝很懒,什么也没留下!
关注作者
热门标签
jquery
HTML
CSS
PHP
ASP
PYTHON
GO
AI
C
C++
C#
PHOTOSHOP
UNITY
iOS
android
vue
xml
爬虫
SEO
LINUX
WINDOWS
JAVA
MFC
CEF3
CAD
NODEJS
GIT
Pyppeteer
article
热门文章
1
路由器静态IP地址怎么设置?静态独享IP如何让网速更加稳定?_路由器静态ip设置参数
2
yolov5-Lite通过修改Detect.py代码实现灵活的检测图像、视频和打开摄像头检测_yolo 检测摄像头是否打开
3
【鸿蒙4.0】安装DevEcoStudio_deveco studio 4.0
4
渗透测试之SQL注入(GET基于报错信息的注入--联合查询、GET报错注入、GET基于布尔型的盲注--布尔盲注、GET基于时间的盲注--延时查询)、SQLi-Labs的下载安装_get渗透
5
专业性的PDF文档创建组件Spire.PDF for .NET控件_该文档是使用spire.pdf为.n et创建的
6
【(新手必看)零基础教你使用Anaconda创建虚拟环境】
7
python解析json数据_python json {"status":"313","message":"filed\u591a
8
js 数据响应式(一)之Proxy(代理)_js获取proxy的值
9
大作业练习:用Asp.net Mvc4做一个:学生考试成绩管理系统-简易版_asp net 大作业
10
浅谈linux性能调优之十二:红帽优化策略Tuned_throughput-performance 文件位置
当前位置:
article
> 正文
stm32启动过程(汇编代码)及汇编到main函数的转换过程的实现_ⅹⅹⅹⅹ69
作者:小蓝xlanll | 2024-02-27 20:56:41
赞
踩
ⅹⅹⅹⅹ69
0x08000000 0210 LSLS r0,r2,#8
0x08000002 2000 MOVS r0,#0x00
0x08000004 1905 ADDS r5,r0,r4
0x08000006 0800 LSRS r0,r0,#0
0x08000008 1909 ADDS r1,r1,r4
0x0800000A 0800 LSRS r0,r0,#0
0x0800000C 190B ADDS r3,r1,r4
0x0800000E 0800 LSRS r0,r0,#0
0x08000010 190D ADDS r5,r1,r4
0x08000012 0800 LSRS r0,r0,#0
0x08000014 190F ADDS r7,r1,r4
0x08000016 0800 LSRS r0,r0,#0
0x08000018 1911 ADDS r1,r2,r4
0x0800001A 0800 LSRS r0,r0,#0
0x0800001C 0000 MOVS r0,r0
0x0800001E 0000 MOVS r0,r0
0x08000020 0000 MOVS r0,r0
0x08000022 0000 MOVS r0,r0
0x08000024 0000 MOVS r0,r0
0x08000026 0000 MOVS r0,r0
0x08000028 0000 MOVS r0,r0
0x0800002A 0000 MOVS r0,r0
0x0800002C 1913 ADDS r3,r2,r4
0x0800002E 0800 LSRS r0,r0,#0
0x08000030 1915 ADDS r5,r2,r4
0x08000032 0800 LSRS r0,r0,#0
0x08000034 0000 MOVS r0,r0
0x08000036 0000 MOVS r0,r0
0x08000038 1917 ADDS r7,r2,r4
0x0800003A 0800 LSRS r0,r0,#0
0x0800003C 0101 LSLS r1,r0,#4
0x0800003E 0800 LSRS r0,r0,#0
0x08000040 191B ADDS r3,r3,r4
0x08000042 0800 LSRS r0,r0,#0
0x08000044 191B ADDS r3,r3,r4
0x08000046 0800 LSRS r0,r0,#0
0x08000048 191B ADDS r3,r3,r4
0x0800004A 0800 LSRS r0,r0,#0
0x0800004C 191B ADDS r3,r3,r4
0x0800004E 0800 LSRS r0,r0,#0
0x08000050 191B ADDS r3,r3,r4
0x08000052 0800 LSRS r0,r0,#0
0x08000054 191B ADDS r3,r3,r4
0x08000056 0800 LSRS r0,r0,#0
0x08000058 191B ADDS r3,r3,r4
0x0800005A 0800 LSRS r0,r0,#0
0x0800005C 191B ADDS r3,r3,r4
0x0800005E 0800 LSRS r0,r0,#0
0x08000060 191B ADDS r3,r3,r4
0x08000062 0800 LSRS r0,r0,#0
0x08000064 191B ADDS r3,r3,r4
0x08000066 0800 LSRS r0,r0,#0
0x08000068 191B ADDS r3,r3,r4
0x0800006A 0800 LSRS r0,r0,#0
0x0800006C 191B ADDS r3,r3,r4
0x0800006E 0800 LSRS r0,r0,#0
0x08000070 191B ADDS r3,r3,r4
0x08000072 0800 LSRS r0,r0,#0
0x08000074 191B ADDS r3,r3,r4
0x08000076 0800 LSRS r0,r0,#0
0x08000078 191B ADDS r3,r3,r4
0x0800007A 0800 LSRS r0,r0,#0
0x0800007C 191B ADDS r3,r3,r4
0x0800007E 0800 LSRS r0,r0,#0
0x08000080 191B ADDS r3,r3,r4
0x08000082 0800 LSRS r0,r0,#0
0x08000084 191B ADDS r3,r3,r4
0x08000086 0800 LSRS r0,r0,#0
0x08000088 191B ADDS r3,r3,r4
0x0800008A 0800 LSRS r0,r0,#0
0x0800008C 191B ADDS r3,r3,r4
0x0800008E 0800 LSRS r0,r0,#0
0x08000090 191B ADDS r3,r3,r4
0x08000092 0800 LSRS r0,r0,#0
0x08000094 191B ADDS r3,r3,r4
0x08000096 0800 LSRS r0,r0,#0
0x08000098 191B ADDS r3,r3,r4
0x0800009A 0800 LSRS r0,r0,#0
0x0800009C 191B ADDS r3,r3,r4
0x0800009E 0800 LSRS r0,r0,#0
0x080000A0 191B ADDS r3,r3,r4
0x080000A2 0800 LSRS r0,r0,#0
0x080000A4 191B ADDS r3,r3,r4
0x080000A6 0800 LSRS r0,r0,#0
0x080000A8 191B ADDS r3,r3,r4
0x080000AA 0800 LSRS r0,r0,#0
0x080000AC 191B ADDS r3,r3,r4
0x080000AE 0800 LSRS r0,r0,#0
0x080000B0 191B ADDS r3,r3,r4
0x080000B2 0800 LSRS r0,r0,#0
0x080000B4 191B ADDS r3,r3,r4
0x080000B6 0800 LSRS r0,r0,#0
0x080000B8 191B ADDS r3,r3,r4
0x080000BA 0800 LSRS r0,r0,#0
0x080000BC 191B ADDS r3,r3,r4
0x080000BE 0800 LSRS r0,r0,#0
0x080000C0 191B ADDS r3,r3,r4
0x080000C2 0800 LSRS r0,r0,#0
0x080000C4 191B ADDS r3,r3,r4
0x080000C6 0800 LSRS r0,r0,#0
0x080000C8 191B ADDS r3,r3,r4
0x080000CA 0800 LSRS r0,r0,#0
0x080000CC 191B ADDS r3,r3,r4
0x080000CE 0800 LSRS r0,r0,#0
0x080000D0 191B ADDS r3,r3,r4
0x080000D2 0800 LSRS r0,r0,#0
0x080000D4 191B ADDS r3,r3,r4
0x080000D6 0800 LSRS r0,r0,#0
0x080000D8 191B ADDS r3,r3,r4
0x080000DA 0800 LSRS r0,r0,#0
0x080000DC 191B ADDS r3,r3,r4
0x080000DE 0800 LSRS r0,r0,#0
0x080000E0 191B ADDS r3,r3,r4
0x080000E2 0800 LSRS r0,r0,#0
0x080000E4 191B ADDS r3,r3,r4
0x080000E6 0800 LSRS r0,r0,#0
0x080000E8 191B ADDS r3,r3,r4
0x080000EA 0800 LSRS r0,r0,#0
_main_stk:
0x080000EC F8DFD00C LDR.W sp,[pc,#12] ; @0x080000FC
_main_scatterload:
0x080000F0 F001FC62 BL.W __scatterload_rt2 (0x080019B8)
_main_init:
0x080000F4 4800 LDR r0,[pc,#0] ; @0x080000F8;r0=0x08000119
0x080000F6 4700 BX r0
0x080000F8 0119 LSLS r1,r3,#4
0x080000FA 0800 LSRS r0,r0,#0
0x080000FC 0210 LSLS r0,r2,#8
0x080000FE 2000 MOVS r0,#0x00
31: TimeTick++;
0x08000100 488D LDR r0,[pc,#564] ; @0x08000338
0x08000102 6801 LDR r1,[r0,#0x00]
0x08000104 1C49 ADDS r1,r1,#1
0x08000106 6001 STR r1,[r0,#0x00]
32: }
33:
34: void Delay (unsigned long tick) {
35: unsigned long timetick;
36:
0x08000108 4770 BX lr
37: timetick = TimeTick;
0x0800010A 498B LDR r1,[pc,#556] ; @0x08000338
0x0800010C 680A LDR r2,[r1,#0x00]
38: while ((TimeTick - timetick) < tick);
0x0800010E 680B LDR r3,[r1,#0x00]
0x08000110 1A9B SUBS r3,r3,r2
0x08000112 4283 CMP r3,r0
0x08000114 D3FB BCC 0x0800010E
39: }
40:
41:
0x08000116 4770 BX lr
42: int main (void) {
43: unsigned long cnt;
44: unsigned char buf[6];
45:
0x08000118 B51C PUSH {r2-r4,lr}
46: SetupClock();
0x0800011A F000F945 BL.W SetupClock (0x080003A8)
47: SetupLED ();
0x0800011E F000F983 BL.W SetupLED (0x08000428)
48: SetupKBD ();
49:
0x08000122 F000F994 BL.W SetupKBD (0x0800044E)
50: SPI_FLASH_Init(); /* Initialize the SPI FLASH driver */
0x08000126 F000F9D5 BL.W SPI_FLASH_Init (0x080004D4)
51: LCD_Init(); /* Initialize the LCD */
0x0800012A F000FF5A BL.W LCD_Init (0x08000FE2)
52: LCD_Clear(White); /* Clear the LCD */
53:
54: /* Display ST Logo (if exists on SPI Flash) */
0x0800012E F64F74FF MOVW r4,#0xFFFF
0x08000132 4620 MOV r0,r4
0x08000134 F001F837 BL.W LCD_Clear (0x080011A6)
55: SPI_FLASH_BufferRead(buf, 0x0064FD00, 6);
0x08000138 4D80 LDR r5,[pc,#512] ; @0x0800033C
0x0800013A 2206 MOVS r2,#0x06
0x0800013C 4629 MOV r1,r5
0x0800013E 4668 MOV r0,sp
0x08000140 F000FB06 BL.W SPI_FLASH_BufferRead (0x08000750)
56: if (strncmp((const char *)buf, "BM\x42\x58\x02\x00", 6) == 0) {
0x08000144 2206 MOVS r2,#0x06
0x08000146 A17E ADR r1,{pc}+2 ; @0x08000340
0x08000148 4668 MOV r0,sp
0x0800014A F001FC26 BL.W strncmp (0x0800199A)
57: LCD_SetDisplayWindow(239, 319, 240, 320);
0x0800014E F44F77A0 MOV r7,#0x140
0x08000152 1E7E SUBS r6,r7,#1
0x08000154 B958 CBNZ r0,0x0800016E
0x08000156 463B MOV r3,r7
0x08000158 22F0 MOVS r2,#0xF0
0x0800015A 4631 MOV r1,r6
0x0800015C 20EF MOVS r0,#0xEF
0x0800015E F001F846 BL.W LCD_SetDisplayWindow (0x080011EE)
58: LCD_DrawBMP(0x0064FD00);
0x08000162 4628 MOV r0,r5
0x08000164 F001FA91 BL.W LCD_DrawBMP (0x0800168A)
59: Delay(100);
60: }
61:
62: /* Display STM32 Slide (if exists on SPI Flash) */
0x08000168 2064 MOVS r0,#0x64
0x0800016A F7FFFFCE BL.W Delay (0x0800010A)
63: SPI_FLASH_BufferRead(buf, 0x00414400, 6);
0x0800016E 4D76 LDR r5,[pc,#472] ; @0x08000348
0x08000170 2206 MOVS r2,#0x06
0x08000172 4629 MOV r1,r5
0x08000174 4668 MOV r0,sp
0x08000176 F000FAEB BL.W SPI_FLASH_BufferRead (0x08000750)
64: if (strncmp((const char *)buf, "BM\x42\x58\x02\x00", 6) == 0) {
0x0800017A 2206 MOVS r2,#0x06
0x0800017C A170 ADR r1,{pc}+4 ; @0x08000340
0x0800017E 4668 MOV r0,sp
0x08000180 F001FC0B BL.W strncmp (0x0800199A)
0x08000184 B958 CBNZ r0,0x0800019E
65: LCD_SetDisplayWindow(239, 319, 240, 320);
0x08000186 463B MOV r3,r7
0x08000188 22F0 MOVS r2,#0xF0
0x0800018A 4631 MOV r1,r6
0x0800018C 20EF MOVS r0,#0xEF
0x0800018E F001F82E BL.W LCD_SetDisplayWindow (0x080011EE)
66: LCD_DrawBMP(0x00414400);
0x08000192 4628 MOV r0,r5
0x08000194 F001FA79 BL.W LCD_DrawBMP (0x0800168A)
67: Delay(200);
68: }
69:
70: /* Display Keil Logo */
0x08000198 20C8 MOVS r0,#0xC8
0x0800019A F7FFFFB6 BL.W Delay (0x0800010A)
71: LCD_Clear(White); /* Clear the LCD */
0x0800019E F64F74FF MOVW r4,#0xFFFF
0x080001A2 4620 MOV r0,r4
0x080001A4 F000FFFF BL.W LCD_Clear (0x080011A6)
72: LCD_SetBackColor(White); /* Set the Back Color */
0x080001A8 4620 MOV r0,r4
0x080001AA F000FF30 BL.W LCD_SetBackColor (0x0800100E)
73: LCD_SetTextColor(0x0238); /* Set the Text Color */
74:
0x080001AE F44F700E MOV r0,#0x238
0x080001B2 F000FF29 BL.W LCD_SetTextColor (0x08001008)
75: LCD_SetDisplayWindow(144, 240, 48, 160);
0x080001B6 23A0 MOVS r3,#0xA0
0x080001B8 2230 MOVS r2,#0x30
0x080001BA 21F0 MOVS r1,#0xF0
0x080001BC 2090 MOVS r0,#0x90
0x080001BE F001F816 BL.W LCD_SetDisplayWindow (0x080011EE)
76: LCD_DrawMonoBMP((u32)Keil_Logo);
0x080001C2 4862 LDR r0,[pc,#392] ; @0x0800034C
0x080001C4 F001FA27 BL.W LCD_DrawMonoBMP (0x08001616)
77: Delay(200);
78:
0x080001C8 20C8 MOVS r0,#0xC8
0x080001CA F7FFFF9E BL.W Delay (0x0800010A)
79: LCD_SetDisplayWindow(239, 319, 240, 320);
0x080001CE 463B MOV r3,r7
0x080001D0 22F0 MOVS r2,#0xF0
0x080001D2 4631 MOV r1,r6
0x080001D4 20EF MOVS r0,#0xEF
0x080001D6 F001F80A BL.W LCD_SetDisplayWindow (0x080011EE)
80: LCD_Clear(White); /* Clear the LCD */
81:
0x080001DA 4620 MOV r0,r4
0x080001DC F000FFE3 BL.W LCD_Clear (0x080011A6)
82: LCD_SetBackColor(Blue); /* Set the Back Color */
0x080001E0 201F MOVS r0,#0x1F
0x080001E2 F000FF14 BL.W LCD_SetBackColor (0x0800100E)
83: LCD_SetTextColor(White); /* Set the Text Color */
0x080001E6 4620 MOV r0,r4
0x080001E8 F000FF0E BL.W LCD_SetTextColor (0x08001008)
84: LCD_DisplayStringLine(Line0, "STM32 Demonstration ");
0x080001EC A158 ADR r1,{pc}+4 ; @0x08000350
0x080001EE 2000 MOVS r0,#0x00
0x080001F0 F000FFC0 BL.W LCD_DisplayStringLine (0x08001174)
85: LCD_SetBackColor(White); /* Set the Back Color */
0x080001F4 4620 MOV r0,r4
0x080001F6 F000FF0A BL.W LCD_SetBackColor (0x0800100E)
86: LCD_SetTextColor(Blue); /* Set the Text Color */
0x080001FA 201F MOVS r0,#0x1F
0x080001FC F000FF04 BL.W LCD_SetTextColor (0x08001008)
87: LCD_DisplayStringLine(Line2, "Designed with RV-MDK");
88:
0x08000200 A159 ADR r1,{pc}+4 ; @0x08000368
0x08000202 2030 MOVS r0,#0x30
0x08000204 F000FFB6 BL.W LCD_DisplayStringLine (0x08001174)
89: LCD_SetBackColor(White); /* Set the Back Color */
0x08000208 4620 MOV r0,r4
0x0800020A F000FF00 BL.W LCD_SetBackColor (0x0800100E)
90: LCD_SetTextColor(Green); /* Set the Text Color */
91:
0x0800020E F44F60FC MOV r0,#0x7E0
0x08000212 F000FEF9 BL.W LCD_SetTextColor (0x08001008)
92: LCD_DisplayStringLine(Line6, " Keyboard Test: ");
93:
94: cnt = 0;
95:
96: for (;;) {
97:
0x08000216 A15A ADR r1,{pc}+2 ; @0x08000380
0x08000218 2090 MOVS r0,#0x90
0x0800021A F000FFAB BL.W LCD_DisplayStringLine (0x08001174)
98: LED_Off(0x0F); /* Turn Off all LEDs */
99: LED_On (1 << (cnt/40)); /* Turn On one LED */
100:
101: if ((cnt & 0x07) == 0) {
102: LCD_SetBackColor(Cyan);
103: LCD_DisplayChar(Line4, 319-2*cnt, ' ');
104: LCD_SetBackColor(White);
105: }
106: if (++cnt == 160) {
107: cnt = 0;
108: LCD_ClearLine(Line4);
109: }
110:
111: LCD_SetTextColor(Red);
112:
113: /* Read "Left" Key */
0x0800021E 4D5E LDR r5,[pc,#376] ; @0x08000398
114: if(!GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_1)) {
115: LCD_DisplayChar(Line8, 319-136, 0x80+9);
116: } else {
117: LCD_DisplayChar(Line8, 319-136, 0x80+8);
118: }
119:
120: /* Read "Right" Key */
121: if(!GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_0)) {
122: LCD_DisplayChar(Line8, 319-168, 0x80+11);
123: } else {
124: LCD_DisplayChar(Line8, 319-168, 0x80+10);
125: }
126:
127: /* Read "Up" Key */
0x08000220 F8DFB178 LDR.W r11,[pc,#376] ; @0x0800039C
128: if(!GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_8)) {
129: LCD_DisplayChar(Line7, 319-152, 0x80+5);
130: } else {
0x08000224 F8DF8178 LDR.W r8,[pc,#376] ; @0x080003A0
94: cnt = 0;
95:
96: for (;;) {
97:
98: LED_Off(0x0F); /* Turn Off all LEDs */
0x08000228 2400 MOVS r4,#0x00
99: LED_On (1 << (cnt/40)); /* Turn On one LED */
100:
0x0800022A F04F0928 MOV r9,#0x28
0x0800022E F04F0A01 MOV r10,#0x01
98: LED_Off(0x0F); /* Turn Off all LEDs */
99: LED_On (1 << (cnt/40)); /* Turn On one LED */
100:
0x08000232 68E8 LDR r0,[r5,#0x0C]
0x08000234 F4207070 BIC r0,r0,#0x3C0
0x08000238 60E8 STR r0,[r5,#0x0C]
0x0800023A FBB4F1F9 UDIV r1,r4,r9
0x0800023E FA0AF001 LSL r0,r10,r1
0x08000242 68E9 LDR r1,[r5,#0x0C]
0x08000244 EA411080 ORR r0,r1,r0,LSL #6
0x08000248 60E8 STR r0,[r5,#0x0C]
101: if ((cnt & 0x07) == 0) {
0x0800024A 0760 LSLS r0,r4,#29
0x0800024C D10F BNE 0x0800026E
102: LCD_SetBackColor(Cyan);
0x0800024E F64770FF MOVW r0,#0x7FFF
0x08000252 F000FEDC BL.W LCD_SetBackColor (0x0800100E)
103: LCD_DisplayChar(Line4, 319-2*cnt, ' ');
0x08000256 4260 RSBS r0,r4,#0
0x08000258 EB060040 ADD r0,r6,r0,LSL #1
0x0800025C B281 UXTH r1,r0
0x0800025E 2220 MOVS r2,#0x20
0x08000260 2060 MOVS r0,#0x60
0x08000262 F000FF7F BL.W LCD_DisplayChar (0x08001164)
104: LCD_SetBackColor(White);
105: }
0x08000266 F64F70FF MOVW r0,#0xFFFF
0x0800026A F000FED0 BL.W LCD_SetBackColor (0x0800100E)
106: if (++cnt == 160) {
0x0800026E 1C64 ADDS r4,r4,#1
0x08000270 2CA0 CMP r4,#0xA0
0x08000272 D103 BNE 0x0800027C
107: cnt = 0;
0x08000274 2400 MOVS r4,#0x00
108: LCD_ClearLine(Line4);
109: }
110:
0x08000276 2060 MOVS r0,#0x60
0x08000278 F000FF93 BL.W LCD_ClearLine (0x080011A2)
111: LCD_SetTextColor(Red);
112:
113: /* Read "Left" Key */
0x0800027C F44F4078 MOV r0,#0xF800
0x08000280 F000FEC2 BL.W LCD_SetTextColor (0x08001008)
114: if(!GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_1)) {
115: LCD_DisplayChar(Line8, 319-136, 0x80+9);
116: } else {
0x08000284 2102 MOVS r1,#0x02
0x08000286 465F MOV r7,r11
0x08000288 4658 MOV r0,r11
0x0800028A F001FC23 BL.W GPIO_ReadInputDataBit (0x08001AD4)
0x0800028E B3F0 CBZ r0,0x0800030E
117: LCD_DisplayChar(Line8, 319-136, 0x80+8);
118: }
119:
120: /* Read "Right" Key */
0x08000290 2288 MOVS r2,#0x88
0x08000292 21B7 MOVS r1,#0xB7
0x08000294 20C0 MOVS r0,#0xC0
0x08000296 F000FF65 BL.W LCD_DisplayChar (0x08001164)
121: if(!GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_0)) {
122: LCD_DisplayChar(Line8, 319-168, 0x80+11);
123: } else {
0x0800029A 2101 MOVS r1,#0x01
0x0800029C 4638 MOV r0,r7
0x0800029E F001FC19 BL.W GPIO_ReadInputDataBit (0x08001AD4)
0x080002A2 B3A8 CBZ r0,0x08000310
124: LCD_DisplayChar(Line8, 319-168, 0x80+10);
125: }
126:
127: /* Read "Up" Key */
0x080002A4 228A MOVS r2,#0x8A
0x080002A6 2197 MOVS r1,#0x97
0x080002A8 20C0 MOVS r0,#0xC0
0x080002AA F000FF5B BL.W LCD_DisplayChar (0x08001164)
128: if(!GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_8)) {
129: LCD_DisplayChar(Line7, 319-152, 0x80+5);
130: } else {
0x080002AE F44F7180 MOV r1,#0x100
0x080002B2 4647 MOV r7,r8
0x080002B4 4640 MOV r0,r8
0x080002B6 F001FC0D BL.W GPIO_ReadInputDataBit (0x08001AD4)
0x080002BA B350 CBZ r0,0x08000312
131: LCD_DisplayChar(Line7, 319-152, 0x80+4);
132: }
133:
134: /* Read "Down" Key */
0x080002BC 2284 MOVS r2,#0x84
0x080002BE 21A7 MOVS r1,#0xA7
0x080002C0 20A8 MOVS r0,#0xA8
0x080002C2 F000FF4F BL.W LCD_DisplayChar (0x08001164)
135: if(!GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_14)) {
136: LCD_DisplayChar(Line9, 319-152, 0x80+7);
137: } else {
0x080002C6 F44F4180 MOV r1,#0x4000
0x080002CA 4638 MOV r0,r7
0x080002CC F001FC02 BL.W GPIO_ReadInputDataBit (0x08001AD4)
0x080002D0 B360 CBZ r0,0x0800032C
138: LCD_DisplayChar(Line9, 319-152, 0x80+6);
139: }
140:
141: /* Read "Sel" Key */
0x080002D2 2286 MOVS r2,#0x86
0x080002D4 21A7 MOVS r1,#0xA7
0x080002D6 20D8 MOVS r0,#0xD8
0x080002D8 F000FF44 BL.W LCD_DisplayChar (0x08001164)
142: if(!GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_12)) {
143: LCD_DisplayChar(Line8, 319-152, 0x80+1);
144: } else {
0x080002DC F44F5180 MOV r1,#0x1000
0x080002E0 4638 MOV r0,r7
0x080002E2 F001FBF7 BL.W GPIO_ReadInputDataBit (0x08001AD4)
0x080002E6 B318 CBZ r0,0x08000330
145: LCD_DisplayChar(Line8, 319-152, 0x80+0);
146: }
147:
0x080002E8 2280 MOVS r2,#0x80
0x080002EA 21A7 MOVS r1,#0xA7
0x080002EC 20C0 MOVS r0,#0xC0
0x080002EE F000FF39 BL.W LCD_DisplayChar (0x08001164)
148: LCD_SetTextColor(Magenta);
149:
150: /* Read "Key" Key */
0x080002F2 F64F001F MOVW r0,#0xF81F
0x080002F6 F000FE87 BL.W LCD_SetTextColor (0x08001008)
151: if(!GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_9)) {
152: LCD_DisplayChar(Line8, 319-206, 0x80+3);
153: } else {
0x080002FA F44F7100 MOV r1,#0x200
0x080002FE 4829 LDR r0,[pc,#164] ; @0x080003A4
0x08000300 F001FBE8 BL.W GPIO_ReadInputDataBit (0x08001AD4)
0x08000304 B1B0 CBZ r0,0x08000334
154: LCD_DisplayChar(Line8, 319-206, 0x80+2);
155: }
156:
0x08000306 2282 MOVS r2,#0x82
0x08000308 2171 MOVS r1,#0x71
0x0800030A 20C0 MOVS r0,#0xC0
0x0800030C E002 B 0x08000314
0x0800030E E007 B 0x08000320
0x08000310 E008 B 0x08000324
0x08000312 E009 B 0x08000328
0x08000314 F000FF26 BL.W LCD_DisplayChar (0x08001164)
157: Delay(5);
0x08000318 2005 MOVS r0,#0x05
0x0800031A F7FFFEF6 BL.W Delay (0x0800010A)
0x0800031E E788 B 0x08000232
115: LCD_DisplayChar(Line8, 319-136, 0x80+9);
116: } else {
117: LCD_DisplayChar(Line8, 319-136, 0x80+8);
118: }
119:
120: /* Read "Right" Key */
121: if(!GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_0)) {
0x08000320 2289 MOVS r2,#0x89
0x08000322 E7B6 B 0x08000292
122: LCD_DisplayChar(Line8, 319-168, 0x80+11);
123: } else {
124: LCD_DisplayChar(Line8, 319-168, 0x80+10);
125: }
126:
127: /* Read "Up" Key */
128: if(!GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_8)) {
0x08000324 228B MOVS r2,#0x8B
0x08000326 E7BE B 0x080002A6
129: LCD_DisplayChar(Line7, 319-152, 0x80+5);
130: } else {
131: LCD_DisplayChar(Line7, 319-152, 0x80+4);
132: }
133:
134: /* Read "Down" Key */
135: if(!GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_14)) {
0x08000328 2285 MOVS r2,#0x85
0x0800032A E7C8 B 0x080002BE
136: LCD_DisplayChar(Line9, 319-152, 0x80+7);
137: } else {
138: LCD_DisplayChar(Line9, 319-152, 0x80+6);
139: }
140:
141: /* Read "Sel" Key */
142: if(!GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_12)) {
0x0800032C 2287 MOVS r2,#0x87
0x0800032E E7D1 B 0x080002D4
143: LCD_DisplayChar(Line8, 319-152, 0x80+1);
144: } else {
145: LCD_DisplayChar(Line8, 319-152, 0x80+0);
146: }
147:
148: LCD_SetTextColor(Magenta);
149:
150: /* Read "Key" Key */
151: if(!GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_9)) {
0x08000330 2281 MOVS r2,#0x81
0x08000332 E7DA B 0x080002EA
152: LCD_DisplayChar(Line8, 319-206, 0x80+3);
0x08000334 2283 MOVS r2,#0x83
0x08000336 E7E7 B 0x08000308
0x08000338 0000 MOVS r0,r0
0x0800033A 2000 MOVS r0,#0x00
0x0800033C FD000064 DCD 0xFD000064 ; ? Undefined
0x08000340 4D42 LDR r5,[pc,#264] ; @0x0800044C
0x08000342 5842 LDR r2,[r0,r1]
0x08000344 0002 MOVS r2,r0
0x08000346 0000 MOVS r0,r0
0x08000348 4400 ADD r0,r0,r0
0x0800034A 0041 LSLS r1,r0,#1
0x0800034C 31E8 ADDS r1,r1,#0xE8
0x0800034E 0800 LSRS r0,r0,#0
0x08000350 5453 STRB r3,[r2,r1]
0x08000352 334D ADDS r3,r3,#0x4D
0x08000354 2032 MOVS r0,#0x32
0x08000356 6544 STR r4,[r0,#0x54]
0x08000358 6F6D LDR r5,[r5,#0x74]
0x0800035A 736E STRB r6,[r5,#0x0D]
0x0800035C 7274 STRB r4,[r6,#0x09]
0x0800035E 7461 STRB r1,[r4,#0x11]
0x08000360 6F69 LDR r1,[r5,#0x74]
0x08000362 206E MOVS r0,#0x6E
0x08000364 0000 MOVS r0,r0
0x08000366 0000 MOVS r0,r0
0x08000368 6544 STR r4,[r0,#0x54]
0x0800036A 6973 LDR r3,[r6,#0x14]
0x0800036C 6E67 LDR r7,[r4,#0x64]
0x0800036E 6465 STR r5,[r4,#0x44]
0x08000370 7720 STRB r0,[r4,#0x1C]
0x08000372 7469 STRB r1,[r5,#0x11]
0x08000374 2068 MOVS r0,#0x68
0x08000376 5652 LDRSB r2,[r2,r1]
0x08000378 4D2D LDR r5,[pc,#180] ; @0x08000430
0x0800037A 4B44 LDR r3,[pc,#272] ; @0x0800048C
0x0800037C 0000 MOVS r0,r0
0x0800037E 0000 MOVS r0,r0
0x08000380 2020 MOVS r0,#0x20
0x08000382 4B20 LDR r3,[pc,#128] ; @0x08000404
0x08000384 7965 LDRB r5,[r4,#0x05]
0x08000386 6F62 LDR r2,[r4,#0x74]
0x08000388 7261 STRB r1,[r4,#0x09]
0x0800038A 2064 MOVS r0,#0x64
0x0800038C 6554 STR r4,[r2,#0x54]
0x0800038E 7473 STRB r3,[r6,#0x11]
0x08000390 203A MOVS r0,#0x3A
0x08000392 2020 MOVS r0,#0x20
0x08000394 0000 MOVS r0,r0
0x08000396 0000 MOVS r0,r0
0x08000398 1000 ASRS r0,r0,#0
0x0800039A 4001 ANDS r1,r1,r0
0x0800039C 1800 ADDS r0,r0,r0
0x0800039E 4001 ANDS r1,r1,r0
0x080003A0 1400 ASRS r0,r0,#16
0x080003A2 4001 ANDS r1,r1,r0
0x080003A4 0C00 LSRS r0,r0,#16
0x080003A6 4001 ANDS r1,r1,r0
15: {
0x080003A8 B510 PUSH {r4,lr}
16: RCC_DeInit (); /* RCC system reset(for debug purpose)*/
0x080003AA F001FBDD BL.W RCC_DeInit (0x08001B68)
17: RCC_HSEConfig (RCC_HSE_ON); /* Enable HSE */
18:
19: /* Wait till HSE is ready */
0x080003AE F44F3480 MOV r4,#0x10000
0x080003B2 4620 MOV r0,r4
0x080003B4 F001FC20 BL.W RCC_HSEConfig (0x08001BF8)
20: while (RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET);
21:
0x080003B8 2031 MOVS r0,#0x31
0x080003BA F001FBF3 BL.W RCC_GetFlagStatus (0x08001BA4)
0x080003BE 2800 CMP r0,#0x00
0x080003C0 D0FA BEQ 0x080003B8
22: RCC_HCLKConfig (RCC_SYSCLK_Div1); /* HCLK = SYSCLK */
0x080003C2 2000 MOVS r0,#0x00
0x080003C4 F001FC0E BL.W RCC_HCLKConfig (0x08001BE4)
23: RCC_PCLK2Config (RCC_HCLK_Div1); /* PCLK2 = HCLK */
0x080003C8 2000 MOVS r0,#0x00
0x080003CA F001FC39 BL.W RCC_PCLK2Config (0x08001C40)
24: RCC_PCLK1Config (RCC_HCLK_Div2); /* PCLK1 = HCLK/2 */
0x080003CE F44F6080 MOV r0,#0x400
0x080003D2 F001FC2B BL.W RCC_PCLK1Config (0x08001C2C)
25: RCC_ADCCLKConfig (RCC_PCLK2_Div6); /* ADCCLK = PCLK2/6 */
26:
0x080003D6 F44F4000 MOV r0,#0x8000
0x080003DA F001FB8B BL.W RCC_ADCCLKConfig (0x08001AF4)
27: FLASH_SetLatency(FLASH_Latency_2); /* Flash 2 wait state */
0x080003DE 2002 MOVS r0,#0x02
0x080003E0 F001FB08 BL.W FLASH_SetLatency (0x080019F4)
28: FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
29:
30: /* PLLCLK = 8MHz * 9 = 72 MHz */
0x080003E4 2010 MOVS r0,#0x10
0x080003E6 F001FAF9 BL.W FLASH_PrefetchBufferCmd (0x080019DC)
31: RCC_PLLConfig (RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
32:
0x080003EA F44F11E0 MOV r1,#0x1C0000
0x080003EE 4620 MOV r0,r4
0x080003F0 F001FC36 BL.W RCC_PLLConfig (0x08001C60)
33: RCC_PLLCmd (ENABLE); /* Enable PLL */
34:
35: /* Wait till PLL is ready */
0x080003F4 2001 MOVS r0,#0x01
0x080003F6 F001FC2D BL.W RCC_PLLCmd (0x08001C54)
36: while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);
37:
38: /* Select PLL as system clock source */
0x080003FA 2039 MOVS r0,#0x39
0x080003FC F001FBD2 BL.W RCC_GetFlagStatus (0x08001BA4)
0x08000400 2800 CMP r0,#0x00
0x08000402 D0FA BEQ 0x080003FA
39: RCC_SYSCLKConfig (RCC_SYSCLKSource_PLLCLK);
40:
41: /* Wait till PLL is used as system clock source */
0x08000404 2002 MOVS r0,#0x02
0x08000406 F001FC35 BL.W RCC_SYSCLKConfig (0x08001C74)
42: while (RCC_GetSYSCLKSource() != 0x08);
43:
44: /* SysTick event each 10 ms with input clock equal to 9MHz (HCLK/8) */
0x0800040A F001FBE3 BL.W RCC_GetSYSCLKSource (0x08001BD4)
0x0800040E 2808 CMP r0,#0x08
0x08000410 D1FB BNE 0x0800040A
45: SysTick_SetReload(90000);
46:
47: /* Enable the SysTick Counter */
0x08000412 482A LDR r0,[pc,#168] ; @0x080004BC
0x08000414 F001FCB5 BL.W SysTick_SetReload (0x08001D82)
48: SysTick_CounterCmd(SysTick_Counter_Enable);
49:
50: /* Enable SysTick interrupt */
0x08000418 2001 MOVS r0,#0x01
0x0800041A F001FC94 BL.W SysTick_CounterCmd (0x08001D46)
51: SysTick_ITConfig(ENABLE);
52: }
53:
54:
55: GPIO_InitTypeDef GPIO_InitStructure;
56:
0x0800041E E8BD4010 POP {r4,lr}
0x08000422 2001 MOVS r0,#0x01
0x08000424 F001BCA1 B.W SysTick_ITConfig (0x08001D6A)
57: void SetupLED (void) {
58:
59: /* Enable GPIOC clock */
0x08000428 B510 PUSH {r4,lr}
60: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
61:
62: /* Configure PC6..PC9 as outputs push-pull, max speed 50 MHz */
0x0800042A 2101 MOVS r1,#0x01
0x0800042C 2010 MOVS r0,#0x10
0x0800042E F001FB83 BL.W RCC_APB2PeriphClockCmd (0x08001B38)
63: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7 |
64: GPIO_Pin_8 | GPIO_Pin_9;
0x08000432 4823 LDR r0,[pc,#140] ; @0x080004C0
0x08000434 F44F7170 MOV r1,#0x3C0
0x08000438 8001 STRH r1,[r0,#0x00]
65: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
0x0800043A 2110 MOVS r1,#0x10
0x0800043C 70C1 STRB r1,[r0,#0x03]
66: GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
0x0800043E 2103 MOVS r1,#0x03
0x08000440 7081 STRB r1,[r0,#0x02]
67: GPIO_Init(GPIOC, &GPIO_InitStructure);
68: }
69:
0x08000442 4601 MOV r1,r0
0x08000444 E8BD4010 POP {r4,lr}
0x08000448 481E LDR r0,[pc,#120] ; @0x080004C4
0x0800044A F001BAF3 B.W GPIO_Init (0x08001A34)
70: void SetupKBD (void) {
71:
72: /* Enable GPIOB, GPIOD, and GPIOE clocks */
0x0800044E B570 PUSH {r4-r6,lr}
73: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB |
74: RCC_APB2Periph_GPIOD |
75: RCC_APB2Periph_GPIOE, ENABLE);
76:
77: /* Configure PD.08, PD.12 and PD.14 as input floating */
0x08000450 2101 MOVS r1,#0x01
0x08000452 2068 MOVS r0,#0x68
0x08000454 F001FB70 BL.W RCC_APB2PeriphClockCmd (0x08001B38)
78: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_12 | GPIO_Pin_14;
0x08000458 4C19 LDR r4,[pc,#100] ; @0x080004C0
0x0800045A F44F40A2 MOV r0,#0x5100
79: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
0x0800045E 2504 MOVS r5,#0x04
0x08000460 8020 STRH r0,[r4,#0x00]
0x08000462 70E5 STRB r5,[r4,#0x03]
80: GPIO_Init(GPIOD, &GPIO_InitStructure);
81:
82: /* Configure PE.00 and PE.01 as input floating */
0x08000464 4621 MOV r1,r4
0x08000466 4818 LDR r0,[pc,#96] ; @0x080004C8
0x08000468 F001FAE4 BL.W GPIO_Init (0x08001A34)
83: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
0x0800046C 2003 MOVS r0,#0x03
0x0800046E 8020 STRH r0,[r4,#0x00]
84: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
0x08000470 70E5 STRB r5,[r4,#0x03]
85: GPIO_Init(GPIOE, &GPIO_InitStructure);
86:
87: /* Configure PB.09 as input floating */
0x08000472 4621 MOV r1,r4
0x08000474 4815 LDR r0,[pc,#84] ; @0x080004CC
0x08000476 F001FADD BL.W GPIO_Init (0x08001A34)
88: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
0x0800047A 01E8 LSLS r0,r5,#7
0x0800047C 8020 STRH r0,[r4,#0x00]
89: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
0x0800047E 70E5 STRB r5,[r4,#0x03]
90: GPIO_Init(GPIOB, &GPIO_InitStructure);
91:
92: /* RIGHT Button */
0x08000480 4621 MOV r1,r4
0x08000482 4813 LDR r0,[pc,#76] ; @0x080004D0
0x08000484 F001FAD6 BL.W GPIO_Init (0x08001A34)
93: GPIO_EXTILineConfig(GPIO_PortSourceGPIOE, GPIO_PinSource0);
94:
95: /* LEFT Button */
0x08000488 2100 MOVS r1,#0x00
0x0800048A 2004 MOVS r0,#0x04
0x0800048C F001FABE BL.W GPIO_EXTILineConfig (0x08001A0C)
96: GPIO_EXTILineConfig(GPIO_PortSourceGPIOE, GPIO_PinSource1);
97:
98: /* DOWN Button */
0x08000490 2101 MOVS r1,#0x01
0x08000492 2004 MOVS r0,#0x04
0x08000494 F001FABA BL.W GPIO_EXTILineConfig (0x08001A0C)
99: GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource14);
100:
101: /* UP Button */
0x08000498 210E MOVS r1,#0x0E
0x0800049A 2003 MOVS r0,#0x03
0x0800049C F001FAB6 BL.W GPIO_EXTILineConfig (0x08001A0C)
102: GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource8);
103:
104: /* SEL Button */
0x080004A0 2108 MOVS r1,#0x08
0x080004A2 2003 MOVS r0,#0x03
0x080004A4 F001FAB2 BL.W GPIO_EXTILineConfig (0x08001A0C)
105: GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource12);
106:
107: /* KEY Button */
0x080004A8 210C MOVS r1,#0x0C
0x080004AA 2003 MOVS r0,#0x03
0x080004AC F001FAAE BL.W GPIO_EXTILineConfig (0x08001A0C)
108: GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource9);
0x080004B0 E8BD4070 POP {r4-r6,lr}
0x080004B4 2109 MOVS r1,#0x09
0x080004B6 2001 MOVS r0,#0x01
0x080004B8 F001BAA8 B.W GPIO_EXTILineConfig (0x08001A0C)
0x080004BC 5F90 LDRSH r0,[r2,r6]
0x080004BE 0001 MOVS r1,r0
0x080004C0 0004 MOVS r4,r0
0x080004C2 2000 MOVS r0,#0x00
0x080004C4 1000 ASRS r0,r0,#0
0x080004C6 4001 ANDS r1,r1,r0
0x080004C8 1400 ASRS r0,r0,#16
0x080004CA 4001 ANDS r1,r1,r0
0x080004CC 1800 ADDS r0,r0,r0
0x080004CE 4001 ANDS r1,r1,r0
0x080004D0 0C00 LSRS r0,r0,#16
0x080004D2 4001 ANDS r1,r1,r0
55: {
56: SPI_InitTypeDef SPI_InitStructure;
57: GPIO_InitTypeDef GPIO_InitStructure;
58:
59: /* Enable SPI1 and GPIOA clocks */
0x080004D4 B530 PUSH {r4-r5,lr}
0x080004D6 B087 SUB sp,sp,#0x1C
60: RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1 | RCC_APB2Periph_GPIOA, ENABLE);
61:
62: /* Configure SPI1 pins: NSS, SCK, MISO and MOSI */
0x080004D8 2101 MOVS r1,#0x01
0x080004DA F2410004 MOVW r0,#0x1004
0x080004DE F001FB2B BL.W RCC_APB2PeriphClockCmd (0x08001B38)
63: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7;
0x080004E2 20E0 MOVS r0,#0xE0
0x080004E4 F8AD0014 STRH r0,[sp,#0x14]
64: GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
0x080004E8 2403 MOVS r4,#0x03
0x080004EA F88D4016 STRB r4,[sp,#0x16]
65: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
0x080004EE 2018 MOVS r0,#0x18
66: GPIO_Init(GPIOA, &GPIO_InitStructure);
67:
68: /* Configure PA.4 as Output push-pull, used as Flash Chip select */
0x080004F0 4DD3 LDR r5,[pc,#844] ; @0x08000840
0x080004F2 F88D0017 STRB r0,[sp,#0x17]
0x080004F6 A905 ADD r1,sp,#0x14
0x080004F8 4628 MOV r0,r5
0x080004FA F001FA9B BL.W GPIO_Init (0x08001A34)
69: GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
0x080004FE 2110 MOVS r1,#0x10
0x08000500 F8AD1014 STRH r1,[sp,#0x14]
70: GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
0x08000504 F88D4016 STRB r4,[sp,#0x16]
71: GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
0x08000508 F88D1017 STRB r1,[sp,#0x17]
72: GPIO_Init(GPIOA, &GPIO_InitStructure);
73:
74: /* Deselect the FLASH: Chip Select high */
0x0800050C A905 ADD r1,sp,#0x14
0x0800050E 4628 MOV r0,r5
0x08000510 F001FA90 BL.W GPIO_Init (0x08001A34)
75: SPI_FLASH_CS_HIGH();
76:
77: /* SPI1 configuration */
0x08000514 2110 MOVS r1,#0x10
0x08000516 4628 MOV r0,r5
0x08000518 F001FAE5 BL.W GPIO_SetBits (0x08001AE6)
78: SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
0x0800051C 2000 MOVS r0,#0x00
0x0800051E F8AD0000 STRH r0,[sp,#0x00]
79: SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
0x08000522 F44F7182 MOV r1,#0x104
0x08000526 F8AD1002 STRH r1,[sp,#0x02]
80: SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
0x0800052A F8AD0004 STRH r0,[sp,#0x04]
81: SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
0x0800052E 2102 MOVS r1,#0x02
0x08000530 F8AD1006 STRH r1,[sp,#0x06]
82: SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
0x08000534 2101 MOVS r1,#0x01
0x08000536 F8AD1008 STRH r1,[sp,#0x08]
83: SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
0x0800053A 0249 LSLS r1,r1,#9
0x0800053C F8AD100A STRH r1,[sp,#0x0A]
84: SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4;
0x08000540 2108 MOVS r1,#0x08
0x08000542 F8AD100C STRH r1,[sp,#0x0C]
85: SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
0x08000546 F8AD000E STRH r0,[sp,#0x0E]
86: SPI_InitStructure.SPI_CRCPolynomial = 7;
0x0800054A 2007 MOVS r0,#0x07
87: SPI_Init(SPI1, &SPI_InitStructure);
88:
89: /* Enable SPI1 */
0x0800054C 4CBD LDR r4,[pc,#756] ; @0x08000844
0x0800054E F8AD0010 STRH r0,[sp,#0x10]
0x08000552 4669 MOV r1,sp
0x08000554 4620 MOV r0,r4
0x08000556 F001FBDA BL.W SPI_Init (0x08001D0E)
90: SPI_Cmd(SPI1, ENABLE);
0x0800055A 2101 MOVS r1,#0x01
0x0800055C 4620 MOV r0,r4
0x0800055E F001FB93 BL.W SPI_Cmd (0x08001C88)
91: }
0x08000562 B007 ADD sp,sp,#0x1C
0x08000564 BD30 POP {r4-r5,pc}
397: {
398: /* Loop while DR register in not emplty */
0x08000566 B570 PUSH {r4-r6,lr}
399: while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
400:
401: /* Send byte through the SPI1 peripheral */
0x08000568 4CB6 LDR r4,[pc,#728] ; @0x08000844
0x0800056A 4605 MOV r5,r0
0x0800056C 2102 MOVS r1,#0x02
0x0800056E 4620 MOV r0,r4
0x08000570 F001FBC2 BL.W SPI_I2S_GetFlagStatus (0x08001CF8)
0x08000574 2800 CMP r0,#0x00
0x08000576 D0F9 BEQ 0x0800056C
402: SPI_I2S_SendData(SPI1, byte);
403:
404: /* Wait to receive a byte */
0x08000578 4629 MOV r1,r5
0x0800057A 4620 MOV r0,r4
0x0800057C F001FBC5 BL.W SPI_I2S_SendData (0x08001D0A)
405: while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
406:
407: /* Return the byte read from the SPI bus */
0x08000580 2101 MOVS r1,#0x01
0x08000582 4620 MOV r0,r4
0x08000584 F001FBB8 BL.W SPI_I2S_GetFlagStatus (0x08001CF8)
0x08000588 2800 CMP r0,#0x00
0x0800058A D0F9 BEQ 0x08000580
408: return SPI_I2S_ReceiveData(SPI1);
0x0800058C 4620 MOV r0,r4
0x0800058E F001FBBA BL.W SPI_I2S_ReceiveData (0x08001D06)
0x08000592 B2C0 UXTB r0,r0
409: }
0x08000594 BD70 POP {r4-r6,pc}
463: {
464: u8 FLASH_Status = 0;
465:
466: /* Select the FLASH: Chip Select low */
0x08000596 B510 PUSH {r4,lr}
467: SPI_FLASH_CS_LOW();
468:
469: /* Send "Read Status Register" instruction */
0x08000598 4CA9 LDR r4,[pc,#676] ; @0x08000840
0x0800059A 2110 MOVS r1,#0x10
0x0800059C 4620 MOV r0,r4
0x0800059E F001FAA0 BL.W GPIO_ResetBits (0x08001AE2)
470: SPI_FLASH_SendByte(RDSR);
471:
472: /* Loop as long as the memory is busy with a write cycle */
473: do
474: {
475: /* Send a dummy byte to generate the clock needed by the FLASH
476: and put the value of the status register in FLASH_Status variable */
0x080005A2 2005 MOVS r0,#0x05
0x080005A4 F7FFFFDF BL.W SPI_FLASH_SendByte (0x08000566)
477: FLASH_Status = SPI_FLASH_SendByte(Dummy_Byte);
478:
0x080005A8 20A5 MOVS r0,#0xA5
0x080005AA F7FFFFDC BL.W SPI_FLASH_SendByte (0x08000566)
479: } while((FLASH_Status & WIP_Flag) == SET); /* Write in progress */
480:
481: /* Deselect the FLASH: Chip Select high */
0x080005AE 07C0 LSLS r0,r0,#31
0x080005B0 D1FA BNE 0x080005A8
482: SPI_FLASH_CS_HIGH();
0x080005B2 4620 MOV r0,r4
0x080005B4 E8BD4010 POP {r4,lr}
0x080005B8 2110 MOVS r1,#0x10
0x080005BA F001BA94 B.W GPIO_SetBits (0x08001AE6)
442: {
443: /* Select the FLASH: Chip Select low */
0x080005BE B510 PUSH {r4,lr}
444: SPI_FLASH_CS_LOW();
445:
446: /* Send "Write Enable" instruction */
0x080005C0 4C9F LDR r4,[pc,#636] ; @0x08000840
0x080005C2 2110 MOVS r1,#0x10
0x080005C4 4620 MOV r0,r4
0x080005C6 F001FA8C BL.W GPIO_ResetBits (0x08001AE2)
447: SPI_FLASH_SendByte(WREN);
448:
449: /* Deselect the FLASH: Chip Select high */
0x080005CA 2006 MOVS r0,#0x06
0x080005CC F7FFFFCB BL.W SPI_FLASH_SendByte (0x08000566)
450: SPI_FLASH_CS_HIGH();
0x080005D0 4620 MOV r0,r4
0x080005D2 E8BD4010 POP {r4,lr}
0x080005D6 2110 MOVS r1,#0x10
0x080005D8 F001BA85 B.W GPIO_SetBits (0x08001AE6)
101: {
102: /* Send write enable instruction */
0x080005DC B570 PUSH {r4-r6,lr}
0x080005DE 4604 MOV r4,r0
103: SPI_FLASH_WriteEnable();
104:
105: /* Sector Erase */
106: /* Select the FLASH: Chip Select low */
0x080005E0 F7FFFFED BL.W SPI_FLASH_WriteEnable (0x080005BE)
107: SPI_FLASH_CS_LOW();
108: /* Send Sector Erase instruction */
0x080005E4 4D96 LDR r5,[pc,#600] ; @0x08000840
0x080005E6 2110 MOVS r1,#0x10
0x080005E8 4628 MOV r0,r5
0x080005EA F001FA7A BL.W GPIO_ResetBits (0x08001AE2)
109: SPI_FLASH_SendByte(SE);
110: /* Send SectorAddr high nibble address byte */
0x080005EE 20D8 MOVS r0,#0xD8
0x080005F0 F7FFFFB9 BL.W SPI_FLASH_SendByte (0x08000566)
111: SPI_FLASH_SendByte((SectorAddr & 0xFF0000) >> 16);
112: /* Send SectorAddr medium nibble address byte */
0x080005F4 F3C44007 UBFX r0,r4,#16,#8
0x080005F8 F7FFFFB5 BL.W SPI_FLASH_SendByte (0x08000566)
113: SPI_FLASH_SendByte((SectorAddr & 0xFF00) >> 8);
114: /* Send SectorAddr low nibble address byte */
0x080005FC F3C42007 UBFX r0,r4,#8,#8
0x08000600 F7FFFFB1 BL.W SPI_FLASH_SendByte (0x08000566)
115: SPI_FLASH_SendByte(SectorAddr & 0xFF);
116: /* Deselect the FLASH: Chip Select high */
0x08000604 B2E0 UXTB r0,r4
0x08000606 F7FFFFAE BL.W SPI_FLASH_SendByte (0x08000566)
117: SPI_FLASH_CS_HIGH();
118:
119: /* Wait the end of Flash writing */
0x0800060A 2110 MOVS r1,#0x10
0x0800060C 4628 MOV r0,r5
0x0800060E F001FA6A BL.W GPIO_SetBits (0x08001AE6)
120: SPI_FLASH_WaitForWriteEnd();
121: }
122:
123: /*******************************************************************************
124: * Function Name : SPI_FLASH_BulkErase
125: * Description : Erases the entire FLASH.
126: * Input : None
127: * Output : None
128: * Return : None
129: *******************************************************************************/
130: void SPI_FLASH_BulkErase(void)
0x08000612 E8BD4070 POP {r4-r6,lr}
0x08000616 E7BE B SPI_FLASH_WaitForWriteEnd (0x08000596)
131: {
132: /* Send write enable instruction */
0x08000618 B510 PUSH {r4,lr}
133: SPI_FLASH_WriteEnable();
134:
135: /* Bulk Erase */
136: /* Select the FLASH: Chip Select low */
0x0800061A F7FFFFD0 BL.W SPI_FLASH_WriteEnable (0x080005BE)
137: SPI_FLASH_CS_LOW();
138: /* Send Bulk Erase instruction */
0x0800061E 4C88 LDR r4,[pc,#544] ; @0x08000840
0x08000620 2110 MOVS r1,#0x10
0x08000622 4620 MOV r0,r4
0x08000624 F001FA5D BL.W GPIO_ResetBits (0x08001AE2)
139: SPI_FLASH_SendByte(BE);
140: /* Deselect the FLASH: Chip Select high */
0x08000628 20C7 MOVS r0,#0xC7
0x0800062A F7FFFF9C BL.W SPI_FLASH_SendByte (0x08000566)
141: SPI_FLASH_CS_HIGH();
142:
143: /* Wait the end of Flash writing */
0x0800062E 2110 MOVS r1,#0x10
0x08000630 4620 MOV r0,r4
0x08000632 F001FA58 BL.W GPIO_SetBits (0x08001AE6)
144: SPI_FLASH_WaitForWriteEnd();
145: }
146:
147: /*******************************************************************************
148: * Function Name : SPI_FLASH_PageWrite
149: * Description : Writes more than one byte to the FLASH with a single WRITE
150: * cycle(Page WRITE sequence). The number of byte can't exceed
151: * the FLASH page size.
152: * Input : - pBuffer : pointer to the buffer containing the data to be
153: * written to the FLASH.
154: * - WriteAddr : FLASH's internal address to write to.
155: * - NumByteToWrite : number of bytes to write to the FLASH,
156: * must be equal or less than "SPI_FLASH_PageSize" value.
157: * Output : None
158: * Return : None
159: *******************************************************************************/
160: void SPI_FLASH_PageWrite(u8* pBuffer, u32 WriteAddr, u16 NumByteToWrite)
0x08000636 E8BD4010 POP {r4,lr}
0x0800063A E7AC B SPI_FLASH_WaitForWriteEnd (0x08000596)
161: {
162: /* Enable the write access to the FLASH */
0x0800063C E92D41F0 PUSH {r4-r8,lr}
0x08000640 4605 MOV r5,r0
0x08000642 460F MOV r7,r1
0x08000644 4614 MOV r4,r2
163: SPI_FLASH_WriteEnable();
164:
165: /* Select the FLASH: Chip Select low */
0x08000646 F7FFFFBA BL.W SPI_FLASH_WriteEnable (0x080005BE)
166: SPI_FLASH_CS_LOW();
167: /* Send "Write to Memory " instruction */
0x0800064A 4E7D LDR r6,[pc,#500] ; @0x08000840
0x0800064C 2110 MOVS r1,#0x10
0x0800064E 4630 MOV r0,r6
0x08000650 F001FA47 BL.W GPIO_ResetBits (0x08001AE2)
168: SPI_FLASH_SendByte(WRITE);
169: /* Send WriteAddr high nibble address byte to write to */
0x08000654 2002 MOVS r0,#0x02
0x08000656 F7FFFF86 BL.W SPI_FLASH_SendByte (0x08000566)
170: SPI_FLASH_SendByte((WriteAddr & 0xFF0000) >> 16);
171: /* Send WriteAddr medium nibble address byte to write to */
0x0800065A F3C74007 UBFX r0,r7,#16,#8
0x0800065E F7FFFF82 BL.W SPI_FLASH_SendByte (0x08000566)
172: SPI_FLASH_SendByte((WriteAddr & 0xFF00) >> 8);
173: /* Send WriteAddr low nibble address byte to write to */
0x08000662 F3C72007 UBFX r0,r7,#8,#8
0x08000666 F7FFFF7E BL.W SPI_FLASH_SendByte (0x08000566)
174: SPI_FLASH_SendByte(WriteAddr & 0xFF);
175:
176: /* while there is data to be written on the FLASH */
0x0800066A B2F8 UXTB r0,r7
0x0800066C F7FFFF7B BL.W SPI_FLASH_SendByte (0x08000566)
177: while(NumByteToWrite--)
178: {
179: /* Send the current byte */
0x08000670 E003 B 0x0800067A
180: SPI_FLASH_SendByte(*pBuffer);
181: /* Point on the next byte to be written */
0x08000672 7828 LDRB r0,[r5,#0x00]
0x08000674 F7FFFF77 BL.W SPI_FLASH_SendByte (0x08000566)
182: pBuffer++;
183: }
184:
185: /* Deselect the FLASH: Chip Select high */
0x08000678 1C6D ADDS r5,r5,#1
0x0800067A 0020 MOVS r0,r4
0x0800067C F1A40401 SUB r4,r4,#0x01
0x08000680 B2A4 UXTH r4,r4
0x08000682 D1F6 BNE 0x08000672
186: SPI_FLASH_CS_HIGH();
187:
188: /* Wait the end of Flash writing */
0x08000684 2110 MOVS r1,#0x10
0x08000686 4630 MOV r0,r6
0x08000688 F001FA2D BL.W GPIO_SetBits (0x08001AE6)
189: SPI_FLASH_WaitForWriteEnd();
190: }
191:
192: /*******************************************************************************
193: * Function Name : SPI_FLASH_BufferWrite
194: * Description : Writes block of data to the FLASH. In this function, the
195: * number of WRITE cycles are reduced, using Page WRITE sequence.
196: * Input : - pBuffer : pointer to the buffer containing the data to be
197: * written to the FLASH.
198: * - WriteAddr : FLASH's internal address to write to.
199: * - NumByteToWrite : number of bytes to write to the FLASH.
200: * Output : None
201: * Return : None
202: *******************************************************************************/
203: void SPI_FLASH_BufferWrite(u8* pBuffer, u32 WriteAddr, u16 NumByteToWrite)
0x0800068C E8BD41F0 POP {r4-r8,lr}
0x08000690 E781 B SPI_FLASH_WaitForWriteEnd (0x08000596)
204: {
205: u8 NumOfPage = 0, NumOfSingle = 0, Addr = 0, count = 0, temp = 0;
206:
0x08000692 E92D47F0 PUSH {r4-r10,lr}
0x08000696 4606 MOV r6,r0
0x08000698 460D MOV r5,r1
207: Addr = WriteAddr % SPI_FLASH_PageSize;
0x0800069A F01100FF ANDS r0,r1,#0xFF
208: count = SPI_FLASH_PageSize - Addr;
209: NumOfPage = NumByteToWrite / SPI_FLASH_PageSize;
0x0800069E F1C00100 RSB r1,r0,#0x00
0x080006A2 B2CF UXTB r7,r1
210: NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize;
211:
212: if(Addr == 0) /* WriteAddr is SPI_FLASH_PageSize aligned */
213: {
214: if(NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */
215: {
216: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite);
217: }
218: else /* NumByteToWrite > SPI_FLASH_PageSize */
219: {
220: while(NumOfPage--)
221: {
0x080006A4 B2D1 UXTB r1,r2
209: NumOfPage = NumByteToWrite / SPI_FLASH_PageSize;
210: NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize;
211:
212: if(Addr == 0) /* WriteAddr is SPI_FLASH_PageSize aligned */
213: {
214: if(NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */
215: {
216: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite);
217: }
218: else /* NumByteToWrite > SPI_FLASH_PageSize */
219: {
220: while(NumOfPage--)
221: {
0x080006A6 EA4F2412 LSR r4,r2,#8
0x080006AA 4689 MOV r9,r1
222: SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize);
223: WriteAddr += SPI_FLASH_PageSize;
224: pBuffer += SPI_FLASH_PageSize;
225: }
226:
227: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle);
228: }
229: }
230: else /* WriteAddr is not SPI_FLASH_PageSize aligned */
231: {
232: if(NumOfPage== 0) /* NumByteToWrite < SPI_FLASH_PageSize */
233: {
234: if(NumOfSingle > count) /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */
235: {
236: temp = NumOfSingle - count;
237:
238: SPI_FLASH_PageWrite(pBuffer, WriteAddr, count);
0x080006AC F44F7A80 MOV r10,#0x100
212: if(Addr == 0) /* WriteAddr is SPI_FLASH_PageSize aligned */
0x080006B0 D013 BEQ 0x080006DA
207: Addr = WriteAddr % SPI_FLASH_PageSize;
0x080006B2 B2E8 UXTB r0,r5
208: count = SPI_FLASH_PageSize - Addr;
0x080006B4 4240 RSBS r0,r0,#0
0x080006B6 B2C0 UXTB r0,r0
239: WriteAddr += count;
240: pBuffer += count;
241:
242: SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp);
243: }
244: else
245: {
246: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite);
247: }
248: }
249: else /* NumByteToWrite > SPI_FLASH_PageSize */
250: {
0x080006B8 4428 ADD r0,r0,r5
0x080006BA 4680 MOV r8,r0
232: if(NumOfPage== 0) /* NumByteToWrite < SPI_FLASH_PageSize */
233: {
234: if(NumOfSingle > count) /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */
235: {
236: temp = NumOfSingle - count;
237:
238: SPI_FLASH_PageWrite(pBuffer, WriteAddr, count);
239: WriteAddr += count;
240: pBuffer += count;
241:
242: SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp);
243: }
244: else
245: {
246: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite);
247: }
248: }
249: else /* NumByteToWrite > SPI_FLASH_PageSize */
250: {
0x080006BC B31C CBZ r4,0x08000706
251: NumByteToWrite -= count;
0x080006BE 1BD0 SUBS r0,r2,r7
0x080006C0 B280 UXTH r0,r0
252: NumOfPage = NumByteToWrite / SPI_FLASH_PageSize;
0x080006C2 0A04 LSRS r4,r0,#8
253: NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize;
254:
0x080006C4 B2C0 UXTB r0,r0
0x080006C6 4681 MOV r9,r0
255: SPI_FLASH_PageWrite(pBuffer, WriteAddr, count);
256: WriteAddr += count;
0x080006C8 463A MOV r2,r7
0x080006CA 4629 MOV r1,r5
0x080006CC 4630 MOV r0,r6
0x080006CE F7FFFFB5 BL.W SPI_FLASH_PageWrite (0x0800063C)
257: pBuffer += count;
258:
259: while(NumOfPage--)
260: {
261: SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize);
262: WriteAddr += SPI_FLASH_PageSize;
0x080006D2 443E ADD r6,r6,r7
0x080006D4 4645 MOV r5,r8
0x080006D6 4657 MOV r7,r10
263: pBuffer += SPI_FLASH_PageSize;
264: }
265:
0x080006D8 E02E B 0x08000738
214: if(NumOfPage == 0) /* NumByteToWrite < SPI_FLASH_PageSize */
215: {
216: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite);
217: }
218: else /* NumByteToWrite > SPI_FLASH_PageSize */
219: {
220: while(NumOfPage--)
221: {
0x080006DA B17C CBZ r4,0x080006FC
222: SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize);
0x080006DC 4657 MOV r7,r10
220: while(NumOfPage--)
221: {
222: SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize);
0x080006DE 0020 MOVS r0,r4
0x080006E0 F1A40401 SUB r4,r4,#0x01
0x080006E4 B2E4 UXTB r4,r4
0x080006E6 D00C BEQ 0x08000702
0x080006E8 463A MOV r2,r7
0x080006EA 4629 MOV r1,r5
0x080006EC 4630 MOV r0,r6
0x080006EE F7FFFFA5 BL.W SPI_FLASH_PageWrite (0x0800063C)
223: WriteAddr += SPI_FLASH_PageSize;
0x080006F2 F5057580 ADD r5,r5,#0x100
224: pBuffer += SPI_FLASH_PageSize;
225: }
226:
0x080006F6 F5067680 ADD r6,r6,#0x100
0x080006FA E7F0 B 0x080006DE
216: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite);
217: }
218: else /* NumByteToWrite > SPI_FLASH_PageSize */
219: {
220: while(NumOfPage--)
221: {
222: SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize);
223: WriteAddr += SPI_FLASH_PageSize;
224: pBuffer += SPI_FLASH_PageSize;
225: }
226:
0x080006FC 4629 MOV r1,r5
0x080006FE 4630 MOV r0,r6
0x08000700 E00E B 0x08000720
227: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle);
228: }
229: }
230: else /* WriteAddr is not SPI_FLASH_PageSize aligned */
231: {
232: if(NumOfPage== 0) /* NumByteToWrite < SPI_FLASH_PageSize */
233: {
0x08000702 464A MOV r2,r9
0x08000704 E7FA B 0x080006FC
234: if(NumOfSingle > count) /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */
235: {
0x08000706 42B9 CMP r1,r7
0x08000708 D9F8 BLS 0x080006FC
236: temp = NumOfSingle - count;
237:
0x0800070A EBA90007 SUB r0,r9,r7
0x0800070E B2C4 UXTB r4,r0
238: SPI_FLASH_PageWrite(pBuffer, WriteAddr, count);
239: WriteAddr += count;
0x08000710 463A MOV r2,r7
0x08000712 4629 MOV r1,r5
0x08000714 4630 MOV r0,r6
0x08000716 F7FFFF91 BL.W SPI_FLASH_PageWrite (0x0800063C)
0x0800071A 4641 MOV r1,r8
240: pBuffer += count;
241:
0x0800071C 19F0 ADDS r0,r6,r7
242: SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp);
243: }
244: else
245: {
0x0800071E 4622 MOV r2,r4
246: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite);
247: }
248: }
249: else /* NumByteToWrite > SPI_FLASH_PageSize */
250: {
251: NumByteToWrite -= count;
252: NumOfPage = NumByteToWrite / SPI_FLASH_PageSize;
253: NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize;
254:
255: SPI_FLASH_PageWrite(pBuffer, WriteAddr, count);
256: WriteAddr += count;
257: pBuffer += count;
258:
259: while(NumOfPage--)
260: {
0x08000720 E8BD47F0 POP {r4-r10,lr}
0x08000724 E78A B SPI_FLASH_PageWrite (0x0800063C)
261: SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize);
0x08000726 463A MOV r2,r7
0x08000728 4629 MOV r1,r5
0x0800072A 4630 MOV r0,r6
0x0800072C F7FFFF86 BL.W SPI_FLASH_PageWrite (0x0800063C)
262: WriteAddr += SPI_FLASH_PageSize;
0x08000730 F5057580 ADD r5,r5,#0x100
263: pBuffer += SPI_FLASH_PageSize;
264: }
265:
0x08000734 F5067680 ADD r6,r6,#0x100
259: while(NumOfPage--)
260: {
261: SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize);
262: WriteAddr += SPI_FLASH_PageSize;
263: pBuffer += SPI_FLASH_PageSize;
264: }
265:
0x08000738 0020 MOVS r0,r4
0x0800073A F1A40401 SUB r4,r4,#0x01
0x0800073E B2E4 UXTB r4,r4
0x08000740 D1F1 BNE 0x08000726
266: if(NumOfSingle != 0)
267: {
0x08000742 EA5F0009 MOVS r0,r9
0x08000746 D001 BEQ 0x0800074C
268: SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle);
269: }
270: }
271: }
0x08000748 4602 MOV r2,r0
0x0800074A E7D7 B 0x080006FC
272: }
273:
274: /*******************************************************************************
275: * Function Name : SPI_FLASH_BufferRead
276: * Description : Reads a block of data from the FLASH.
277: * Input : - pBuffer : pointer to the buffer that receives the data read
278: * from the FLASH.
279: * - ReadAddr : FLASH's internal address to read from.
280: * - NumByteToRead : number of bytes to read from the FLASH.
281: * Output : None
282: * Return : None
283: *******************************************************************************/
284: void SPI_FLASH_BufferRead(u8* pBuffer, u32 ReadAddr, u16 NumByteToRead)
0x0800074C E8BD87F0 POP {r4-r10,pc}
285: {
286: /* Select the FLASH: Chip Select low */
0x08000750 E92D41F0 PUSH {r4-r8,lr}
287: SPI_FLASH_CS_LOW();
288:
289: /* Send "Read from Memory " instruction */
0x08000754 4E3A LDR r6,[pc,#232] ; @0x08000840
0x08000756 4604 MOV r4,r0
0x08000758 460F MOV r7,r1
0x0800075A 4615 MOV r5,r2
0x0800075C 2110 MOVS r1,#0x10
0x0800075E 4630 MOV r0,r6
0x08000760 F001F9BF BL.W GPIO_ResetBits (0x08001AE2)
290: SPI_FLASH_SendByte(READ);
291:
292: /* Send ReadAddr high nibble address byte to read from */
0x08000764 2003 MOVS r0,#0x03
0x08000766 F7FFFEFE BL.W SPI_FLASH_SendByte (0x08000566)
293: SPI_FLASH_SendByte((ReadAddr & 0xFF0000) >> 16);
294: /* Send ReadAddr medium nibble address byte to read from */
0x0800076A F3C74007 UBFX r0,r7,#16,#8
0x0800076E F7FFFEFA BL.W SPI_FLASH_SendByte (0x08000566)
295: SPI_FLASH_SendByte((ReadAddr& 0xFF00) >> 8);
296: /* Send ReadAddr low nibble address byte to read from */
0x08000772 F3C72007 UBFX r0,r7,#8,#8
0x08000776 F7FFFEF6 BL.W SPI_FLASH_SendByte (0x08000566)
297: SPI_FLASH_SendByte(ReadAddr & 0xFF);
298:
0x0800077A B2F8 UXTB r0,r7
0x0800077C F7FFFEF3 BL.W SPI_FLASH_SendByte (0x08000566)
299: while(NumByteToRead--) /* while there is data to be read */
300: {
301: /* Read a byte from the FLASH */
0x08000780 E004 B 0x0800078C
302: *pBuffer = SPI_FLASH_SendByte(Dummy_Byte);
303: /* Point to the next location where the byte read will be saved */
304: pBuffer++;
305: }
306:
307: /* Deselect the FLASH: Chip Select high */
0x08000782 20A5 MOVS r0,#0xA5
0x08000784 F7FFFEEF BL.W SPI_FLASH_SendByte (0x08000566)
0x08000788 F8040B01 STRB r0,[r4],#0x01
0x0800078C 0028 MOVS r0,r5
0x0800078E F1A50501 SUB r5,r5,#0x01
0x08000792 B2AD UXTH r5,r5
0x08000794 D1F5 BNE 0x08000782
308: SPI_FLASH_CS_HIGH();
309: }
310:
311: /*******************************************************************************
312: * Function Name : SPI_FLASH_ReadID
313: * Description : Reads FLASH identification.
314: * Input : None
315: * Output : None
316: * Return : FLASH identification
317: *******************************************************************************/
318: u32 SPI_FLASH_ReadID(void)
0x08000796 4630 MOV r0,r6
0x08000798 E8BD41F0 POP {r4-r8,lr}
0x0800079C 2110 MOVS r1,#0x10
0x0800079E F001B9A2 B.W GPIO_SetBits (0x08001AE6)
319: {
320: u32 Temp = 0, Temp0 = 0, Temp1 = 0, Temp2 = 0;
321:
322: /* Select the FLASH: Chip Select low */
0x080007A2 E92D41F0 PUSH {r4-r8,lr}
323: SPI_FLASH_CS_LOW();
324:
325: /* Send "RDID " instruction */
0x080007A6 4C26 LDR r4,[pc,#152] ; @0x08000840
0x080007A8 2110 MOVS r1,#0x10
0x080007AA 4620 MOV r0,r4
0x080007AC F001F999 BL.W GPIO_ResetBits (0x08001AE2)
326: SPI_FLASH_SendByte(0x9F);
327:
328: /* Read a byte from the FLASH */
0x080007B0 209F MOVS r0,#0x9F
0x080007B2 F7FFFED8 BL.W SPI_FLASH_SendByte (0x08000566)
329: Temp0 = SPI_FLASH_SendByte(Dummy_Byte);
330:
331: /* Read a byte from the FLASH */
0x080007B6 20A5 MOVS r0,#0xA5
0x080007B8 F7FFFED5 BL.W SPI_FLASH_SendByte (0x08000566)
0x080007BC 4606 MOV r6,r0
332: Temp1 = SPI_FLASH_SendByte(Dummy_Byte);
333:
334: /* Read a byte from the FLASH */
0x080007BE 20A5 MOVS r0,#0xA5
0x080007C0 F7FFFED1 BL.W SPI_FLASH_SendByte (0x08000566)
0x080007C4 4607 MOV r7,r0
335: Temp2 = SPI_FLASH_SendByte(Dummy_Byte);
336:
337: /* Deselect the FLASH: Chip Select high */
0x080007C6 20A5 MOVS r0,#0xA5
0x080007C8 F7FFFECD BL.W SPI_FLASH_SendByte (0x08000566)
0x080007CC 4605 MOV r5,r0
338: SPI_FLASH_CS_HIGH();
339:
0x080007CE 2110 MOVS r1,#0x10
0x080007D0 4620 MOV r0,r4
0x080007D2 F001F988 BL.W GPIO_SetBits (0x08001AE6)
340: Temp = (Temp0 << 16) | (Temp1 << 8) | Temp2;
341:
342: return Temp;
0x080007D6 0430 LSLS r0,r6,#16
0x080007D8 EA402007 ORR r0,r0,r7,LSL #8
0x080007DC 4328 ORRS r0,r0,r5
343: }
344:
345: /*******************************************************************************
346: * Function Name : SPI_FLASH_StartReadSequence
347: * Description : Initiates a read data byte (READ) sequence from the Flash.
348: * This is done by driving the /CS line low to select the device,
349: * then the READ instruction is transmitted followed by 3 bytes
350: * address. This function exit and keep the /CS line low, so the
351: * Flash still being selected. With this technique the whole
352: * content of the Flash is read with a single READ instruction.
353: * Input : - ReadAddr : FLASH's internal address to read from.
354: * Output : None
355: * Return : None
356: *******************************************************************************/
357: void SPI_FLASH_StartReadSequence(u32 ReadAddr)
0x080007DE E8BD81F0 POP {r4-r8,pc}
358: {
359: /* Select the FLASH: Chip Select low */
0x080007E2 B510 PUSH {r4,lr}
0x080007E4 4604 MOV r4,r0
360: SPI_FLASH_CS_LOW();
361:
362: /* Send "Read from Memory " instruction */
0x080007E6 2110 MOVS r1,#0x10
0x080007E8 4815 LDR r0,[pc,#84] ; @0x08000840
0x080007EA F001F97A BL.W GPIO_ResetBits (0x08001AE2)
363: SPI_FLASH_SendByte(READ);
364:
365: /* Send the 24-bit address of the address to read from -----------------------*/
366: /* Send ReadAddr high nibble address byte */
0x080007EE 2003 MOVS r0,#0x03
0x080007F0 F7FFFEB9 BL.W SPI_FLASH_SendByte (0x08000566)
367: SPI_FLASH_SendByte((ReadAddr & 0xFF0000) >> 16);
368: /* Send ReadAddr medium nibble address byte */
0x080007F4 F3C44007 UBFX r0,r4,#16,#8
0x080007F8 F7FFFEB5 BL.W SPI_FLASH_SendByte (0x08000566)
369: SPI_FLASH_SendByte((ReadAddr& 0xFF00) >> 8);
370: /* Send ReadAddr low nibble address byte */
0x080007FC F3C42007 UBFX r0,r4,#8,#8
0x08000800 F7FFFEB1 BL.W SPI_FLASH_SendByte (0x08000566)
371: SPI_FLASH_SendByte(ReadAddr & 0xFF);
372: }
373:
374: /*******************************************************************************
375: * Function Name : SPI_FLASH_ReadByte
376: * Description : Reads a byte from the SPI Flash.
377: * This function must be used only if the Start_Read_Sequence
378: * function has been previously called.
379: * Input : None
380: * Output : None
381: * Return : Byte Read from the SPI Flash.
382: *******************************************************************************/
383: u8 SPI_FLASH_ReadByte(void)
384: {
0x08000804 B2E0 UXTB r0,r4
0x08000806 E8BD4010 POP {r4,lr}
0x0800080A E6AC B SPI_FLASH_SendByte (0x08000566)
385: return (SPI_FLASH_SendByte(Dummy_Byte));
0x0800080C 20A5 MOVS r0,#0xA5
0x0800080E E6AA B SPI_FLASH_SendByte (0x08000566)
420: {
421: /* Loop while DR register in not emplty */
0x08000810 B570 PUSH {r4-r6,lr}
422: while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
423:
424: /* Send Half Word through the SP
声明:
本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:
https://www.wpsshop.cn/w/小蓝xlanll/article/detail/155885?site
推荐阅读
article
mybatis
环境搭建启动
Exception
in
thread “ma
in
” FATAL ERRO...
刚刚开始接触框架,尽管跟着视频学习,但也免不了有“手贱打错”和版本差异带来的小问题。下面我给大家分享一下我动手搭建myb...
赞
踩
article
Mybatis异常:
Exception
in
thread
&
quot
;
main
&
quot
; jav...
BUG消除者(2):Mybatis异常:
Exception
in
thread
"
main
"
java
.
lang
.Exc...
赞
踩
article
使用Mybatis-
plus
代码生成器出现错误:E
xception
in
thread
“
ma
in
...
bug详情:E
xception
in
thread
“
ma
in
”
java
.
lang
.NoClassDefFoundEr...
赞
踩
article
ChatGLM源码解析
main
.py
_
token
izer.
bos
_
token
_
id
...
这样做的好处是,训练过程结束之后,可以直接打开这个文件查看训练的结果,而不需要重新运行整个脚本。这部分代码首先给每个输入...
赞
踩
article
Vscode
搭建开发调试
STM32
/
RISC
-V环境
IDE
(最全面)_
vscode
stm32
...
单片机开发
IDE
环境如KeilMDK,虽然操作简单,容易上手,方便调试。但就是代码编辑和风格很老套,中文符号乱码还是常有...
赞
踩
article
Exception
in
thread “ma
in
“
javax
.
jms
.JMSSecurityEx...
acitvemq 设置密码错误_
javax
.
jms
.
jms
securityexception:
user
name
[n...
赞
踩
article
【错误记录】Android 应用执行报错 (
java
.
lang
.UnsatisfiedLinkEr...
java
.
lang
.UnsatisfiedLinkError: dalvik.
system
.PathClassLoade...
赞
踩
article
java
.
lang
.UnsatisfiedL
in
kError: 找不到指定的模块。_exceptio...
1、开发HFS下载功能时,遇到了
java
.
lang
.UnsatisfiedL
in
kError: 找不到指定的模块。的错误...
赞
踩
article
【已解决】Exception
in
thread “ma
in
“
java
.
lang
.Unsatisf...
执行
openc
v包下的方法时报找不到
openc
v_
java
文件问题如下: 1、首先检查电脑上是否下载
openc
v,搜索工...
赞
踩
article
ACL
会议介绍 -
Call
for
Main
Conference
Papers
_
acl2024
...
慢慢的将
ACL
写作套路都整理一遍,慢慢的将各种写作套路都展现一波。会自己学习完整都行啦的理由与打算。_
acl2024
ac...
赞
踩
article
STM32
CubeMX
中断
NVIC
实战 (超详细
配
30
张高清图,附源码)_stm32cubem...
STM32
F407的嵌套向量
中断
控制器(Nested Vectored Interrupt Controller,NVI...
赞
踩
article
STM32
TCP
实现OTA...
CRCH,CHRL组成固件全部数据的CRC16校验,下位机收到结束指令后,对整包数据进行CRC16校验,与该指令CRC校...
赞
踩
article
marlin
多轴
电机
驱动_
marlin
stm32
...
marlin
多个步进
电机
的驱动没有用定时器比较外设,是用普通的定时器
stm32
主要有两个参数调定时器运行频率1.Pr...
赞
踩
article
c/c++经典
面试题
_3、请写出
以下
代码
的打印
结果
#
i
nclude
<
std
i
o
.h>
vo
i
d
ma
i
...
来自:http://www.m
i
anwww.com/html/2012/04/16174.html
面试题
1:变量的声明和...
赞
踩
article
stm32
-
NVIC
中断
优先级
管理
(以古代
官职
角度分析)...
注意:整个系统执行过程中,只能设置一次,不要用着用着突然改了//串口 1
中断
// 抢占
优先级
为 1// 子
优先级
位 2...
赞
踩
article
linux系统
tuned
调优
策略示例_创建
自定义
的
tuned
profile
文件:vim
tuned
...
rhel6中引入了
tuned
调优
策略,rhel7中内容了10种
调优
方案。它提供了三种
调优
方法。方法1:使用静态
调优
方案t...
赞
踩
article
Kotlin
在
Android
端的基本用法详解_
kotlinx
.
android
.
synthetic
.m...
作者:谭东
Kotlin
相信现在大家都不陌生了,它是谷歌在5月18日,它的安卓团队在Google I/O 2017 大会上...
赞
踩
article
【
STM32
】
BLDC
驱动&控制开发笔记 | 08_无刷
直流电机
BLDC
参数
辨识
_极对数,相电阻,相...
本文记录无刷
直流电机
/永磁同步电机
参数
辨识
的一系列方法,极对数,相电阻,相
电感
,交轴直轴
电感
,
反电动势
常数
,磁链
常数
。_...
赞
踩
article
STM32
+
OpenMV
+
AS608
实现
人脸识别
_
stm2
人脸识别
能
连接
数据库吗?...
STM32
+openmv(M7)+As608指纹模块----人脸指纹识别–串口显示////前述:本实验基于上一个实验ST...
赞
踩
article
java流程控制_
public
static
void
main
(
string
[] args){in...
关键字if之后是作为条件的“布尔表达式”如果该表达式返回的结果为true,则执行其后的语句:如果为false,则不执行i...
赞
踩
相关标签
mybatis
java
spring
ExceptionInInitializerError
bug消除
IDEA
freemarker
人工智能
vscode
ide
编辑器
stm32
开发语言
android
android studio
自然语言处理
单片机
嵌入式硬件
学习