cancel
Showing results for 
Search instead for 
Did you mean: 

API from STM32CubeProgrammer 2.14.0

FValm.1
Associate III

Hello,
I have seen that in the new version of STM32CubeProgrammer (v 2.14.0) there's a new API that can be used to program a flash using DFU bootloader (API which I didn't see in my previous STM32CubeProgrammer).In addition to the writeMemory() now we have the editSector() function. But the description (reported in the .chm file) is quite the same. 
Anyone knows what's the difference between these two functions? 
Thanks all

FValm1_0-1696406898788.png
FValm1_1-1696406931297.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

Hello @FValm.1 ,

I confirm the issue from my end and I have submitted an internal ticket to fix it. 

Internal ticket number: 163902(This is an internal tracking number and is not accessible or usable by customers).

I'll keep you posted.

Sara.

View solution in original post

4 REPLIES 4
FValm.1
Associate III

Well, indeed It seems not implemented! Even if it is documented in the .chm file there is no prototype in the CubeProgrammer_API.h but you can see some evidence of that in CubeProgrammer_API.dll and in CubeProgrammer_API.lib... perhaps it will be available in following release?

Sara BEN HADJ YAHYA
ST Employee

Hello @FValm.1 ,

Thanks for your feedback,

The editSector() function performs the same job of the writeMemory() function while also ensuring that the size of the data being written does not surpass the sector size to avoid any potential exceptions.

This function is supported since v2.13.0.

Sara.

FValm.1
Associate III

Sorry, it was my fault... I have seen my CubeProgrammer_API.h was not updated in my project.
So now I have tested the function substituting the following commented line with the equivalent with editSector():

//retval = writeMemory(puntflash->sectors[numsect].address, &FlashMirrorBuffer[offset], size);
retval = editSector(puntflash->sectors[numsect].address, &FlashMirrorBuffer[offset], size);

puntflash->sectors[numsect].address               is 0x08000000
&FlashMirrorBuffer[offset]                                is the address of my buffer 
size                                                                   is exactly the sector dimension (0x1000 for my STM32G474RE                                                                                   configured in single bank)

the funtion returns with error -8. But if I change the size to 4095 it returns with no error. So it seems this function is not checking right the maximum size (or address boundary of the sector?). So actually I cannot write a whole sector as I would like to do... 

Sara BEN HADJ YAHYA
ST Employee

Hello @FValm.1 ,

I confirm the issue from my end and I have submitted an internal ticket to fix it. 

Internal ticket number: 163902(This is an internal tracking number and is not accessible or usable by customers).

I'll keep you posted.

Sara.