Skip to main content
feixiao
Associate II
September 24, 2025
Solved

can I flash 90kb .text hex into a 128kb dual bank stm32G474 dirrectly?

  • September 24, 2025
  • 2 replies
  • 307 views

hi

my Hex file have a  90kB .text session size,

and I want to flash it into stm32G474cbtx mcu which have 128kb dual bank flash.

 

I use stm32cubeProgrammer v2.19.0 and stm32CubeIDE v1.19.0.

 

if the option byte DBANK is 1,  I can successfully flash it using stm32cubeProgrammer, but fail  to flash it using

stm32CubeIDE when I start debug session. The error mesage is "operation exceeds memory limits".

 

if the option byte is 0, then both tools can flash successfully.

 

I know when DANK is 1,  stm32g474cbtx 's two bank address is not continuous, so I think in this case, both tools should fail to flash,

but why stm32cubeProgrammer can succussfully flash it (and the program runs normmally) ? 

 

Best answer by TDK

The contiguous memory probably exists but isn't tested. And one tool does the check that the other doesn't.

Log files would show more.

2 replies

Ozone
Principal
September 24, 2025

> my Hex file have a  90kB .text session size,
> and I want to flash it into stm32G474cbtx mcu which have 128kb dual bank flash.

That doesn't say enough about your problem.

Intel Hex is a relatively simple text format,which specifies the target address at each line.
Note down the start and end addresses of your Flash banks, and check if your hex file is out of those limits somewhere.


And ...

> my Hex file have a  90kB .text session size, ...

Where did it come from ?
If a toolchain with a properly setup project created it, there should be no such problem.
I seems likely that your hex file is not intended for the target you want to use it for.

TDK
TDKBest answer
Super User
September 24, 2025

The contiguous memory probably exists but isn't tested. And one tool does the check that the other doesn't.

Log files would show more.

"If you feel a post has answered your question, please click ""Accept as Solution""."
feixiao
feixiaoAuthor
Associate II
September 29, 2025

Yes, you are right.

if I use the latest stm32CubeProgrammer v2.20, then it will report "memory exceeds limit" error when I try to flash. So the latest tool have been made to check it.