Flashing firmware compiled using MBED Online/Offline compiler causes CRC Errors.
Home › Forums › mDot/xDot › Flashing firmware compiled using MBED Online/Offline compiler causes CRC Errors.
Tagged: CRC error, MBED Online/Offline Compiler
- This topic has 5 replies, 2 voices, and was last updated 4 years, 6 months ago by
Ajay K.
-
AuthorPosts
-
October 2, 2020 at 5:30 pm #31193
Ajay K
ParticipantI am building my application using the MBED online/offline compiler and again the same error has cropped up that was occurring earlier when mbed 6 was released. I am getting CRC errors as shown below, when flashing the MDot module using tera term and ymodem interface. I am using the mDot library 4.0.1 to compile my custom firmware and also mbed-os-6.1.0. I am getting the CRC error no matter which compiler I use.
Below is the CRC Error I get in both cases.
upgrade ymodem
[INFO] Starting upgrade
[INFO] Starting YMODEM file transfer
[INFO] YMODEM file transfer succeeded
[INFO] appended crc: 0
[INFO] calculated crc: 614595670
[ERROR] File validation failedHere is my mbed_app.json contents to merge the bootloader.
{ "macros": [ "FOTA" ], "target_overrides": { "*": { "target.printf_lib": "std" }, "MTS_MDOT_F411RE": { "target.console-uart-flow-control": null, "platform.stdio-baud-rate": 115200, "platform.default-serial-baud-rate": 115200, "target.app_offset": "0x10000", "target.bootloader_img": "bootloaders/mdot-bootloader.bin" } } }
Thanks,
AjayOctober 5, 2020 at 12:55 pm #31194Ajay K
ParticipantAny thoughts, this issue is blocking us from testing 4.0 mdot library.
Thanks,
AjayOctober 5, 2020 at 1:13 pm #31195Taylor Heck
BlockedWith mbed-os 5 a post-build script combined bootloader and application into one image as well as appending a CRC. With mbed-os 6 this is no longer the case.
We have a Pyhton tool that can be used to append the CRC https://pypi.org/project/mtsmultitool
Also note that older MDot bootloader versions expected the firmware image to also have a bootloader included. The newer bootloader assumes the upgrade image does not include a bootloader.
The mbed-cli will output a *_application.bin image which should be used for YMODEM upgrades. The multitool program can be used to strip a bootloader from the image if needed.
Appending CRC:
> multitool device crc -o output.bin fw_application.binStrip bootloader and append CRC:
> multitool device plain -b 0x10000 -c -o outut.bin fw.binOctober 5, 2020 at 1:27 pm #31197Ajay K
ParticipantThanks Taylor for taking the time to respond to this issue. I just need to ensure I understand your comments clearly for the offline build scenario.
The bootloader I have called out in the mbed_app.json gets packed with the final version of the bin file, however you are saying that I should use the fw_application.bin that is generated during the offline build instead, append the CRC using the python tool multitool and using the command below:
Appending CRC:
> multitool device crc -o output.bin fw_application.binThe second scenario is that for the online compiler scenario? Where you are suggesting we strip the bootloader off the resulting *.bin file that is created and then append the CRC using the tool?
Strip bootloader and append CRC:
> multitool device plain -b 0×10000 -c -o outut.bin fw.binThanks,
AjayOctober 5, 2020 at 2:04 pm #31198Taylor Heck
BlockedYes, that’s correct.
Offline you’ll get both a combined image and an application only image.
Images from the online compiler will have the bootloader combined and it will need to be stripped when upgrading over YMODEM.
October 5, 2020 at 4:27 pm #31200Ajay K
ParticipantThanks a lot Taylor for your help, the issue is resolved now.
Thanks,
Ajay -
AuthorPosts
- You must be logged in to reply to this topic.