Debugger runs app twice before halting

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

Debugger runs app twice before halting

2,950 Views
andrewsglenn
Contributor III

I'm using an LPCXpresso54S018 board and debugging a FreeRTOS application.

I've not modified any debug settings, just pressing the Debug link in the Quickstart panel.

I see on my UART the application runs twice before halting. I assume at least one of these times is the code originally in Flash before we reprogram.

I'm a bit worried that running the application multiple times could set external peripherals in undesired states during boot.

Is there a way to set up the debugger such that it does not run the contents of the flash before it's been reprogrammed with the new build?

0 Kudos
Reply
15 Replies

2,530 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @andrewsglenn 

Please provide us more information thus we can check it in detail:

1. you use EVK board or custom PCB?

2. The problem may be related with part revision. Do you use rev 1B or 0A? please send us a photo of the part silkscreen.

3. Are there any pullup on ISP0-ISP2?

Thanks,

Jun Zhang

 

0 Kudos
Reply

2,915 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

You can set Disable use of preconnect script in the debug configuration as follows:

Alex_Wang_0-1715335772448.png

Alex_Wang_1-1715335862030.jpeg

Hope this helps you.

Best regards, Alex

 

0 Kudos
Reply

2,904 Views
andrewsglenn
Contributor III

Hi Alex,

Thank you.

I still see my welcome message appear twice before the program halts at the beginning of main().

I think this means the program already in Flash memory is being executed twice before the new program is programmed into Flash, yes?

Glenn

0 Kudos
Reply

2,883 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

Could you please share the debug configuration information so that I can check it for you? If it is convenient, you can share it with me. Please refer to the attachment for my demo on MCXN947.

Note: The original program in the board is hello word

Hope this helps you.

Best regards, Alex

0 Kudos
Reply

2,825 Views
andrewsglenn
Contributor III

Hi Alex,

Here is my debug configuration.

I think I set it the same as yours, but I still get two reboots before the debugger halts.

My Flash driver reset handling was set to SOFT instead of Default, but changing it made no difference, neither did specifying a Reset handling option or setting disconnect behavior to No Change

I also tested with the freertos_hello demo and get the same response.

I also tested with the hello_world demo that does not use FreeRTOS. Same result.

Glenn

0 Kudos
Reply

2,789 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

This issue is fixed at MCUXpresso IDE 11.10.0.

Best regards, Alex

0 Kudos
Reply

2,728 Views
andrewsglenn
Contributor III
Hi Alex,
I can't find 11.10.0 on the web page. The latest available is 11.9.1.
0 Kudos
Reply

2,709 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

Sorry, now, MCUXpresso IDE 11.10.0 is not publish. You can refer to my latest reply, I have tested it and it is OK.

Alex_Wang_0-1715822807915.png

Hope this helps you. If you have any questions, please contact me and I will try my best to help you.

Best regards, Alex

 

0 Kudos
Reply

2,701 Views
andrewsglenn
Contributor III

Unfortunately, setting that option seems to make this problem worse:

https://community.nxp.com/t5/MCUXpresso-IDE/Cannot-Debug-LPCXpresso54S018-Debug-port-inaccessible-af...

 

0 Kudos
Reply

2,695 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

Attached is the test I conducted using LPC54018, and no problem has occurred. What problem did you have in canceling "Pull ISP on reset"?

Best regards, Alex

0 Kudos
Reply

2,672 Views
andrewsglenn
Contributor III

I'm continually having problems with memory read errors on the board, which I mentioned in the other post.

Since I changed the "Pull ISP on Reset" the errors have become almost constant.

Is there a difference between the LPC54018 and the LPC54S018?

0 Kudos
Reply

2,563 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

LPC54018 and LPC54S018 are not very different in nature, LPC54S018 has more security zones. Can you tell me which version of the development board you are using?

LPC54S018 Rev version? If it is convenient, please take a clear photo of the text on the chip, I need to know the chip version.

Is it OK when you check "Pull ISP on Reset"?

Attached is the test I conducted on LPC54s018.

Best regards, Alex

0 Kudos
Reply

2,760 Views
andrewsglenn
Contributor III

Thank you. I'll update my IDE.

Regards

Glenn

0 Kudos
Reply

2,750 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

The current version also has a workaround:

Plese note that the preconnect scripts are available for some (newer) devices. LPC54S018M does not have a preconnect script.

For older LPC devices, including LPC54S018M, the IDE has a global LinkServer configuration - "Pull ISP on reset" - which is enabled by default.

When set, the IDE sends `WireISPReset 1" commands to the probe. This command triggers intermediary reset.

An option would be to disable this configuration:

Alex_Wang_3-1715741171630.png

 

 

Alex_Wang_2-1715741059365.png

Best regards, Alex

 

 

 

 

0 Kudos
Reply

2,802 Views
Alex_Wang
NXP Employee
NXP Employee

Hi, @andrewsglenn 

According to the problem you mentioned, I have conducted experiments with LPC54S018. Indeed, setting the debugging configuration Disable use of preconnect script does not work, and the program will be reset and run before downloading. I have reported this problem to MCUXpresso IDE, and I will inform you as soon as there is any new information.

Best regards, Alex

0 Kudos
Reply