LPC55S69 Flash Erase from crt_emu_cm_redlink does not work

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

LPC55S69 Flash Erase from crt_emu_cm_redlink does not work

Jump to solution
2,097 Views
simon_ott
Contributor I

Hi,

Erasing the flash of my LPC55S69-EVK via the GUI flash tool works fine. However, I need this to be done on the command line. When I click "Preview Command" in the GUI flash tool and then use this command on the command line, however, it does not work reliably.

Sometimes it works, sometimes it does not:

Nc: Sending VECTRESET to run flash driver
Nc: AFTER driver startup timeout (302 5ms retries)
[...]
Nc: Flash Driver V.2 startup failed - rc Ef(34): Timed-out initializing flash.
Ec: vendor chip initialization failed - Ef(34): Timed-out initializing flash.
Wc: failed to initialize flash driver LPC55xx_S.cfx

So my question is, what does the GUI Tool differently that it works there. I made the observation that the GUI seems to do a reset, as the controller puts out some USART debug output before the actual command is even executed.

Additional info: I use the newest IDE (11.3.1), SDK (2.9.1) and the Probe Firmware is LPC-LINK2 CMSIS-DAP V5.224 and boards of revision A2. It is a secure world (trustzone) project, the CPU goes into the secure hardfault as soon as crt_emu_cm_redlink issues the VECTRESET. Furthermore, the scripts were working fine with old revision A1 boards.

0 Kudos
1 Solution
1,966 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi simon_ott

I got feedback from development team.

This issue will be fixed in next release IDE 11.4.0

Thanks for bringing the problem to our attention.

Have a nice day,

Jun Zhang

View solution in original post

0 Kudos
12 Replies
2,050 Views
simon_ott
Contributor I

@ZhangJennieis there any update on this, or something else I could try to solve the problem?

or is there a possibility to find out the commands the IDE issues to the debugger before invoking the GUI flash tool? At least it seems to do some kind of reset of the controller, but as its a GUI, I cannot see the commands it actually issues.

0 Kudos
2,034 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Can I reproduce the issue on windows platform? If Linux is must, I don't have Linux to reproduce your issue.  Please send me more information thus I can ask my colleague to test it.

1. if the problem only happens on linux. what's your linux version?

2. can we reproduce your issue with default MCUXPresso SDK demo code? if yes, which one?

3. To avoid misunderstanding, Please send us the screenshot of your steps. 

 

Have a nice day

Jun Zhang

 

0 Kudos
2,027 Views
simon_ott
Contributor I

1. I think the problem would happen on windows, too. But I don't have windows to test it. I am using Ubuntu 20.04

2. Yes, you can replicate the behaviour just with the SDK examples using the following steps:

- Import the "secure_faults" SDK example project
- For demonstration, simply add an endlessloop: for(;;); in line 248 main.c before the PRINTF("Entering normal world"); so the project stays in the secure world. NOTE: This step might not even be necessary
- Build the project
- Flash the secure and non-secure project via the GUI Flash tool from the IDE
- Open the GUI Flash tool again, select "Erase" tab
- Select "Preview command" and copy it
- Paste this command into a script
- continue with the erase. It will work
- Flash the secure and non-secure project again via the GUI flash tool
- Run the script on the command line

This should fail. However, erasing with the GUI flash tool is still possible.

Also, if you repeat exactly the same steps with a non-trustzone project, e.g. the gpio_led_output example, the script will work. So it is a problem related to trustzone.

3. I attached some screenshots

0 Kudos
1,967 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi simon_ott

I got feedback from development team.

This issue will be fixed in next release IDE 11.4.0

Thanks for bringing the problem to our attention.

Have a nice day,

Jun Zhang

0 Kudos
1,886 Views
danielholala
Senior Contributor II

This issue will be fixed in next release IDE 11.4.0

I'm glad to hear that. 

I'm not using any security features and I have this issue, too, with LPC5526 and LPC-Link2 (Probe Firmware: CMSIS-DAP V5.361) and IDE 11.3.1 on Windows 10 and flash actions as simple as a flash-erase.

Execution of crt_emu_cm_redlink commands (copied from the command preview window) on the shell will fail until I've used the GUI Flash tool at least once. It will work until the MCU is resetted.

 

0 Kudos
1,951 Views
simon_ott
Contributor I

Thank you! Are there already plans, when the new version will be released?

0 Kudos
1,941 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

The release of MCUXpresso IDE 11.4.0 could be very fast. It should be next week. 

2,014 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Simon,

I reproduced the problem with your steps with MCUXpresso IDE on windows 10. 

I have reported it to IDE team. Will keep you informed.

 

Have a nice day,

Jun Zhang

0 Kudos
2,087 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Simon

Is this issue only in secure world (trustzone) project or a common issue for all project? how does it work if you test it with a led blink demo?

If the problem is only in secure world (trustzone) project, does it happen in IDE (11.3.1)+ SDK (2.9.1) + A1 board ? No problem if IDE (11.3.1)+ SDK (2.9.1) + A2 board?

Can you please send me a screenshot of your test command and problem screenshot?

Thanks

Jun Zhang

 

0 Kudos
2,074 Views
simon_ott
Contributor I

Hi,

The issue only happens when secure world projects are flashed on Revision A2 boards. The command is from the GUI flash tool and works fine when triggered by the GUI tool but often not when triggered from commandline:

MCUX_FLASH_DIR0=/usr/local/mcuxpressoide/ide/binaries/Flash
MCUX_FLASH_DIR1=$WORKSPACE_LOC/.mcuxpressoide_packages_support/LPC55S69_support/Flash
MCUX_IDE_BIN=/usr/local/mcuxpressoide/ide/binaries
MCUX_TOOL_LOC=/usr/local/mcuxpressoide/ide/tools/bin

$MCUX_IDE_BIN/crt_emu_cm_redlink --flash-erase --vendor NXP -p LPC55S69 --bootromstall 0x50000040 -ProbeHandle=1 -CoreIndex=0 \
--flash-driver= -x chip_files/erase \
--flash-dir $MCUX_FLASH_DIR0 \
--flash-dir $MCUX_FLASH_DIR1 \
--flash-hashing

A1 boards are not relevant to me anymore, I just want to get the new boards (A2) to work together with the newest IDE and SDK.

0 Kudos
2,045 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

If you want to program bin file to target without IDE, I suggest you use FlashMagic. This is our recommended Flash programming tool.

https://www.flashmagictool.com/

Please test if FlashMagic can resolve your issue. 

Here is an article, fyi

https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/Flash-Magic-Programing-LPC/ta-p/1152763

 

Have a nice day,

Jun Zhang

0 Kudos
2,041 Views
simon_ott
Contributor I

Unfortunately, I cannot use this.

The free version is a GUI tool for windows. I need to do this via command line in a linux environment.

I think this must be possible with the crt_emu_cm_redlink utility: I never had problems with revision A1, and additionally, it works when triggered via the IDE. The question is just: What does the IDE (the GUI Flash tool) do different compared to invoking the tool standalone?

0 Kudos