S32K148 cant change FSEC byte

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K148 cant change FSEC byte

1,497 次查看
Moh-Moh
Contributor II

Hi all,

So I'm having a very strange issue - I'm trying to change the FSEC in flash, and keep getting the same result (0xFE).

 

Some background on my setup I'm:

Using Eclipse with the IAR compiler. 

Using a Segger Jlink.

Modifying the byte in the startup_S32K148.S file. 

 

Things I've tried already:

1) Simply changing the FSEC byte (and backdoor comparison key) in startup_S32K148.S:

MohMoh_6-1669726065693.png

My FSEC byte is 0xBB (0b10111011)

MohMoh_0-1669727658038.png

 

2) I found a post stating that if I'm using the IAR compiler I need to use the "--enable_config_write" argument in my .board settings (https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-IAR-Linker-file-for-initalizing-FSEC-Flash...). I've done this. Please find a snippet of FlashS32K148.board below 

MohMoh_5-1669725400205.png

 

This gets used by S32K148.i79 via the flash loader in Eclipse. Please find below

MohMoh_4-1669725063352.png

 

3) I also read that I need to use the (allow security) variant of my board when debugging with SEGGER (https://wiki.segger.com/S32Kxxx). Again I've done this. :

MohMoh_1-1669724452115.png

After modifying these settings I'm still getting 0xFE returned from FTFC->FSEC

MohMoh_7-1669726169840.png

MohMoh_9-1669726257095.png

0xFE is the default value for this register. Any guidance on what am I missing would be very much appreciated.

 

Moh 

 

 

0 项奖励
回复
2 回复数

1,126 次查看
Moh-Moh
Contributor II

Hi Daniel, 

Thanks for your reply. So the issue was that the linker file had been modified and so the __FlashConfig bytes were being written into a different part of memory. 

Apologies for the delay in reply, and thanks for the help 

I cant go into too much detail on here but suffice to say I am unable to write these bytes into 0x400.

 

The reason for attempting to modify these bytes was to stopI hope this is not beyond the scope of the question but I have two opt

0 项奖励
回复

1,483 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Moh,

Do you have any other debugger?

Or have you tried loading the binary using j-link commander, for example?

If you then see the same result, the issue would be in the IAR and not with the debugger.

In that case I would recommend contacting IAR Systems support.

Have you followed all the steps in the workbench, including the Overwrite default .board option?

The FSEC register is loaded from the FSEC byte at 0x400 after a reset only, I would rather check the memory itself.

 

Regards,

Daniel

0 项奖励
回复