Skip to main content
Associate III
February 18, 2026
Question

H743: Handler variable appear both in RAM and Flash? Why

  • February 18, 2026
  • 1 reply
  • 162 views

Hello.. i am writing a FD-CAN handler "fdcan1". I dun understand why it appears both in the micro's RAM and Flash? Can anyone advise? see screenshot for the memory detail.

 

 

1 reply

TDK
Super User
February 18, 2026

The initial value for non-zero global variables is stored in flash. When the program starts, they are copied to RAM. This is the expected behavior. They need to have space reserved for them in FLASH in order to store the initial value.

During program execution, the variable lives in RAM. It's location in FLASH is only accessed during program initialization.

In contrast, global variables which are zero-initialized do not take up any room in FLASH and only "live" in RAM.

"If you feel a post has answered your question, please click ""Accept as Solution""."