How to create section in code flash with fixed memory address

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to create section in code flash with fixed memory address

1,856件の閲覧回数
Anilpatil_SasvaAuto
Contributor IV

Hello Team,

I am trying to create a section in the known fixed code flash address and would like to store 3 bytes in that address or section. 

Could you please assist me in creating the section in the .ld file and adding the necessary memory to it? 

I have already attempted the following, but I'm still unable to store the data in that section. I would appreciate your urgent assistance with this issue. Thank you!

 

MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
RAM (rwx) : ORIGIN = 0x40000000, LENGTH = 0x00040000
MY_SECTION (rwx) : ORIGIN = 0x40040000, LENGTH = 0x00010000
}

SECTIONS
{
.text : { *(.text) } > FLASH
.data : { *(.data) } > RAM
.bss : { *(.bss) } > RAM
.my_section :
{
. = ALIGN(4);
*(.my_section)
. = ALIGN(4);
} > MY_SECTION
}

const uint8_t __attribute__ ((section (".my_section"))) Ecu_Cu8_SwVersionNum[3] = {0x19U, 0x08U, 0x08U}; /* Year=25, Week=08, Patch Level=8 */

タグ(1)
0 件の賞賛
返信
7 返答(返信)

1,851件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Possibly it could be a problem that you have define it as constant not as variable. I think constants are placed to section .text (i.e. to flash).

Does it work if you use volatile uint8_t?

0 件の賞賛
返信

1,833件の閲覧回数
Anilpatil_SasvaAuto
Contributor IV
Its urgent please help me
0 件の賞賛
返信

1,833件の閲覧回数
Anilpatil_SasvaAuto
Contributor IV
Please give me an example of storing 4 bytes of data at a fixed location by creating a new user section.
0 件の賞賛
返信

1,824件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

I thin it is correct, but section needs to be placed to flash, not ram.

0 件の賞賛
返信

1,821件の閲覧回数
Anilpatil_SasvaAuto
Contributor IV
please send working example code
0 件の賞賛
返信

1,821件の閲覧回数
Anilpatil_SasvaAuto
Contributor IV
The section has been created, but I cannot see the data in the .hex file.
0 件の賞賛
返信

1,817件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Here you may find a procedure:

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/HOWTO-Place-custom-data-into-flash-mem...

Try to use keyword KEEP as described.

0 件の賞賛
返信