Seeed-Studio / Wio_Tracker_1110_Examples

arduino examples for Wio_tracker board
Other
2 stars 4 forks source link

Firmware updater not compiling #25

Open cobraPA opened 1 month ago

cobraPA commented 1 month ago

It seems the firmware updater does not compile in platformio, there is a missing function for the dfu_bootload setup:

static int usrcmd_enter_bootloader_mode(int argc, char **argv) { // not found wm1110Hw.enterBootloaderMode();

return 0;

}

cobraPA commented 1 month ago

Compiling .pio\build\release\src\main.cpp.o src\main.cpp: In function 'int usrcmd_enter_bootloader_mode(int, char**)': src\main.cpp:224:14: error: 'class Wm1110Hardware' has no member named 'enterBootloaderMode' wm1110Hw.enterBootloaderMode();

tve commented 6 days ago

I believe it needs to call lr11xx_bootloader_reboot in the lr111x driver, now how to get there from here...

Edit: the following seems to be working:

static int usrcmd_enter_bootloader_mode(int argc, char **argv)
{
    // wm1110Hw.enterBootloaderMode();
    if (lr11xx_system_reboot(wm1110Hw.radio.ral.context, true) != LR11XX_STATUS_OK)
    {
        Serial.printf("ERROR: Failed to enter bootloader." DLM);
        return -1;
    }

    return 0;
}

I believe the new firmware needs to come from here: https://github.com/Lora-net/radio_firmware_images/tree/master/lr1110/transceiver but I don't have time right now to try it out (so close...)

Update: looks like the update process succeeded:

> info
Chip is in firmware mode.
Chip:
 Hardware version = 0x22
 Type             = 0x01
 Firmware version = 0x0307
> bootloader
> info
Chip is in bootloader mode.
Chip:
 Hardware version   = 0x22
 Type               = 0xDF
 Bootloader version = 0x6500
> update
Start flash erase...
Flash erase done!
Start flashing firmware...
Flashing done!
Rebooting...
Reboot done!
> info
Chip is in firmware mode.
Chip:
 Hardware version = 0x22
 Type             = 0x01
 Firmware version = 0x0401
> 
wzy-github123 commented 5 days ago

commit b939635 fixed it.