LPC845 strange debug behavior with IAR & J-Link

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC845 strange debug behavior with IAR & J-Link

770 Views
zixunli
Contributor I

Hi,

I met some strange behavior when debugging the LPCXpresso845MAX board with J-Link (v6.32i) and IAR 8.22, on board debugger is disabled by JP1.

I'm using the blinky demo, here is what I did :

1.Without the debugger the program run correctly, when debug session is launched, PC went to 0xfffffffc when SysTick exception is raised. In IPSR register exception number is 3 which is hardfault, but hardfault handler is not entered(hardfault handler address is in intvec and SCB->VTOR is 0).

2.I enabled vector catch, when SysTick exception is raised PC went to 0x00000000 .

3.Just for curious, I wanted to try what would happen if intvec is copied to ram:

3a. In linker file a intvec area is reserved:

define symbol r_interrupts_start = 0x10000000;
define symbol r_interrupts_end = 0x100000BF;

define symbol m_data_start = 0x100000C0;
define symbol m_data_end = 0x10003FFF - __size_cstack__;

define region RAM_INTVEC_region       = mem:[from r_interrupts_start to r_interrupts_end];

3b. SystemInit is modified:

void SystemInit (void)
{
    register uint32_t* src = (uint32_t*)0x00000000;
    register uint32_t* dst = (uint32_t*)0x10000000;
    for(uint32_t i = 0; i < 0x30; i++)
    {
        *dst++ = *src++;
    }
    SCB->VTOR = 0x10000000;
    SystemCoreClock = DEFAULT_SYSTEM_CLOCK;
    SystemInitHook();
}

3c. To my suprise, the copied value is the bottom of bootROM ! But the intvec in 0x00000000 is correct :

ram_table.PNG

vec.PNG

4.It seems like something went wrong when the debugger is attached, according to the manual boot block is also visible at 0x00000000, maybe the mcu believed the last 512 byte of bootROM is intvec and hardfault happened when an exception is raised, since it can't find the handler address hardfault is raised and PC went to 0x00000000 ?

mem.PNG

Labels (1)
0 Kudos
1 Reply

569 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Zixun LI,

I ran the blinky demo from the SDK 2.4.2 using IAR Embedded Workbench IDE 8.20.2 and I had no issue debugging the demo. I'm also using J-link for ARM debugger (V6.32b).

However, I recommend you to boot into ISP mode to try to recover debug access. Please refer to the following thread.

Regaining debug access to target MCU

Best regards,

Felipe.

0 Kudos