Hi I've recently acquired a OM40002 devkit with the LPC8N04 MCU.
The unit I received runs a demo application with leds scrolling on a panel. If I reset the board the leds come back on and scroll as intended.
The problem comes when I follow the steps in the walkthrough guide to build this same example application. When I build the project in Debug mode I can flash the chip, see the debugger halt, hit resume, and immediately see the scroll pattern but if I reset the board the scroll pattern does not resume. If I build the board in release mode I don't get a debug hook. It's like the board does not boot up at all unless I reflash it and even then it's only the first time AND when in debug mode.
My intuition is saying this code is running in debug mode even when it's in release mode. How can I fix this in MCUXpresso?
Hi Paul,
Normally debug and release mode use different compiler setting. for example,
- debug use optimization level with O0 while release mode is Os.
- debug mode uses normal debug level while release mode use maximum debug level.
You can modify the setting manually in project setting
You can modify them and try again.
If you still have problem, please upload your demo project. and let me know how to reproduce your problem with demo board. I will test it.
Have a great day,
Jun Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jun,
The demo project is the one I am downloading off the NXP website here: LPC8N04 Development Board for LPC8N04 Microcontroller (MCU)|NXP
I've made a screencast here: app demo 03 - YouTube - you can see it compiles normally in debug mode at 1:43 and fails to compile in release mode at 2:15.
-Paul
HI Paul,
Please build the two libs with release mode beforehand, then build app_demo in release, there is no error. I have verified it from my side. Let me know how it works for you.
Have a great day,
Jun Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jun,
Setting the two additional libraries gets the project compiling in release mode but does not resolve the original issue.
I've uploaded a new video here: app demo 04 pnp - YouTube - specifically you can see the app compiles at 0:34, the board programs at 1:01, the demo runs at 1:08, and then fails to run when the board is reset at 1:17.
The demo that ships pre-programmed with the devkit runs immediately on power on every time. The version on the NXP website fails to run on power on - it only runs after initial programming and never again thereafter.
How do I fix this so the demo will run on power up every time? It is impractical for me to program these units at the factory and deliver them to customers without ever powering them down ;-D
I would suggest you refer this article which includes how to use the board with demo.
LPC8N04: NFC Hands-on Lab Guide
Have a great day,
Jun Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jun,
I have commented on that page last week (see: https://community.nxp.com/docs/DOC-342088#comment-61345 ) - specifically that Lab Guide does not address this issue - after "Step 1 - section 12" but before "Step 2 - section 1" there is information missing which does not describe how to get code to load up on reboot.
Please advise. As of today, there is no code posted on the LPC8N04 page (LPC8N04 8 MHz |Arm® Cortex®-M0+|32-bit Microcontrollers (MCUs)|NXP ) that loads on reboot.
-Paul
Could this be causing your problem?
https://community.nxp.com/thread/493801
Solution is to make sure the image is checksumed
Hi Paul,
I use OM40002, LPC804N, rev B. I follow the document. no problem working without debugger.
There is no other steps after "Step 1 - section 12" and before "Step 2 - section 1. just provide power to the board, or reset. I can see led rotating.
Have a great day,
Jun Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jun,
Can you try again with "OM40002, LPC804N, rev C." - I suspect there was a breaking change with the new boards or the new firmware (such as the checksum functionality mentioned by converse in this thread) which causes these examples to fail compared to the older rev B boards which may have been current when the examples were first published. I cannot source a rev B board to confirm but I do have 8 rev C boards which show identical, non-working behavior.
Tentatively it sounds like the example code works with the old rev B boards running 0.12 bootloader firmware but not the newer rev C boards that ship today with the 0.14 bootloader firmware.
Hi Paul Gerhardt,
I got a Rev C board, I reproduced this issue. I believe Rev B board use 0.12 bootloader version and Rev C board use 0x14 boodloader version.
Con Verse's suggestion is right. to get pass the BOOT ROOM checksum, checksum value at address 0x1C need to be filled at vector table. There are at least two methods to get the checksum value:
Method 1. Use Keil tool elfdwt.exe generate checksum value
You need install Keil IDE fist. the tool is under: C:\Keil_v5\ARM\BIN
input command: >elfdwt.exe app_demo.axf
here, "app_demo.axf" is the mcuxpresso demo code generated executable file
After executing this command, checksum will be displayed as 0xEFFF5F75.
Method 2. calculate checksum value by hand
- launch debugger, add first 7 vector values together, then reverse:
0x10001FF0+0x00001C5+0x00003F6B+0x00003F6B+0+0+0=0x1000A08B
0-1000A08B = 0xEFFF5F75
Next, fill the checksum value at address 0x1C in vector table:
build and launch debugger, This revision should fix the problem.
Have a great day,
Jun Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------