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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31193
    Ajay K
    Participant

    I 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 failed

    Here 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,
    Ajay

    #31194
    Ajay K
    Participant

    Any thoughts, this issue is blocking us from testing 4.0 mdot library.

    Thanks,
    Ajay

    #31195
    Taylor Heck
    Blocked

    With 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.bin

    Strip bootloader and append CRC:
    > multitool device plain -b 0x10000 -c -o outut.bin fw.bin

    #31197
    Ajay K
    Participant

    Thanks 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.bin

    The 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.bin

    Thanks,
    Ajay

    #31198
    Taylor Heck
    Blocked

    Yes, 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.

    #31200
    Ajay K
    Participant

    Thanks a lot Taylor for your help, the issue is resolved now.

    Thanks,
    Ajay

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.