Skip to main content
April 20, 2021
Question

Functions: initOptionBytesInterface() return a rubbish, firmwareUpgrade() and startWirelessStack() returns not correct result.

  • April 20, 2021
  • 5 replies
  • 2579 views

Hi.

Using STM32Cubeprogrammer API v.2.7.0 with STM32WB55 and USB interface, I find an error when to call initOptionBytesInterface().

...

peripheral_C* options_bytes;

options_bytes = initOptionBytesInterface();

...

As we know, "peripheral_C" structure have a fields:

typedef struct peripheral_C

{

  char name[32];         /**< Peripheral name. */

  char description[200];     /**< Peripheral description. */

  unsigned int banksNbr;     /**< Number of existed banks. */

  bank_C** banks;         /**< Get banks descriptions #Bank_C. */

}peripheral_C;

And after call I see that the banksNbr = very big value.

Its a same for 32 or 64 platforms.

This is 32 platform:

0693W00000AM1ozQAD.pngAs you see, options_bytes address = 0x02fa6e90.

If we add to this address lenghts of fields name[32] and description[200]

our result will be 0x02fa6f78 as we can see that

banksNbr = 0xc7a2b7a3.

This is 64 platform:

0693W00000AM1qgQAD.pngand we can see the same, but more interesting is a fild " bank_C** banks;"

banksNbr = 0x7865742e.

What is a "text_6", "text_7" ... ?

So, x64 dont work ?

Why in different platforms we have a different data returned by function initOptionBytesInterface() and not correct data?

 I try to test project in API folder using USB_Example.cpp - it is a same problem.

Next trouble:

Using API in custom desktop application I find that call connectDfuBootloader() does not work correctly if :

- there is no "Data_Base" folder at the level above the application and in this folder need to present "STM32_Prog_DB_0x495.xml" file.

- if there is no "Flash Loader" folder nearby to the application and in this folder need to present 4 files with names beginning with "0x495", like:

0x495.stldr, 0x495_FUS_Operator.bin, 0x495_nonSecure.stldr, 0x495_secure.stldr

Next trouble: 

When call firmwareUpgrade() with stack and parametere "startStack" = 1 then

function return "1" (error) but stack loaded succesfully and fus dont run :

0693W00000AMuUuQAL.pngWhen call this function (firmwareUpgrade()) with stack and parameter "startStack" = 0 then

function return "1" (error) again but stack loaded succesfully and fus still run:

0693W00000AMuVJQA1.pngWhy firmwareUpgrade () always return 1 (false)?

Next trouble: 

Function startWirelessStack() always return "1" (false) but stack started.

This topic has been closed for replies.

5 replies

Houda GHABRI
ST Employee
May 7, 2021

Hi @Vyacheslav​ ,

Thanks for this interesting feedback.

I'm trying to reproduce the issue , it is under debug.

I will get back to you as soon as I have an update.

Houda

May 25, 2021

18 days of silence - is cool !

Next question: why "StartFus()" routine available only for ST-LINK intetrfaces but STM32CubeProgrammer can start FUS using USB ???

FValm.1
Associate III
February 28, 2022

[personal data removed]

10 months has gone and no answer? The API supplied (CubeProgrammer_API.dll) are very bugged but sadly they also would be very important to develop program under windows to manage the upgrade of firmware from an host PC...

Houda GHABRI
ST Employee
March 2, 2022

Hi @FValm.1​ ,

This issue is fixed in CubeProgrammer v2.9.0 version.

By the way the issue is in the example not the API which is used by STM32CubeProgrammer GUI.

Can you please confirm if you still face the same problem using 2.9.0 version?

Houda

FValm.1
Associate III
March 2, 2022

Hi @Houda GHABRI​ ,

I confirm I'm using CubeProgrammer v2.9.0 and I'm using the API supplied with the CubeProgrammer_API.dll and CubeProgrammer_API.lib. I have seen that the initOptionBytesInterface() is not working as expected. Some fields of the peripheral_C structure (returned by the initOptionBytesInterface()) are incorrect. As an example the field int banksNbr which is filled with very high number is clearly incorrect.