S32K146 Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K146 Flash

2,151 Views
shiqi_seventeen
Contributor III

Hello team,

     I am currently developing with Flash memory using the FS32K146. According to the manual, the Pflash is divided into two blocks. When the Flash erase function exists in block 0, it can erase block 1 but not block 0. I am considering placing the erase function in SRAM to run. My questions are:

1.Is it possible to place the function in RAM to run? If so, how can I do it? Can you provide me with a sample code or example?Or teach me how to run the function in RAM, I have no experience about this.
2.If I place the Flash erase function in RAM, will I then be able to erase block 0?

Thank you for your help.

0 Kudos
Reply
5 Replies

2,124 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @shiqi_seventeen,

1. Yes, please look at the following community posts:

2. Yes

Best regards,
Julián

0 Kudos
Reply

2,104 Views
shiqi_seventeen
Contributor III
Thanks Julián! I am following the second Web page,but when I build my project,it say "linker_flash_s32k146.ld:50: syntax errorr",because I follow the steps to change some code:
MEMORY
{
int_flash_interrupts : ORIGIN = 0x00000000, LENGTH = 0x00000400 /* 1K */ /* Do not change this section */
int_flash_config : ORIGIN = 0x00000400, LENGTH = 0x00000010 /* 16bytes */ /* Do not change this section */
int_flash : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0 /* ~1.0MB */

int_sram_results : ORIGIN = 0x1FFF0000, LENGTH = 0x00000100 /* 256bytes */
/*int_sram : ORIGIN = 0x1FFF0100, LENGTH = 0x0001DF00 /* ~120K */
int_sram : ORIGIN = 0x1FFF0100, LENGTH = 0x0001BF00 /* ~120K */

/* "test" Ram is used to erase flash*/
test : ORIGIN = 0x2000C000, LENGTH = 0x00002000

int_sram_stack_c0 : ORIGIN = 0x2000E000, LENGTH = 0x00001000 /* 4K */
ram_rsvd2 : ORIGIN = 0x2000F000, LENGTH = 0 /* End of SRAM */
}


.test :
{
KEEP(*(.test))
} > test


so can you tell me how to fix it? thank you!
0 Kudos
Reply

2,094 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @shiqi_seventeen,

You can just copy over the configuration from the community example, the error is mentioning syntax error:

 

/* Specify the memory areas */
MEMORY
{
  /* Flash */
  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010
  m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x0003FBF0

  /* SRAM_L */
  m_data                (RW)  : ORIGIN = 0x1FFFC000, LENGTH = 0x00002000
  
  test           	    (RX)  : ORIGIN = 0x1FFFE000, LENGTH = 0x00002000

  /* SRAM_U */
  m_data_2              (RW)  : ORIGIN = 0x20000000, LENGTH = 0x00003000
}

 

Best regards,
Julián

0 Kudos
Reply

2,082 Views
shiqi_seventeen
Contributor III
Thanks Julián.Besides,I ask a question:Can I place the "erase function "and "Write function" in the DFlash?
0 Kudos
Reply

2,070 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @shiqi_seventeen,

You can refer to table 36.5.9.4 from the S32K1XX RM for allowed simultaneous flash operations:

Julin_AragnM_0-1725649584256.png

Best regards,
Julián

0 Kudos
Reply