J-link (SWD) can flash the firmware but debug is not always working

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

J-link (SWD) can flash the firmware but debug is not always working

1,241 Views
Ronaa
Contributor II

We have a custom board with LPC54608 and SRAM.

We work with MCUXpresso 11.7 or 11.8 and SDK 2.13 or 2.14

We are able to flash the firmware using J-flash without any problem but we encounter problems trying to debug.

sometimes it is working and most of the time it is not. the IDE is stuck on some line which is not the start point and we cant do any action except stop debug.

We know about the conflicts between SDRAM pins and ISP pins so we put 10K pullups in the 3 pins and burned the OTP.

we have no idea what do do next.

i also want to verify that this OTP code is correct:

 

    CLOCK_EnableClock(kCLOCK_Otp);
    RESET_PeripheralReset(kOTP_RST_SHIFT_RSTn);
    otpversion = OTP_GetDriverVersion();
    OTP_EnableBankWriteMask(kOTP_Bank3);
    OTP_EnableBankWriteLock(kOTP_Bank2, kOTP_Word0, kOTP_Word1 | kOTP_Word2 | kOTP_Word3,  kOTP_LockDontLock);
    OTP_ProgramRegister(kOTP_Bank2, kOTP_Word0, 0x20);
    OTP_DisableBankWriteMask(kOTP_Bank3);

 

 

thanks 

0 Kudos
Reply
3 Replies

1,050 Views
Ronaa
Contributor II

We thought the  issue is related to the SDRAM and ISP pins.

We have the same processor in another board without external memory and it work just fine.

But, even after disabling the ISP via OTP it keeps failing. most of the time power toggle solves the issue, but again, not always.

0 Kudos
Reply

1,176 Views
frank_m
Senior Contributor III

> We are able to flash the firmware using J-flash without any problem but we encounter problems trying to debug.

> sometimes it is working and most of the time it is not. the IDE is stuck on some line which is not the start point and we cant do any action except stop debug.

The default setting of almost all debuggers is to run to main(), and stop there.
As a first thing, disable this setting and start debugging at the reset vector.

It seems you have identified the SDRAM pins/settings as potential cause.
But issues with the power supply or clock generation could be possible as well.

 

0 Kudos
Reply

1,193 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Ronaa 

"sometimes it is working and most of the time it is not."

->> When it is working and not?

How about debug a simple led or hello world proejct?

 

BR

Alice

0 Kudos
Reply