串口发送没有问题,因为不涉及中断。 原来RO:0x20000000,RW:空着,下载到ram调试的。 现在RO:0x0,RW:0x20000000,下载到flash调试就OK了。 也就是在ram启动模式下载,无法进入中断,估计是remap方面的问题,有待进一步研究。 没改动前: 225 ;******************************************************************************* 226 ;* Function Name : IRQHandler 227 ;* Description : This function called when IRQ exception is entered. 228 ;* Input : none 229 ;* Output : none 230 ;******************************************************************************* 231 232 IRQHandler 233 SUB lr,lr,#4 ; Update the link register IRQHandler [0xe24ee004] sub r14,r14,#4 234 SaveContext r0,r12 ; Save the workspace plus the current 200000fc [0xe92d5fff] stmfd r13!,{r0-r12,r14} 20000100 [0xe14f1000] mrs r1,spsr 20000104 [0xe92d0002] stmfd r13!,{r1} 235 ; return address lr_ irq and spsr_irq. 236 LDR lr, =ReturnAddress ; Read the return address. 20000108 [0xe59fe310] ldr r14,0x20000420 ; = #0x20000118 237 LDR r0, =EIC_base_addr 2000010c [0xe59f0310] ldr r0,0x20000424 ; = #0xfffff800 238 LDR r1, =IVR_off_addr 20000110 [0xe3a01018] mov r1,#0x18 239 ADD pc,r0,r1 ; Branch to the IRQ handler. 20000114 [0xe080f001] add pc,r0,r1 240 ReturnAddress 241 ; Clear pending bit in EIC (using the proper IPRx) 242 LDR r0, =EIC_base_addr ReturnAddress [0xe59f0304] ldr r0,0x20000424 ; = #0xfffff800 243 LDR r2, [r0, #CICR_off_addr] ; Get the IRQ channel number. 2000011c [0xe5902004] ldr r2,[r0,#4] 244 MOV r3,#1 20000120 [0xe3a03001] mov r3,#1 245 MOV r3,r3,LSL r2 20000124 [0xe1a03213] mov r3,r3,lsl r2 246 STR r3,[r0, #IPR_off_addr] ; Clear the corresponding IPR bit. 20000128 [0xe5803040] str r3,[r0,#0x40] 247 RestoreContext r0,r12 ; Restore the context and return to the... 2000012c [0xe8bd0002] ldmfd r13!,{r1} 20000130 [0xe16ff001] msr spsr_cxsf,r1 20000134 [0xe8fd9fff] ldmfd r13!,{r0-r12,pc}^ 248 ; ...program execution. 249
|