The goal is to use the example flashloader from the SDK to load custom images to update the firmware on the board.
I loaded the blinky_led example to the MCUXpresso IDE and generated a .srec file. I than generated a bootable image with the .srec file in the MCUXpresso secure provisioning tool and suuceeded. But if I want to write the image on the board it fails with following error message:
blhost -u 0x15A2,0x0073 -j -- configure-memory 9 0x2000
{
"command" : "configure-memory",
"response" : [],
"status" : {
"description" : "4 (0x4) kStatus_InvalidArgument",
"value" : 4
}
}
blhost failed
### RESULT of the script `Writing Image`: FAILURE (return code = ExitCode.ERROR)
INFO: Status of the operation: FAILED: Writing Image
___________________________________________________________
- also I failed to debug the 1060_flashloader example in the IDE (it stops in get_active_peripheral())
___________________________________________________________
Settings in MCUXpresso secure provisioning:
- SW7 is in serial downloader mode
- power supply over debug port
- active peripheral USB HID (connection to the board is ok)
Thank you in advance!
Hi Per Canal,
Do you check your code in the MCUXPresso IDE project, does you really have larger than 5MB, or just generated code is larger than 5MB, I just want to make sure, it is your wrong configuration caused this so large image or you really have this so large image?
What's the detail project you are using? Do you debug it, whether it works or not? Where you locate your app code? From 0x60002000 or any other address? When you generate the image, you can don't add the xip header.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------
Hi kerryzhou
Do you check your code in the MCUXPresso IDE project, does you really have larger than 5MB, or just generated code is larger than 5MB, I just want to make sure, it is your wrong configuration caused this so large image or you really have this so large image?
-- I checked the configurations and they should be okay. My application is that large I guess.
What's the detail project you are using? Do you debug it, whether it works or not? Where you locate your app code? From 0x60002000 or any other address? When you generate the image, you can don't add the xip header.
-- What do you mean by "detail project"? While debuging it, it works fine. XIP_Header is set to 0.
-- I tried now the MCUbootutility. The led_blinky example works fine again. But if I want to load my app to the board followed errormessage occurs:
Do you have any idea what I have to change?
Hi Per Canal,
Do you mind share your app.s19 with me, I will check it on myside at first.
Do you test it on the MIMXRT1060-EVK board or your own board?
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------
Hi per_canal,
Check your s19file, find the previous side contains a lot of internal RAM code, then the external memory code.
If you just have the external memory code image, even larger to 0X6005000, can you download it?
Normally, even the internal code, you still need to download to the external flash, then after boot, copy it to the internal related RAM.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------
Hi Per Canal ,
Do you try to use the flash loader and the MFGtool on your side directly?
Whether it works or not?
I have a question when you generate the app file, do you disable the XIP header? XIP_BOOT_HEADER_ENABLE=0
More details, please check the application note:
https://www.nxp.com/docs/en/application-note/AN12107.pdf
You mean, when using a secure provisioning tool, generate the code is correct, but when you want to write it, it fails, right?
You can also check my post:
RT1050 SDRAM app code boot from SDcard burn with 3 tools
Chapter 5, MCUXpresso Secure Provisioning configuration and download
This is also using the Secure provision tool,
You can check the steps, any difference?
If you still have question about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hello Kerry Zhou
Thank you for your reply and sorry for my late reply!
First I tried to compile the evkmimxrt1060_flashloader example in the debug mode. It seems like the program is in a endless loop in "get_active_peripheral".
After that I tried to work with the secure provisioning tool to generate my bootable image and to write it in a first step to my imrxt1060 board.
The connection to my board is ok. SW7 is set to 0001 and I set the XIP_BOOT_HEADER_ENABLE=0. To generate a bootable image is successfull. But write image generates the mentioned error above.
Thank you in advance!
Here you find the whole "code" which the secure provisioning tool returns:
INFO: Build image - operation started at 2020-08-18 08:00:49
INFO: Build script generated: build_image_lnx.sh
INFO: Build script generated: build_image_win.bat
INFO: Build script generated: build_image_mac.sh
### SCRIPT: Building image: X:\Desktop\build_image_win.bat
elftosb -f imx -V -c X:\Desktop\bd_files\imx_application_gen_win.bd -o X:\Desktop\bootable_images\led_demo_evk_flexspi_nor_0x60002000.bin "c:\users\per canal\downloads\flashloader-rt106x-1-ga\flashloader_rt106x_1.0_ga\example_images\led_demo_evk_flexspi_nor_0x60002000.srec"
Section: 0x0
iMX bootable image generated successfully
elftosb succeeded
### RESULT of the script `Building image`: SUCCESS (return code = ExitCode.SUCCESS_HAB_DISABLED)
INFO: Status of the operation: SUCCESS: Building image
INFO: Write image - operation started at 2020-08-18 08:00:54
INFO: Write script generated: write_image_lnx.sh
INFO: Write script generated: write_image_win.bat
INFO: Write script generated: write_image_mac.sh
### SCRIPT: Writing Image: X:\Desktop\write_image_win.bat
### Check presence of flashloader ###
blhost -u 0x15A2,0x0073 -j -- get-property 1 0
blhost failed
Flashloader is not running yet, download and run it
### Check communication with target bootloader ###
sdphost -u 0x1FC9,0x0135 -j -- error-status
{
"command" : "error-status",
"response" : [ 4042322160 ],
"status" : {
"description" : "1450735702 (0x56787856) HAB disabled.",
"value" : 1450735702
}
}
sdphost succeeded, HAB disabled
### Write flashloader ###
sdphost -u 0x1FC9,0x0135 -j -- write-file 0x20000000 C:\nxp\MCUX_Provi_v1\bin\data\targets\MIMXRT1060\ivt_flashloader.bin
{
"command" : "write-file",
"response" : [ 2290649224 ],
"status" : {
"description" : "1450735702 (0x56787856) HAB disabled.",
"value" : 1450735702
}
}
sdphost succeeded, HAB disabled
### Run flashloader ###
sdphost -u 0x1FC9,0x0135 -j -- jump-address 0x20000400
{
"command" : "jump-address",
"response" : [],
"status" : {
"description" : "1450735702 (0x56787856) HAB disabled.",
"value" : 1450735702
}
}
sdphost succeeded, HAB disabled
### Check presence of flashloader ###
blhost -u 0x15A2,0x0073 -j -- get-property 1 0
{
"command" : "get-property",
"response" : [ 1258422528 ],
"status" : {
"description" : "0 (0x0) Success.",
"value" : 0
}
}
blhost succeeded
### Configure flex-spi-nor using options on address 0x2000 ###
blhost -u 0x15A2,0x0073 -j -- fill-memory 0x2000 4 0xC0033007 word
{
"command" : "fill-memory",
"response" : [],
"status" : {
"description" : "0 (0x0) Success.",
"value" : 0
}
}
blhost succeeded
blhost -u 0x15A2,0x0073 -j -- fill-memory 0x2004 4 0x00000000 word
{
"command" : "fill-memory",
"response" : [],
"status" : {
"description" : "0 (0x0) Success.",
"value" : 0
}
}
blhost succeeded
blhost -u 0x15A2,0x0073 -j -- configure-memory 9 0x2000
{
"command" : "configure-memory",
"response" : [],
"status" : {
"description" : "4 (0x4) kStatus_InvalidArgument",
"value" : 4
}
}
blhost failed
### RESULT of the script `Writing Image`: FAILURE (return code = ExitCode.ERROR)
INFO: Status of the operation: FAILED: Writing Image
Hi Per Canal ,
Thanks for your updated information.
Now, please use the MCUBootUtility tool to test your board on your side.
https://github.com/JayHeng/NXP-MCUBootUtility/archive/v2.3.0.zip
the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility
You can use the tool attached firmware:
NXP-MCUBootUtility-2.3.0\apps\NXP_MIMXRT1060-EVK_Rev.A1\led_blinky_0x6000a000.srec
Please try to download the code, then exit the serial download mode and enter the internal boot mode.
Whether you led is blinking or not?
All this situation is tested on my side, it works OK.
After you use this tool can work, it means your hardware has no issues, then we can check your firmware and your secure provisioning tool operation steps.
Please try it on your side, this tool is very simple to download the code.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi kerryzhou
The led_blinky example worked after i changed the boot device from flex-spi-nor/IS26 to flex-spi-nor/IS25WP.
I have now a different question/problem:
I want to use the MCUXpresso tool to update the firmware on field. So I loaded my .axf file (source executable image) to the tool. The processor, boot-type etc. settings are the same as before. It seems that I have now a problem with the file size.
Start address is red with followed error message: "Image size 1071922320 if greater than target bootable memory size 67108864".
Start address is detected at 0x20200000.
In the explorer the application (source executable image) has a size of 5 MB. How is it possible that its so mutch bigger while trying to load it in the MCUxpresso tool?
Thank you for your help!
Best regards,
Per
Hi Per Canal,
MIMXRT1060_EVK is using the QSPI flash in default, not the hyper flash. So you have selected the hyper flash in the previous time?
Now, you meet the image size issues is caused y your own firmware, which has the larger size?
I think it's better to share some picture about your issues, it will be more easy to understand your questions.
When you meet the error message, which tool you are using now? Do you try the MCUbooUtility tool, the same situation?
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi kerryzhou
1) I use the Secure Provisioning Tool.
2) No I used the QuadSPI SDR NOR for the example and now also for the application.
3) The source image is bigger according to the tool, but in the IDE in debug mode it works fine
4) I didn't try it yet with the MCUbootUtility, because i thought it would be easier with the secure provisioning tool
Hi Per Canal,
Today, I do the MIMXRT1060-EVK board , SDK2.8.0 iled_blinky, and the MCUXPresso Secure Previsioning testing, it works OK on my side.
1. Generate the .s19 file in MCUXPresso IDE
Build and generate the .s19 files
2. Use the MCUxpresso Secure Provisioning
MIMXRT1060-EVK board, you need to enter the serial download mode: SW7 1-OFF, 2-OFF, 3-OFF, 4-ON
Select the .19 in the source executable image
And click the build image button.
Press the write Image button:
Now, change the boot mode to internal boot: SW7 1-OFF, 2-OFF, 3-ON, 4-OFF
Press the reset button, the led is blinking now.
You can follow my steps and try it on your side.
I also attach app.s19 file for your reference.
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------
Hi Per Canal
Seems you already updated the information, which I can see from the internal system:
Hello Thank you again for your reply. The led_blinky example works just fine. But if i try to load my firmware to the board the error message I explained above occurs. Do you have any idea what the size problem could be or how to solve it
But it still didn't display in this post.
Do you try to use my attached .s19, and test directly instead of your own generated app file?
Then do totally the same step as me, still have issues?
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------
Hi kerryzhou
Yes your .s19 and my .s19 example file (imported from SDK examples) work both. But if I try to load my self-writen firmware to the board (with exactly the same steps as yours) the above showed error messages occure.
Find here again my settings and the error messages:
Hi Per Canal,
From your picture, seems it caused by the image size is greater than the target bootable memory size.
Do you try to minimize your own app, smaller than 67108864, whether it works or not?
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------
Hi kerryzhou
It confuses me that the source executable image is while loading it in to the secure provisioning tool bigger than before. Do you have an answer for that? It is litteraly the question I asked you before...
----->
Hi Kerry Zhou
The led_blinky example worked after i changed the boot device from flex-spi-nor/IS26 to flex-spi-nor/IS25WP.
I have now a different question/problem:
I want to use the MCUXpresso tool to update the firmware on field. So I loaded my .axf file (source executable image) to the tool. The processor, boot-type etc. settings are the same as before. It seems that I have now a problem with the file size.
Start address is red with followed error message: "Image size 1071922320 if greater than target bootable memory size 67108864".
Start address is detected at 0x20200000.
In the explorer the application (source executable image) has a size of 5 MB. How is it possible that its so mutch bigger while trying to load it in the MCUxpresso tool?
Thank you for your help!
Best regards,
Per <-----
Also do you know where I can change the vector table or the start address?
Thank you in advance.
Hello
Thank you again for your reply.
The led_blinky example works just fine. But if i try to load my firmware to the board the error message I explained above occurs. Do you have any idea what the size problem could be or how to solve it?
Best regards,
Per Canal