Menu

#154 Ignoring unsupported commands

none
New
nobody
None
Low
Enhancement
2023-04-25
2023-04-02
uzver123
No

Trying to program GD32E230 MCU.

stm32flash fails with error: "Got NACK from device on command 0x01".
stm32loader detects and programs successfully.

Looking at the list of available commands, 01 command not supported:
"0x0, 0x2, 0x11, 0x21, 0x31, 0x43, 0x63, 0x73, 0x82, 0x92, 0x6"

Is it possible to ignore unsupported commands and proceed further ?

Discussion

  • Tormod Volden

    Tormod Volden - 2023-04-09

    Do you have a reference to documentation on this bootloader? Is this via UART or I2C?

    stm32flash has always read the version and read protection status (STM32_CMD_GVR = 0x01) before getting the list of supported commands (STM32_CMD_GET), but it could be possible for instance to let it continue if the first command fails and the second command confirms that the first is not supported. But then someone must submit a patch or provide more information and testing on this device.

     
  • uzver123

    uzver123 - 2023-04-09

    This is UART, can't find any info in datasheet/user manual/appnotes, seems like there's no official open documentation for protocol.

    Tried to skip STM32_CMD_GVR check in stm32.c, lines 433-434, but it fails further with messages: "Failed to read ACK byte", "GET returns unknown commands (0x 6)", "Error: bootloader did not returned correct information from GET command"

    Maybe its better to query first for available commands, and skip those not supported ?

     

    Last edit: uzver123 2023-04-09
  • Tormod Volden

    Tormod Volden - 2023-04-24

    If you want to try skipping the STM32_CMD_GVR check you will need to skip the lines down to 457 (before the "get the bootloader information" comment) because those lines deal with the answer to that request.

    Yes, it sounds more logical to first query for available commands, but the existing order came about because of issues reading the available commands (see commit a0cf1bad).

     
    • uzver123

      uzver123 - 2023-04-25

      works after commenting lines 432-455 and 528

       

Anonymous
Anonymous

Add attachments
Cancel