2023-11-02 06:18 AM
Hi,
I probably didn't search correctly in the documentation, but i didn't find a command to reboot the device using the USB Bootloader interface . I found a reset method but its with STLINK and its not what i'm using.
Is there any method available ?
thank you for all the help you can provide
Sofiane
Solved! Go to Solution.
2023-11-07 06:43 AM
Hello @Sofiane,
The function call corresponding to the "-rst" command is "reset(SOFTWARE_RESET)". However, as you said, this function is only available for the JTAG/SWD debug interface and cannot be used with the bootloader interfaces.
As a result, resetting the device through the USB bootloader interface is not possible with STM32CubeProgrammer APIs.
Maryem.
2023-11-03 04:13 AM
Hello @Sofiane,
"I found a reset method but its with STLINK and its not what i'm using."
referring to the STM32CubeProgrammer User manual Figure 112. STM32CubeProgrammer: available commands
You can add the option -rst in the command which is not specific to JTAG/SWD debug port as show in the screenshot bellow .
please let me know if this solved your issue .
BR Hichem
2023-11-03 06:07 AM
Hello @STea ,
thank you for your answer.
unfortunatly, i'm not using the command line tool provided by STM . i'm using the CubeProgrammer_API.dll in one of my C++ project. and when i try to call reset(SOFTWARE_RESET) or reset(HARDWARE_RESET) , i get and exception : Access violation reading location 0x00000000000000F0.
So i'm guessing that the command cannot be called from my program as i'm doing it.
what would be the corresponding C++ call for this --rst option command when you are using the USB interface to deal with a device ?
Again thank you for your help
2023-11-07 06:43 AM
Hello @Sofiane,
The function call corresponding to the "-rst" command is "reset(SOFTWARE_RESET)". However, as you said, this function is only available for the JTAG/SWD debug interface and cannot be used with the bootloader interfaces.
As a result, resetting the device through the USB bootloader interface is not possible with STM32CubeProgrammer APIs.
Maryem.
2023-11-07 06:46 AM
2023-11-07 09:11 AM
If you can push in code into RAM, and jump to it, you could use NVIC_SystemReset() or equivalent. Or watchdog