S32K144: FlexRAM as Emulated EEPROM Initial Values?

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

S32K144: FlexRAM as Emulated EEPROM Initial Values?

ソリューションへジャンプ
3,223件の閲覧回数
mahmoudsherrah
Contributor III

I succeeded in configuring FlexRAM as emulated EEPROM and it is working as expected. I only wanted to know how to set initial values in this EEPROM.

I tried to do the following (struct initialization):

typedef struct

{
      uint8_t u8;

      uin16_t u16;
} eeerom_data_t;

__attribute__ ((section(".eeeprom"))) eeerom_data_t eeerom_data = {.u8 = 12, .u16 = 3456};

But unfortunately didn't work, I think because the FlexRAM area is set to 1's on flashing the software to S32K144.

Is there any way to achieve initial values of FlexRAM as emulated EEPROM? Thanks

ラベル(1)
1 解決策
2,420件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
The system should not access the data in FlexRAM until the flash controller completes the initialization indicated by the FCNFG[EEERDY] flag.
If you need to have the EEPROM initialized, copy the data from Flash once the EEPROM is ready.

Regards,
Daniel

元の投稿で解決策を見る

4 返答(返信)
2,421件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
The system should not access the data in FlexRAM until the flash controller completes the initialization indicated by the FCNFG[EEERDY] flag.
If you need to have the EEPROM initialized, copy the data from Flash once the EEPROM is ready.

Regards,
Daniel

2,420件の閲覧回数
mahmoudsherrah
Contributor III

Unfortunately, this wastes program memory but I assume it's not that big of an issue. I also think this is the only way to do it. Thanks anyway.

0 件の賞賛
返信
2,420件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

In AN12130, there is:

pastedImage_1.png

If your programmer/debugger supports scripting, you can use a script to check the EEERDY flag and to write the data.
But this is not a question on the MCU but rather on the programmer.

Regards,
Daniel

0 件の賞賛
返信
2,420件の閲覧回数
mahmoudsherrah
Contributor III

Thanks for the link. It's interesting but as you said it is programmer work not SW. I think copying from flash to FlexRAM after EEERDY does the trick.

0 件の賞賛
返信