Can you read from and write to a S32K1 flex memory region simultaneously

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

Can you read from and write to a S32K1 flex memory region simultaneously

Jump to solution
1,030 Views
teccl
Contributor II

If you partition an S32K144 MCU's flex memory region to be partially D-Flash (e.g., 16 kB) and partially E-Flash (e.g., 48 kB), you write some data to the E-Flash partition, and you run a bootloader application from D-Flash, is it possible for the bootloader application to read from and erase/write to E-Flash? (I.e., can an application that is running from the flex memory block simultaneously read/erase/write other sectors in the flex memory block?)

0 Kudos
Reply
1 Solution
986 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@teccl

No, you cannot simultaneously execute from D-Flash and erase/write E-Flash because they share the same flash controller.

Please take a look at the AN12003.

Screenshot 2025-11-14 095242.png

View solution in original post

0 Kudos
Reply
8 Replies
987 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@teccl

No, you cannot simultaneously execute from D-Flash and erase/write E-Flash because they share the same flash controller.

Please take a look at the AN12003.

Screenshot 2025-11-14 095242.png

0 Kudos
Reply
960 Views
teccl
Contributor II
Hi @Senlent,

Thanks for your reply. Based on the information that you shared, I understand that you cannot erase/write E-Flash in this example. However, it should still be possible to read from E-Flash while running a bootloader from D-Flash, right?
0 Kudos
Reply
892 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@teccl

The FTFC operation can be map to SRAM to avoid RWW.

So this is possible to run code in d-flash while read from e-flash, you needs to place FTFC

command into ram.

0 Kudos
Reply
865 Views
teccl
Contributor II
Hi @Senlent,

Thanks for letting me know. Would you be able to share any NXP documentation that elaborates on how mapping the FTFC operation to SRAM may be done?
0 Kudos
Reply
855 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@teccl

1.if you're using bare-metal code, then you can refer to this post:

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-Flash-RW-simple/ta-p/1110000

2.If you're using SDK, then you refer to "flash_partitioning_s32k144".

Senlent_0-1763428763238.png

0 Kudos
Reply
768 Views
teccl
Contributor II
Hi @Senlent,

Thanks again for your help. Just one last quick clarification: if you only want to read from, and not write to/erase, E-Flash while executing code from D-Flash, is it necessary to perform this mapping?
0 Kudos
Reply
728 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@teccl

It is still recommended to put FTFC-related operations into SRAM, because the Flash controller requires arbitration access, which may affect performance, but is functionally feasible.

(This is my analysis; I haven't conducted rigorous testing, but placing these operations in SRAM is recommended.)

%3CLINGO-SUB%20id%3D%22lingo-sub-2204603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECan%20you%20read%20from%20and%20write%20to%20a%20S32K1%20flex%20memory%20region%20simultaneously%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIf%20you%20partition%20an%20S32K144%20MCU's%20flex%20memory%20region%20to%20be%20partially%20D-Flash%20(e.g.%2C%2016%20kB)%20and%20partially%20E-Flash%20(e.g.%2C%2048%20kB)%2C%20you%20write%20some%20data%20to%20the%20E-Flash%20partition%2C%20and%20you%20run%20a%20bootloader%20application%20from%20D-Flash%2C%20is%20it%20possible%20for%20the%20bootloader%20application%20to%20read%20from%20and%20erase%2Fwrite%20to%20E-Flash%3F%20(I.e.%2C%20can%20an%20application%20that%20is%20running%20from%20the%20flex%20memory%20block%20simultaneously%20read%2Ferase%2Fwrite%20other%20sectors%20in%20the%20flex%20memory%20block%3F)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206286%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can%20you%20read%20from%20and%20write%20to%20a%20S32K1%20flex%20memory%20region%20simultaneously%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206286%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22mailto%3AHi%40teccl%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHi%40teccl%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E1.if%20you're%20using%20bare-metal%20code%2C%20then%20you%20can%20refer%20to%20this%20post%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K144-Flash-RW-simple%2Fta-p%2F1110000%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K144-Flash-RW-simple%2Fta-p%2F1110000%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E2.If%20you're%20using%20SDK%2C%20then%20you%20refer%20to%20%22flash_partitioning_s32k144%22.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_0-1763428763238.png%22%20style%3D%22width%3A%20686px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_0-1763428763238.png%22%20style%3D%22width%3A%20686px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365957i4E57AC6F3B488675%2Fimage-dimensions%2F686x319%3Fv%3Dv2%22%20width%3D%22686%22%20height%3D%22319%22%20role%3D%22button%22%20title%3D%22Senlent_0-1763428763238.png%22%20alt%3D%22Senlent_0-1763428763238.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can%20you%20read%20from%20and%20write%20to%20a%20S32K1%20flex%20memory%20region%20simultaneously%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F188029%22%20target%3D%22_blank%22%3E%40Senlent%3C%2FA%3E%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20letting%20me%20know.%20Would%20you%20be%20able%20to%20share%20any%20NXP%20documentation%20that%20elaborates%20on%20how%20mapping%20the%20FTFC%20operation%20to%20SRAM%20may%20be%20done%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205802%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can%20you%20read%20from%20and%20write%20to%20a%20S32K1%20flex%20memory%20region%20simultaneously%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205802%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22mailto%3AHi%40teccl%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHi%40teccl%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EThe%20FTFC%20operation%20can%20be%20map%20to%20SRAM%20to%20avoid%20RWW.%3C%2FP%3E%0A%3CP%3ESo%20this%20is%20possible%20to%20run%20code%20in%20d-flash%20while%20read%20from%20e-flash%2C%20you%20needs%20to%20place%20FTFC%3C%2FP%3E%0A%3CP%3Ecommand%20into%20ram.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205330%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can%20you%20read%20from%20and%20write%20to%20a%20S32K1%20flex%20memory%20region%20simultaneously%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205330%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F188029%22%20target%3D%22_blank%22%3E%40Senlent%3C%2FA%3E%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20reply.%20Based%20on%20the%20information%20that%20you%20shared%2C%20I%20understand%20that%20you%20cannot%20erase%2Fwrite%20E-Flash%20in%20this%20example.%20However%2C%20it%20should%20still%20be%20possible%20to%20read%20from%20E-Flash%20while%20running%20a%20bootloader%20from%20D-Flash%2C%20right%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204770%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can%20you%20read%20from%20and%20write%20to%20a%20S32K1%20flex%20memory%20region%20simultaneously%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204770%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22mailto%3AHi%40teccl%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHi%40teccl%3C%2FA%3E%3C%2FP%3E%0A%3CP%3ENo%2C%20you%20cannot%20simultaneously%20execute%20from%20D-Flash%20and%20erase%2Fwrite%20E-Flash%20because%20they%20share%20the%20same%20flash%20controller.%3C%2FP%3E%0A%3CP%3EPlease%20take%20a%20look%20at%20the%20AN12003.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-14%20095242.png%22%20style%3D%22width%3A%20708px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-14%20095242.png%22%20style%3D%22width%3A%20708px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365594i520A0FBD1A849CC1%2Fimage-dimensions%2F708x352%3Fv%3Dv2%22%20width%3D%22708%22%20height%3D%22352%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-14%20095242.png%22%20alt%3D%22Screenshot%202025-11-14%20095242.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E