cancel
Showing results for 
Search instead for 
Did you mean: 

sendOptionBytesCmd() function doest not work for my STM32G431CBY3TR

csmk59
Associate

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 :)

1 REPLY 1
Amine_Jridi
ST Employee

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.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.