2025-05-12 5:03 AM - edited 2025-05-12 5:34 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. 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 :)