*(volatile unsigned long *)(STATUS_BASE) = hardfault_args[0];// R0
*(volatile unsigned long *)(STATUS_BASE + 0x04) = hardfault_args[1];// R1
*(volatile unsigned long *)(STATUS_BASE + 0x08) = hardfault_args[2];// R2
*(volatile unsigned long *)(STATUS_BASE + 0x0C) = hardfault_args[3];// R3
*(volatile unsigned long *)(STATUS_BASE + 0x10) = hardfault_args[4];// R12
*(volatile unsigned long *)(STATUS_BASE + 0x14) = hardfault_args[5]; // LR
*(volatile unsigned long *)(STATUS_BASE + 0x18) = hardfault_args[6]; // PC
*(volatile unsigned long *)(STATUS_BASE + 0x1C) = hardfault_args[7]; // PSR
*(volatile unsigned long *)(STATUS_BASE + 0x20) = (unsigned long)hardfault_args; // Stack Pointer
*(volatile unsigned long *)(STATUS_BASE + 0x24) = (*((volatile unsigned long *)(0xE000ED28))); // CFSR
*(volatile unsigned long *)(STATUS_BASE + 0x28) = (*((volatile unsigned long *)(0xE000ED2C))); // HFSR
*(volatile unsigned long *)(STATUS_BASE + 0x2C) = (*((volatile unsigned long *)(0xE000ED30))); // DFSR
*(volatile unsigned long *)(STATUS_BASE + 0x30) = (*((volatile unsigned long *)(0xE000ED3C))); // AFSR
*(volatile unsigned long *)(STATUS_BASE + 0x34) = (*((volatile unsigned long *)(0xE000ED34))); // MMAR
*(volatile unsigned long *)(STATUS_BASE + 0x38) = (*((volatile unsigned long *)(0xE000ED38))); // BFAR
if ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP)
__asm("BKPT #0\n"); //调试下载死在这里
else
{
while(1);
}
又试了下SDK5.04的其他工程:app_sleepmode。 编译调试下载没出现这个问题,一切正常。 这个问题是咋回事?