2025-05-12 5:03 AM - edited 2025-05-13 12:57 AM
Hello everyone,
I am currently writing a GUI application with QT. The STM32CubeProgrammer API is integrated in the project. So far I was able to flash FW, use functions like massErase and execute without any problems (All these over UART). Now my MCU needs the nBOOT0 option bytes to boot correctly.
I have tried several times with the STMCubeProgrammer API function "sendOptionBytesCmd" but it does not work. I always get a "-6" as return value. Does anyone have an idea how to solve this ?
This is what my code looks like.
qDebug() << "Setting Option Byte nBOOT0 to 1";
int sendOptionBytesCmdFlag = sendOptionBytesCmd((char*)"-ob nBOOT0=1");
if (sendOptionBytesCmdFlag ! = 0) {
disconnect();
qDebug() << "Could not set Option Byte nBOOT0 to 1";
}
qDebug() << "Option Byte nBOOT0 set to 1 successfully! " << sendOptionBytesCmdFlag;
Thanks in advance :)
2025-05-16 7:05 AM
Hello @csmk59,
I have added your code into the UART example on QT API project with an STM32G474 and it works well on my end. Could you provide more information about your setup? exact part number of your STM32G4? CubePorgrammer version and any additional details (logs, UART configuration...).
Thanks,
Amine.