cancel
Showing results for 
Search instead for 
Did you mean: 

Place constant at end of used flash - not specific address

LCE
Principal II

Heyho,

how can I put a constant at the end of the STM32's used flash? (using: STM32CubeIDE)

Not at a specific address (that's not a problem), but I'd like to have a constant always at the end of the used internal flash, independent of any other source code changes.

I just find that there's some ASCII characters = "ASCII" (twice) and lots of 0x00 at the end of my H7 and F7 bin files - that from my sources or placed by CubeIDE?

 

Thanks!

29 REPLIES 29
LCE
Principal II

One linker for APP and bootloader? 

No.

But boot/app need to know about the other's flash sections.

Works like a charm.


@LCE wrote:

One linker for APP and bootloader? 

No.

But boot/app need to know about the other's flash sections.

Works like a charm.

 

No need at all. thats not true.  

In there

/* application firmware info */

will be good place to store  application flash end info.  

 

Seemd you are to much complicate this.

LCE
Principal II

There is a reason to place it at the end of flash: to make sure that the bootloading process finished completely.

We have to cope with problems like a *** user who suddenly pulls out the connector, or presses the reset button, or there's a power off, ...

Radosław
Senior III

OK, veryfication that aplication is complite, OK.  But still i suggest to store this addres in  firmware info section to find it quicker,

 

Check my suggestion about removing your section by linker. 

Use KEEP for this section.

LCE
Principal II

> But still i suggest to store this addres in  firmware info section to find it quicker,

No, that does not make sense, because I want to keep that part at the start of flash / file, and EOF info should be .... well, at the end.

Radosław
Senior III

You misanderstood,

And the and you  puts for ex "DEADBEEF"  mark to detect  that all APP was programmed.

in firmware info section you addotionnaly stores adres  whare this mark will is located. 

Simple easy,

But back to problem?  Did you set KEEP for this ENDOFFLASH section?

LCE
Principal II

Okay, and yes I put KEEP back in, lost that when playing with it.

But how doe you make sure that "DEADBEEF"  or whatever mark is stored at the and of used flash ?

Radosław
Senior III

As you try to do.. or  directly  in linker script, 

Your problem is interesting becose it should work.  I done many thinks (also similar) in my projects without any problems. 

At this point data that should be placed in that section exist in hex file? are at end of flash? 

PS.  this data also should be const.  (this section is placed in (rx) memory region type.

LCE
Principal II

It actually works since yesterday when I put it at the and of the sections in the linker file.

Problem seems to be only the *.elf file - or so I thought.

But it mostly seems to be that STM32CubeProgrammer thinks it's bad and gives warnings.
BUT it still programs correctly, which I thought until now was not the case.

Now I just have to make a note for the production guys to ignore these warnings, otherwise problem solved.

Thanks again!

Radosław
Senior III

simple use hex file for that ;) no problem at  all. 

 

show log from cubeprog after opening you elf.file.