420 lines
13 KiB
Plaintext
420 lines
13 KiB
Plaintext
; generated by Component: ARM Compiler 5.06 update 4 (build 422) Tool: ArmCC [4d3604]
|
|
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\obj\retarget.o --asm_dir=.\lst\ --list_dir=.\lst\ --depend=.\obj\retarget.d --cpu=Cortex-M0 --apcs=interwork -O3 --diag_suppress=9931 -I..\..\..\Library\CMSIS\Include -I..\..\..\Library\Device\Nuvoton\Mini58Series\Include -I..\..\..\Library\StdDriver\inc -I..\..\Template -I..\..\..\Library\StdDriver\driver -I.\RTE\_Template -ID:\Keil_v5\ARM\PACK\Nuvoton\NuMicro_DFP\1.0.9\Device\Mini58\Include -ID:\Keil_v5\ARM\CMSIS\Include -D__MICROLIB -D__UVISION_VERSION=523 --omf_browse=.\obj\retarget.crf ..\..\..\Library\StdDriver\src\retarget.c]
|
|
THUMB
|
|
|
|
AREA ||i.GetChar||, CODE, READONLY, ALIGN=2
|
|
|
|
GetChar PROC
|
|
;;;371
|
|
;;;372 char GetChar(void)
|
|
000000 4803 LDR r0,|L1.16|
|
|
|L1.2|
|
|
;;;373 {
|
|
;;;374 #if defined(DEBUG_ENABLE_SEMIHOST)
|
|
;;;375 # if defined ( __CC_ARM )
|
|
;;;376 int nRet;
|
|
;;;377 while(SH_DoCommand(0x101, 0, &nRet) != 0)
|
|
;;;378 {
|
|
;;;379 if(nRet != 0)
|
|
;;;380 {
|
|
;;;381 SH_DoCommand(0x07, 0, &nRet);
|
|
;;;382 return (char)nRet;
|
|
;;;383 }
|
|
;;;384 }
|
|
;;;385 # else
|
|
;;;386 int nRet;
|
|
;;;387 while(SH_DoCommand(0x7, 0, &nRet) != 0)
|
|
;;;388 {
|
|
;;;389 if(nRet != 0)
|
|
;;;390 return (char)nRet;
|
|
;;;391 }
|
|
;;;392 # endif
|
|
;;;393 #endif
|
|
;;;394 #ifndef DISABLE_UART
|
|
;;;395 while (1){
|
|
;;;396 if(!(DEBUG_PORT->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk))
|
|
000002 6981 LDR r1,[r0,#0x18]
|
|
000004 0449 LSLS r1,r1,#17
|
|
000006 d4fc BMI |L1.2|
|
|
;;;397 {
|
|
;;;398 return (DEBUG_PORT->DAT);
|
|
000008 6800 LDR r0,[r0,#0]
|
|
00000a b2c0 UXTB r0,r0
|
|
;;;399
|
|
;;;400 }
|
|
;;;401 }
|
|
;;;402 #else
|
|
;;;403 return(0);
|
|
;;;404 #endif
|
|
;;;405 }
|
|
00000c 4770 BX lr
|
|
;;;406
|
|
ENDP
|
|
|
|
00000e 0000 DCW 0x0000
|
|
|L1.16|
|
|
DCD 0x40050000
|
|
|
|
AREA ||i.Hard_Fault_Handler||, CODE, READONLY, ALIGN=2
|
|
|
|
Hard_Fault_Handler PROC
|
|
||__tagsym$$used||
|
|
;;;60
|
|
;;;61 void Hard_Fault_Handler(uint32_t stack[])
|
|
000000 4604 MOV r4,r0
|
|
;;;62 {
|
|
;;;63 printf("In Hard Fault Handler\n");
|
|
000002 a003 ADR r0,|L2.16|
|
|
000004 f7fffffe BL __2printf
|
|
;;;64
|
|
;;;65 stackDump(stack);
|
|
000008 4620 MOV r0,r4
|
|
00000a f7fffffe BL stackDump
|
|
|L2.14|
|
|
;;;66
|
|
;;;67 //Chip Reset
|
|
;;;68 //SYS_UnlockReg();
|
|
;;;69 //SYS->IPRSTC1 |= SYS_IPRSTC1_CHIP_RST_Msk;
|
|
;;;70
|
|
;;;71 while(1);
|
|
00000e e7fe B |L2.14|
|
|
;;;72 }
|
|
;;;73
|
|
ENDP
|
|
|
|
|L2.16|
|
|
000010 496e2048 DCB "In Hard Fault Handler\n",0
|
|
000014 61726420
|
|
000018 4661756c
|
|
00001c 74204861
|
|
000020 6e646c65
|
|
000024 720a00
|
|
000027 00 DCB 0
|
|
|
|
AREA ||i.IsDebugFifoEmpty||, CODE, READONLY, ALIGN=2
|
|
|
|
IsDebugFifoEmpty PROC
|
|
;;;430 */
|
|
;;;431 int IsDebugFifoEmpty(void)
|
|
000000 4802 LDR r0,|L3.12|
|
|
;;;432 {
|
|
;;;433 #ifndef DISABLE_UART
|
|
;;;434 return (DEBUG_PORT->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk) ? 1 : 0;
|
|
000002 6980 LDR r0,[r0,#0x18]
|
|
000004 00c0 LSLS r0,r0,#3
|
|
000006 0fc0 LSRS r0,r0,#31
|
|
;;;435 #else
|
|
;;;436 return(1);
|
|
;;;437 #endif
|
|
;;;438
|
|
;;;439 }
|
|
000008 4770 BX lr
|
|
;;;440
|
|
ENDP
|
|
|
|
00000a 0000 DCW 0x0000
|
|
|L3.12|
|
|
DCD 0x40050000
|
|
|
|
AREA ||i.SendChar||, CODE, READONLY, ALIGN=1
|
|
|
|
SendChar PROC
|
|
;;;334
|
|
;;;335 void SendChar(int ch)
|
|
000000 b500 PUSH {lr}
|
|
;;;336 {
|
|
;;;337 #if defined(DEBUG_ENABLE_SEMIHOST)
|
|
;;;338 g_buf[g_buf_len++] = ch;
|
|
;;;339 g_buf[g_buf_len] = '\0';
|
|
;;;340 if(g_buf_len + 1 >= sizeof(g_buf) || ch == '\n' || ch == '\0')
|
|
;;;341 {
|
|
;;;342
|
|
;;;343 /* Send the char */
|
|
;;;344
|
|
;;;345 if(SH_DoCommand(0x04, (int)g_buf, NULL) != 0)
|
|
;;;346 {
|
|
;;;347 g_buf_len = 0;
|
|
;;;348 return;
|
|
;;;349 }
|
|
;;;350 else
|
|
;;;351 {
|
|
;;;352 int i;
|
|
;;;353
|
|
;;;354 for(i=0;i<g_buf_len;i++)
|
|
;;;355 SendChar_ToUART(g_buf[i]);
|
|
;;;356 g_buf_len = 0;
|
|
;;;357 }
|
|
;;;358 }
|
|
;;;359 #else
|
|
;;;360 SendChar_ToUART(ch);
|
|
000002 f7fffffe BL SendChar_ToUART
|
|
;;;361 #endif
|
|
;;;362 }
|
|
000006 bd00 POP {pc}
|
|
;;;363
|
|
ENDP
|
|
|
|
|
|
AREA ||i.SendChar_ToUART||, CODE, READONLY, ALIGN=2
|
|
|
|
SendChar_ToUART PROC
|
|
;;;315
|
|
;;;316 void SendChar_ToUART(int ch)
|
|
000000 4906 LDR r1,|L5.28|
|
|
|L5.2|
|
|
;;;317 {
|
|
;;;318 #ifndef DISABLE_UART
|
|
;;;319 while(DEBUG_PORT->FIFOSTS & UART_FIFOSTS_TXFULL_Msk);
|
|
000002 698a LDR r2,[r1,#0x18]
|
|
000004 0212 LSLS r2,r2,#8
|
|
000006 d4fc BMI |L5.2|
|
|
;;;320 DEBUG_PORT->DAT = ch;
|
|
000008 6008 STR r0,[r1,#0]
|
|
;;;321 if(ch == '\n'){
|
|
00000a 280a CMP r0,#0xa
|
|
00000c d104 BNE |L5.24|
|
|
|L5.14|
|
|
;;;322 while(DEBUG_PORT->FIFOSTS & UART_FIFOSTS_TXFULL_Msk);
|
|
00000e 6988 LDR r0,[r1,#0x18]
|
|
000010 0200 LSLS r0,r0,#8
|
|
000012 d4fc BMI |L5.14|
|
|
;;;323 DEBUG_PORT->DAT = '\r';
|
|
000014 200d MOVS r0,#0xd
|
|
000016 6008 STR r0,[r1,#0]
|
|
|L5.24|
|
|
;;;324 }
|
|
;;;325 #endif
|
|
;;;326 }
|
|
000018 4770 BX lr
|
|
;;;327
|
|
ENDP
|
|
|
|
00001a 0000 DCW 0x0000
|
|
|L5.28|
|
|
DCD 0x40050000
|
|
|
|
AREA ||i._ttywrch||, CODE, READONLY, ALIGN=1
|
|
|
|
_ttywrch PROC
|
|
;;;443 /*---------------------------------------------------------------------------------------------------------*/
|
|
;;;444 void _ttywrch(int ch)
|
|
000000 b500 PUSH {lr}
|
|
000002 f7fffffe BL SendChar_ToUART
|
|
;;;445 {
|
|
;;;446 SendChar(ch);
|
|
;;;447 return;
|
|
;;;448 }
|
|
000006 bd00 POP {pc}
|
|
;;;449
|
|
ENDP
|
|
|
|
|
|
AREA ||i.ferror||, CODE, READONLY, ALIGN=1
|
|
|
|
ferror PROC
|
|
;;;460
|
|
;;;461 int ferror(FILE *f) {
|
|
000000 2000 MOVS r0,#0
|
|
;;;462 return EOF;
|
|
000002 43c0 MVNS r0,r0
|
|
;;;463 }
|
|
000004 4770 BX lr
|
|
;;;464
|
|
ENDP
|
|
|
|
|
|
AREA ||i.fgetc||, CODE, READONLY, ALIGN=1
|
|
|
|
fgetc PROC
|
|
;;;455
|
|
;;;456 int fgetc(FILE *f) {
|
|
000000 b500 PUSH {lr}
|
|
;;;457 return (GetChar());
|
|
000002 f7fffffe BL GetChar
|
|
;;;458 }
|
|
000006 bd00 POP {pc}
|
|
;;;459
|
|
ENDP
|
|
|
|
|
|
AREA ||i.fputc||, CODE, READONLY, ALIGN=1
|
|
|
|
fputc PROC
|
|
;;;449
|
|
;;;450 int fputc(int ch, FILE *f)
|
|
000000 b500 PUSH {lr}
|
|
;;;451 {
|
|
000002 4603 MOV r3,r0
|
|
000004 f7fffffe BL SendChar_ToUART
|
|
;;;452 SendChar(ch);
|
|
;;;453 return ch;
|
|
000008 4618 MOV r0,r3
|
|
;;;454 }
|
|
00000a bd00 POP {pc}
|
|
;;;455
|
|
ENDP
|
|
|
|
|
|
AREA ||i.kbhit||, CODE, READONLY, ALIGN=2
|
|
|
|
kbhit PROC
|
|
;;;414 */
|
|
;;;415 int kbhit(void)
|
|
000000 4802 LDR r0,|L10.12|
|
|
;;;416 {
|
|
;;;417 #ifndef DISABLE_UART
|
|
;;;418 return !(DEBUG_PORT->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk);
|
|
000002 6980 LDR r0,[r0,#0x18]
|
|
000004 0440 LSLS r0,r0,#17
|
|
000006 17c0 ASRS r0,r0,#31
|
|
000008 1c40 ADDS r0,r0,#1
|
|
;;;419 #else
|
|
;;;420 return(0);
|
|
;;;421 #endif
|
|
;;;422 }
|
|
00000a 4770 BX lr
|
|
;;;423
|
|
ENDP
|
|
|
|
|L10.12|
|
|
DCD 0x40050000
|
|
|
|
AREA ||i.stackDump||, CODE, READONLY, ALIGN=2
|
|
|
|
REQUIRE _printf_percent
|
|
REQUIRE _printf_x
|
|
REQUIRE _printf_longlong_hex
|
|
stackDump PROC
|
|
;;;48
|
|
;;;49 void stackDump(uint32_t stack[])
|
|
000000 b510 PUSH {r4,lr}
|
|
;;;50 {
|
|
000002 4604 MOV r4,r0
|
|
;;;51 printf("r0 = 0x%x\n", stack[r0]);
|
|
000004 6801 LDR r1,[r0,#0]
|
|
000006 a010 ADR r0,|L11.72|
|
|
000008 f7fffffe BL __2printf
|
|
;;;52 printf("r1 = 0x%x\n", stack[r1]);
|
|
00000c a011 ADR r0,|L11.84|
|
|
00000e 6861 LDR r1,[r4,#4]
|
|
000010 f7fffffe BL __2printf
|
|
;;;53 printf("r2 = 0x%x\n", stack[r2]);
|
|
000014 a012 ADR r0,|L11.96|
|
|
000016 68a1 LDR r1,[r4,#8]
|
|
000018 f7fffffe BL __2printf
|
|
;;;54 printf("r3 = 0x%x\n", stack[r3]);
|
|
00001c a013 ADR r0,|L11.108|
|
|
00001e 68e1 LDR r1,[r4,#0xc]
|
|
000020 f7fffffe BL __2printf
|
|
;;;55 printf("r12 = 0x%x\n", stack[r12]);
|
|
000024 a014 ADR r0,|L11.120|
|
|
000026 6921 LDR r1,[r4,#0x10]
|
|
000028 f7fffffe BL __2printf
|
|
;;;56 printf("lr = 0x%x\n", stack[lr]);
|
|
00002c a015 ADR r0,|L11.132|
|
|
00002e 6961 LDR r1,[r4,#0x14]
|
|
000030 f7fffffe BL __2printf
|
|
;;;57 printf("pc = 0x%x\n", stack[pc]);
|
|
000034 a016 ADR r0,|L11.144|
|
|
000036 69a1 LDR r1,[r4,#0x18]
|
|
000038 f7fffffe BL __2printf
|
|
;;;58 printf("psr = 0x%x\n", stack[psr]);
|
|
00003c a017 ADR r0,|L11.156|
|
|
00003e 69e1 LDR r1,[r4,#0x1c]
|
|
000040 f7fffffe BL __2printf
|
|
;;;59 }
|
|
000044 bd10 POP {r4,pc}
|
|
;;;60
|
|
ENDP
|
|
|
|
000046 0000 DCW 0x0000
|
|
|L11.72|
|
|
000048 72302020 DCB "r0 = 0x%x\n",0
|
|
00004c 3d203078
|
|
000050 25780a00
|
|
|L11.84|
|
|
000054 72312020 DCB "r1 = 0x%x\n",0
|
|
000058 3d203078
|
|
00005c 25780a00
|
|
|L11.96|
|
|
000060 72322020 DCB "r2 = 0x%x\n",0
|
|
000064 3d203078
|
|
000068 25780a00
|
|
|L11.108|
|
|
00006c 72332020 DCB "r3 = 0x%x\n",0
|
|
000070 3d203078
|
|
000074 25780a00
|
|
|L11.120|
|
|
000078 72313220 DCB "r12 = 0x%x\n",0
|
|
00007c 3d203078
|
|
000080 25780a00
|
|
|L11.132|
|
|
000084 6c722020 DCB "lr = 0x%x\n",0
|
|
000088 3d203078
|
|
00008c 25780a00
|
|
|L11.144|
|
|
000090 70632020 DCB "pc = 0x%x\n",0
|
|
000094 3d203078
|
|
000098 25780a00
|
|
|L11.156|
|
|
00009c 70737220 DCB "psr = 0x%x\n",0
|
|
0000a0 3d203078
|
|
0000a4 25780a00
|
|
|
|
AREA ||.data||, DATA, ALIGN=2
|
|
|
|
__stdout
|
|
DCD 0x00000000
|
|
|
|
AREA ||area_number.15||, DATA, ALIGN=2
|
|
|
|
EXPORTAS ||area_number.15||, ||.data||
|
|
__stdin
|
|
DCD 0x00000000
|
|
|
|
;*** Start embedded assembler ***
|
|
|
|
#line 1 "..\\..\\..\\Library\\StdDriver\\src\\retarget.c"
|
|
AREA ||.rev16_text||, CODE
|
|
THUMB
|
|
EXPORT |__asm___10_retarget_c_8c64092a____REV16|
|
|
#line 388 "..\\..\\..\\Library\\CMSIS\\Include\\cmsis_armcc.h"
|
|
|__asm___10_retarget_c_8c64092a____REV16| PROC
|
|
#line 389
|
|
|
|
rev16 r0, r0
|
|
bx lr
|
|
ENDP
|
|
AREA ||.revsh_text||, CODE
|
|
THUMB
|
|
EXPORT |__asm___10_retarget_c_8c64092a____REVSH|
|
|
#line 402
|
|
|__asm___10_retarget_c_8c64092a____REVSH| PROC
|
|
#line 403
|
|
|
|
revsh r0, r0
|
|
bx lr
|
|
ENDP
|
|
AREA ||.emb_text||, CODE
|
|
THUMB
|
|
EXPORT |HardFault_Handler|
|
|
#line 289 "..\\..\\..\\Library\\StdDriver\\src\\retarget.c"
|
|
|HardFault_Handler| PROC
|
|
#line 290
|
|
|
|
MOVS r0, #4
|
|
MOV r1, LR
|
|
TST r0, r1
|
|
BEQ Stack_Use_MSP
|
|
MRS R0, PSP
|
|
B Get_LR_and_Branch
|
|
Stack_Use_MSP
|
|
MRS R0, MSP
|
|
Get_LR_and_Branch
|
|
MOV R1, LR
|
|
LDR R2,= |Hard_Fault_Handler|
|
|
BX R2
|
|
ENDP
|
|
|
|
;*** End embedded assembler ***
|