C40 Flash Erase/Write from Bootloader in S32K311 (Same Flash Block Execution)

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

C40 Flash Erase/Write from Bootloader in S32K311 (Same Flash Block Execution)

Jump to solution
894 Views
yusupkhan241
Contributor II

Hi NXP Support Team,

I am currently working on a bootloader implementation for the S32K311 device and need clarification regarding C40 flash erase/program behavior when operating within the same flash array.

Context:

  • MCU: S32K311
  • Flash Size: 1 MB
  • Bootloader region: ~128 KB (starting at 0x00400000)
  • Application region: remaining flash (~896 KB)
  • Both bootloader and application reside within the same flash array/block

Observed Behavior:
While attempting to erase/program the application region from the bootloader, the C40 driver returns an error and execution goes into the error handler. This appears consistent with the known limitation of not being able to perform flash operations while executing from the same flash array.

Concern / Confusion:
I reviewed the “Unified Bootloader” example provided by NXP. From initial analysis, it appears that the flash driver (C40_Ip) functions are linked and executed from flash memory itself.

This raises the following questions:

  1. How does the Unified Bootloader example successfully perform flash erase/program operations if the code is executing from flash?
  2. Are the flash driver routines internally relocated to RAM (e.g., via linker sections or runtime copying), even if not explicitly visible?
  3. Is there any implicit mechanism (e.g., SDK/RTD configuration, compiler/linker behavior) that ensures flash operations are executed from RAM?
  4. For single-block devices like S32K311, is executing flash erase/program strictly required to be done from RAM?
  5. Could you confirm the recommended approach for:
    • Erasing/programming application flash from bootloader
    • Handling this in production-grade implementations

Additional Notes:

  • I ensured that erase operations are sector-aligned.
  • Write operations follow alignment constraints.
  • The issue persists unless execution is moved to RAM.

It would be helpful if you could clarify how the reference example handles this internally and provide guidance on the correct implementation approach.

Thank you for your support.

Best regards,
Yusup Khan  S32DS-ARM #S32K344-WB

0 Kudos
Reply
1 Solution
419 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Yusup,

I tested the S32K344 project today.

It did not pass the Mem_43_INFLS_Erase() function because of this error:

danielmartynek_0-1777021412535.png

This was resolved by adding this batch:

danielmartynek_1-1777021513961.png

After that it ended up in a fault exception that was resolved by enabling this option:

danielmartynek_2-1777021586556.png

 

Please test it on your side.

Thank you,

BR, Daniel

 

 

 

View solution in original post

11 Replies
496 Views
yusupkhan241
Contributor II

@danielmartynek 

This issue is currently blocking further progress on our side. Could you please help with the next steps or suggest additional areas we should investigate? Also, let me know if you need any logs, traces, or specific test scenarios—I can share them promptly.

Appreciate your support on this.

Thanks,
Yusup

0 Kudos
Reply
420 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Yusup,

I tested the S32K344 project today.

It did not pass the Mem_43_INFLS_Erase() function because of this error:

danielmartynek_0-1777021412535.png

This was resolved by adding this batch:

danielmartynek_1-1777021513961.png

After that it ended up in a fault exception that was resolved by enabling this option:

danielmartynek_2-1777021586556.png

 

Please test it on your side.

Thank you,

BR, Daniel

 

 

 

228 Views
yusupkhan241
Contributor II

Hi @danielmartynek 

Thank you for the support. The issue is resolved now and the erase operation is working as expected.

I have a few follow-up questions regarding cache usage on S32K3:

  1. Is there any way to perform flash erase and write operations without using the cache module? Or is cache handling mandatory for reliable operation on this platform?
  2. If cache must be used, what precautions should be taken while performing flash operations (erase/write)?
    • Are there specific steps required before and after flash operations (e.g., cache clean/invalidate)?
    • Any recommended sequence from NXP?
  3. Also, could you please share the pros and cons of enabling cache in such use cases?

 

Additionally, I have a bootloader and application setup, and I am using the following API to jump from bootloader to application. If cache cannot be excluded, I would like to confirm whether my jump implementation is correct or if any cache-related handling needs to be added.

 

void JumpToApplication(void)

{

    uint32 appStack = *(uint32 *)(APP_STARTADDR);

    uint32 func = *(uint32 volatile *)(APP_STARTADDR + 0xC);

    func = *(uint32 volatile *)(((uint32)func) + 0x4);

 

    /* Disable all interrupts */

    DisableAllInterrupts();

 

    /* Set application's vector table using SCB register */

    S32_SCB->VTOR = APP_STARTADDR;

 

    /* Set MSP & PSP */

    __asm volatile ("msr msp, %0" :: "r"(appStack));

    __asm volatile ("msr psp, %0" :: "r"(appStack));

 

    func = ((((uint32)func) & 0xFFFFFFFEU) | 1U);

 

    (*(void (*)(void))func)();

 

    while (1);

}

 

static void DisableAllInterrupts(void)

{

    for (int i = DMATCD0_IRQn; i <= SoC_IRQn; i++)

    {

        IntCtrl_Ip_DisableIrq((IRQn_Type)i);

        IntCtrl_Ip_ClearPending((IRQn_Type)i);

    }

 

    S32_SysTick->CSRr = 0U;

}

Please let me know if any additional steps (especially related to cache, MPU, or barriers) are required before jumping to the application.

Thanks,

Yusup

Tags (1)
0 Kudos
Reply
224 Views
danielmartynek
NXP TechSupport
NXP TechSupport

HI @yusupkhan241,

Great to hear the issue has been resolved.

Can you please place the cache questions into a new thread?

 

Thank you

0 Kudos
Reply
213 Views
yusupkhan241
Contributor II

Hi @danielmartynek 

Yes, I have created a new thread for the cache-related questions. 

https://community.nxp.com/t5/S32K/S32K3-Cortex-M7-Cache-Handling-Requirements-for-Flash-Operations/m...

Thank you for the support. S32K3

Best regards,
Yusup

454 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Yusup,

Sorry for the delay—I was out of the office for a few days.
I will need to reproduce the issue on my side tomorrow once I’m back.
I see that you have already shared an S32K344 test project, which I can use for validation.
If you also have a minimal S32K311 project that reproduces the same behavior, please share it as well, if you don't want to share it here, please create a support ticket.

 

Regards,

Daniel

 

0 Kudos
Reply
879 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @yusupkhan241,

1 & 2.
The Unified Bootloader is an unofficial NXP demo that has only been published on the community forum, and therefore it is not supported by NXP technical support.
However, I can see that this demo has been ported to the S32K312, S32K314, S32K324, and S32K344 devices, all of which contain two or more PFlash blocks.

3 & 5.

3 & 5.
If you are using the C40_Ip driver, you must relocate the flash APIs to SRAM. Please refer to the following example that demonstrates the required setup:
https://community.nxp.com/t5/S32K-Knowledge-Base/S32K312-C40-Ip-SRAM-RTD-500-DS35/ta-p/2074245

Or you can use the INFLS MCAL driver instaed, which automatically relocates the flash routines to SRAM when this option is enabled. This is the recommended approach.

image.png

4.

There are two PFlash blocks and one DFlash on S32K311. So it is not a must.

image.png

 

Regards,

Daniel

0 Kudos
Reply
718 Views
yusupkhan241
Contributor II

Hi Daniel (@danielmartynek) ,

Thank you for the response. I have enabled the INFLS MCAL driver with SRAM relocation (Mem Load Access Code On Job Start enabled). However, I still observe the following:

  1. Flash operations succeed in Block 2 but fail with E_NOT_OK in Block 0 when the application is executing from Block 0.
  2. It appears that even though INFLS relocates flash routines to SRAM, the application code (and possibly vector table/interrupts) still executes from Block 0, causing failure during erase.
  3. Could you confirm whether it is mandatory that no code (including interrupts/vector table) executes from the target flash block during erase/program, even when using INFLS?
  4. What is the recommended approach to erase/program Block 0 in such cases—should the entire application be executed from RAM or relocated to another flash block?

Test Cases:

  1. Using Block 2 (0x00600000 – C40_CODE_ARRAY_0_BLOCK_2_S256):
    • Erase & program operations → SUCCESS
  2. Using Block 0 (0x00480000 – C40_CODE_ARRAY_0_BLOCK_0_S064):
    • Erase operation → Returns E_NOT_OK

 

Thanks,
Yusup

yusupkhan241_0-1776251108071.png

 

0 Kudos
Reply
708 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Yusup,

Your observation is correct.
The flash block being programmed or erased must not be accessed during the operation. This limitation applies not only to the vector table and the interrupt service routines (ISRs), but also to any constants or data located in flash that the ISRs may read.
To isolate the root cause, try globally masking interrupts before launching the flash operation. This will help verify whether the issue originates from an interrupt activity rather than from INFLS itself.

 

Regards,

Daniel

 

 

0 Kudos
Reply
592 Views
yusupkhan241
Contributor II

Hi @danielmartynek ,

Thank you for the clarification.

I tried masking global interrupts before initiating the flash operation, but the issue still persists. The erase operation in Block 0 continues to return E_NOT_OK.

Please let me know if you need any additional details, logs, or specific test scenarios from my side. I can share further information or perform any checks required to help isolate the issue.

Thanks,
Yusup

0 Kudos
Reply
591 Views
yusupkhan241
Contributor II
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2349201%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EC40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2349201%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20NXP%20Support%20Team%2C%3C%2FP%3E%3CP%3EI%20am%20currently%20working%20on%20a%20bootloader%20implementation%20for%20the%20S32K311%20device%20and%20need%20clarification%20regarding%20C40%20flash%20erase%2Fprogram%20behavior%20when%20operating%20within%20the%20same%20flash%20array.%3C%2FP%3E%3CP%3E%3CSTRONG%3EContext%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3EMCU%3A%20S32K311%3C%2FLI%3E%3CLI%3EFlash%20Size%3A%201%20MB%3C%2FLI%3E%3CLI%3EBootloader%20region%3A%20~128%20KB%20(starting%20at%200x00400000)%3C%2FLI%3E%3CLI%3EApplication%20region%3A%20remaining%20flash%20(~896%20KB)%3C%2FLI%3E%3CLI%3EBoth%20bootloader%20and%20application%20reside%20within%20the%20same%20flash%20array%2Fblock%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSTRONG%3EObserved%20Behavior%3A%3C%2FSTRONG%3E%3CBR%20%2F%3EWhile%20attempting%20to%20erase%2Fprogram%20the%20application%20region%20from%20the%20bootloader%2C%20the%20C40%20driver%20returns%20an%20error%20and%20execution%20goes%20into%20the%20error%20handler.%20This%20appears%20consistent%20with%20the%20known%20limitation%20of%20not%20being%20able%20to%20perform%20flash%20operations%20while%20executing%20from%20the%20same%20flash%20array.%3C%2FP%3E%3CP%3E%3CSTRONG%3EConcern%20%2F%20Confusion%3A%3C%2FSTRONG%3E%3CBR%20%2F%3EI%20reviewed%20the%20%E2%80%9CUnified%20Bootloader%E2%80%9D%20example%20provided%20by%20NXP.%20From%20initial%20analysis%2C%20it%20appears%20that%20the%20flash%20driver%20(C40_Ip)%20functions%20are%20linked%20and%20executed%20from%20flash%20memory%20itself.%3C%2FP%3E%3CP%3EThis%20raises%20the%20following%20questions%3A%3C%2FP%3E%3COL%3E%3CLI%3EHow%20does%20the%20Unified%20Bootloader%20example%20successfully%20perform%20flash%20erase%2Fprogram%20operations%20if%20the%20code%20is%20executing%20from%20flash%3F%3C%2FLI%3E%3CLI%3EAre%20the%20flash%20driver%20routines%20internally%20relocated%20to%20RAM%20(e.g.%2C%20via%20linker%20sections%20or%20runtime%20copying)%2C%20even%20if%20not%20explicitly%20visible%3F%3C%2FLI%3E%3CLI%3EIs%20there%20any%20implicit%20mechanism%20(e.g.%2C%20SDK%2FRTD%20configuration%2C%20compiler%2Flinker%20behavior)%20that%20ensures%20flash%20operations%20are%20executed%20from%20RAM%3F%3C%2FLI%3E%3CLI%3EFor%20single-block%20devices%20like%20S32K311%2C%20is%20executing%20flash%20erase%2Fprogram%20strictly%20required%20to%20be%20done%20from%20RAM%3F%3C%2FLI%3E%3CLI%3ECould%20you%20confirm%20the%20recommended%20approach%20for%3A%3C%2FLI%3E%3CUL%3E%3CLI%3EErasing%2Fprogramming%20application%20flash%20from%20bootloader%3C%2FLI%3E%3CLI%3EHandling%20this%20in%20production-grade%20implementations%3C%2FLI%3E%3C%2FUL%3E%3C%2FOL%3E%3CP%3E%3CSTRONG%3EAdditional%20Notes%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3EI%20ensured%20that%20erase%20operations%20are%20sector-aligned.%3C%2FLI%3E%3CLI%3EWrite%20operations%20follow%20alignment%20constraints.%3C%2FLI%3E%3CLI%3EThe%20issue%20persists%20unless%20execution%20is%20moved%20to%20RAM.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EIt%20would%20be%20helpful%20if%20you%20could%20clarify%20how%20the%20reference%20example%20handles%20this%20internally%20and%20provide%20guidance%20on%20the%20correct%20implementation%20approach.%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20support.%3C%2FP%3E%3CP%3EBest%20regards%2C%3CBR%20%2F%3EYusup%20Khan%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FS32DS-ARM%2Fpd-p%2FS32DS-ARM%22%20class%3D%22lia-product-mention%22%20data-product%3D%223477-1%22%20target%3D%22_blank%22%3ES32DS-ARM%3C%2FA%3E%26nbsp%3B%23%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FS32K344-WB%2Fpd-p%2FS32K344-WB%22%20class%3D%22lia-product-mention%22%20data-product%3D%223494-1%22%20target%3D%22_blank%22%3ES32K344-WB%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2349294%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2349294%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252570%22%20target%3D%22_blank%22%3E%40yusupkhan241%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E1%20%26amp%3B%202.%3CBR%20%2F%3EThe%20Unified%20Bootloader%20is%20an%20unofficial%20NXP%20demo%20that%20has%20only%20been%20published%20on%20the%20community%20forum%2C%20and%20therefore%20it%20is%20not%20supported%20by%20NXP%20technical%20support.%3CBR%20%2F%3EHowever%2C%20I%20can%20see%20that%20this%20demo%20has%20been%20ported%20to%20the%20S32K312%2C%20S32K314%2C%20S32K324%2C%20and%20S32K344%20devices%2C%20all%20of%20which%20contain%20two%20or%20more%20PFlash%20blocks.%3C%2FP%3E%0A%3CP%3E3%20%26amp%3B%205.%3C%2FP%3E%0A%3CP%3E3%20%26amp%3B%205.%3CBR%20%2F%3EIf%20you%20are%20using%20the%20C40_Ip%20driver%2C%20you%20must%20relocate%20the%20flash%20APIs%20to%20SRAM.%20Please%20refer%20to%20the%20following%20example%20that%20demonstrates%20the%20required%20setup%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K312-C40-Ip-SRAM-RTD-500-DS35%2Fta-p%2F2074245%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K312-C40-Ip-SRAM-RTD-500-DS35%2Fta-p%2F2074245%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EOr%20you%20can%20use%20the%20INFLS%20MCAL%20driver%20instaed%2C%20which%20automatically%20relocates%20the%20flash%20routines%20to%20SRAM%20when%20this%20option%20is%20enabled.%20This%20is%20the%20recommended%20approach.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20758px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F381987iB6FD0CD9C6C6D245%2Fimage-dimensions%2F758x571%3Fv%3Dv2%22%20width%3D%22758%22%20height%3D%22571%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E4.%3C%2FP%3E%0A%3CP%3EThere%20are%20two%20PFlash%20blocks%20and%20one%20DFlash%20on%20S32K311.%20So%20it%20is%20not%20a%20must.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20873px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F381991iB67EA382D99D567A%2Fimage-dimensions%2F873x264%3Fv%3Dv2%22%20width%3D%22873%22%20height%3D%22264%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2351524%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2351524%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Daniel%20(%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E)%20%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20response.%20I%20have%20enabled%20the%20INFLS%20MCAL%20driver%20with%20SRAM%20relocation%20(Mem%20Load%20Access%20Code%20On%20Job%20Start%20enabled).%20However%2C%20I%20still%20observe%20the%20following%3A%3C%2FP%3E%3COL%3E%3CLI%3EFlash%20operations%20succeed%20in%20Block%202%20but%20fail%20with%20E_NOT_OK%20in%20Block%200%20when%20the%20application%20is%20executing%20from%20Block%200.%3C%2FLI%3E%3CLI%3EIt%20appears%20that%20even%20though%20INFLS%20relocates%20flash%20routines%20to%20SRAM%2C%20the%20application%20code%20(and%20possibly%20vector%20table%2Finterrupts)%20still%20executes%20from%20Block%200%2C%20causing%20failure%20during%20erase.%3C%2FLI%3E%3CLI%3ECould%20you%20confirm%20whether%20it%20is%20mandatory%20that%20no%20code%20(including%20interrupts%2Fvector%20table)%20executes%20from%20the%20target%20flash%20block%20during%20erase%2Fprogram%2C%20even%20when%20using%20INFLS%3F%3C%2FLI%3E%3CLI%3EWhat%20is%20the%20recommended%20approach%20to%20erase%2Fprogram%20Block%200%20in%20such%20cases%E2%80%94should%20the%20entire%20application%20be%20executed%20from%20RAM%20or%20relocated%20to%20another%20flash%20block%3F%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CSTRONG%3ETest%20Cases%3A%3C%2FSTRONG%3E%3C%2FP%3E%3COL%3E%3CLI%3E%3CSTRONG%3EUsing%20Block%202%20(0x00600000%20%E2%80%93%20C40_CODE_ARRAY_0_BLOCK_2_S256)%3A%3C%2FSTRONG%3E%3CUL%3E%3CLI%3EErase%20%26amp%3B%20program%20operations%20%E2%86%92%20SUCCESS%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EUsing%20Block%200%20(0x00480000%20%E2%80%93%20C40_CODE_ARRAY_0_BLOCK_0_S064)%3A%3C%2FSTRONG%3E%3CUL%3E%3CLI%3EErase%20operation%20%E2%86%92%20Returns%20E_NOT_OK%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3EThanks%2C%3CBR%20%2F%3EYusup%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yusupkhan241_0-1776251108071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382449i3883F2E8ACD11C5C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22yusupkhan241_0-1776251108071.png%22%20alt%3D%22yusupkhan241_0-1776251108071.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2351600%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2351600%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3BYusup%2C%3C%2FP%3E%0A%3CP%3EYour%20observation%20is%20correct.%3CBR%20%2F%3EThe%20flash%20block%20being%20programmed%20or%20erased%20must%20not%20be%20accessed%20during%20the%20operation.%20This%20limitation%20applies%20not%20only%20to%20the%20vector%20table%20and%20the%20interrupt%20service%20routines%20(ISRs)%2C%20but%20also%20to%20any%20constants%20or%20data%20located%20in%20flash%20that%20the%20ISRs%20may%20read.%3CBR%20%2F%3ETo%20isolate%20the%20root%20cause%2C%20try%20globally%20masking%20interrupts%20before%20launching%20the%20flash%20operation.%20This%20will%20help%20verify%20whether%20the%20issue%20originates%20from%20an%20interrupt%20activity%20rather%20than%20from%20INFLS%20itself.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2355175%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355175%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3BYusup%2C%3C%2FP%3E%0A%3CP%3ESorry%20for%20the%20delay%E2%80%94I%20was%20out%20of%20the%20office%20for%20a%20few%20days.%3CBR%20%2F%3EI%20will%20need%20to%20reproduce%20the%20issue%20on%20my%20side%20tomorrow%20once%20I%E2%80%99m%20back.%3CBR%20%2F%3EI%20see%20that%20you%20have%20already%20shared%20an%20S32K344%20test%20project%2C%20which%20I%20can%20use%20for%20validation.%3CBR%20%2F%3EIf%20you%20also%20have%20a%20minimal%20S32K311%20project%20that%20reproduces%20the%20same%20behavior%2C%20please%20share%20it%20as%20well%2C%20if%20you%20don't%20want%20to%20share%20it%20here%2C%20please%20create%20a%20support%20ticket.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2355746%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355746%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3BYusup%2C%3C%2FP%3E%0A%3CP%3EI%20tested%20the%20S32K344%20project%20today.%3C%2FP%3E%0A%3CP%3EIt%20did%20not%20pass%20the%26nbsp%3BMem_43_INFLS_Erase()%20function%20because%20of%20this%20error%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_0-1777021412535.png%22%20style%3D%22width%3A%20525px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1777021412535.png%22%20style%3D%22width%3A%20525px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1777021412535.png%22%20style%3D%22width%3A%20525px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1777021412535.png%22%20style%3D%22width%3A%20525px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1777021412535.png%22%20style%3D%22width%3A%20525px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1777021412535.png%22%20style%3D%22width%3A%20525px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1777021412535.png%22%20style%3D%22width%3A%20525px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383466i00A28EA5B21DE841%2Fimage-dimensions%2F525x99%3Fv%3Dv2%22%20width%3D%22525%22%20height%3D%2299%22%20role%3D%22button%22%20title%3D%22danielmartynek_0-1777021412535.png%22%20alt%3D%22danielmartynek_0-1777021412535.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThis%20was%20resolved%20by%20adding%20this%20batch%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_1-1777021513961.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1777021513961.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1777021513961.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1777021513961.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1777021513961.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1777021513961.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_1-1777021513961.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383467i998394AE10AC1142%2Fimage-dimensions%2F552x290%3Fv%3Dv2%22%20width%3D%22552%22%20height%3D%22290%22%20role%3D%22button%22%20title%3D%22danielmartynek_1-1777021513961.png%22%20alt%3D%22danielmartynek_1-1777021513961.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAfter%20that%20it%20ended%20up%20in%20a%20fault%20exception%20that%20was%20resolved%20by%20enabling%20this%20option%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_2-1777021586556.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_2-1777021586556.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_2-1777021586556.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_2-1777021586556.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_2-1777021586556.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_2-1777021586556.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_2-1777021586556.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383468iD5B2899D369B4240%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22danielmartynek_2-1777021586556.png%22%20alt%3D%22danielmartynek_2-1777021586556.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EPlease%20test%20it%20on%20your%20side.%3C%2FP%3E%0A%3CP%3EThank%20you%2C%3C%2FP%3E%0A%3CP%3EBR%2C%20Daniel%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2354678%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2354678%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20issue%20is%20currently%20blocking%20further%20progress%20on%20our%20side.%20Could%20you%20please%20help%20with%20the%20next%20steps%20or%20suggest%20additional%20areas%20we%20should%20investigate%3F%20Also%2C%20let%20me%20know%20if%20you%20need%20any%20logs%2C%20traces%2C%20or%20specific%20test%20scenarios%E2%80%94I%20can%20share%20them%20promptly.%3C%2FP%3E%3CP%3EAppreciate%20your%20support%20on%20this.%3C%2FP%3E%3CP%3EThanks%2C%3CBR%20%2F%3EYusup%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2354069%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2354069%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20clarification.%3C%2FP%3E%3CP%3EI%20tried%20masking%20global%20interrupts%20before%20initiating%20the%20flash%20operation%2C%20but%20the%20issue%20still%20persists.%20The%20erase%20operation%20in%20Block%200%20continues%20to%20return%20%3CSTRONG%3EE_NOT_OK%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20if%20you%20need%20any%20additional%20details%2C%20logs%2C%20or%20specific%20test%20scenarios%20from%20my%20side.%20I%20can%20share%20further%20information%20or%20perform%20any%20checks%20required%20to%20help%20isolate%20the%20issue.%3C%2FP%3E%3CP%3EThanks%2C%3CBR%20%2F%3EYusup%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358563%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358563%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252570%22%20target%3D%22_blank%22%3E%40yusupkhan241%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EGreat%20to%20hear%20the%20issue%20has%20been%20resolved.%3C%2FP%3E%0A%3CP%3ECan%20you%20please%20place%20the%20cache%20questions%20into%20a%20new%20thread%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358556%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358556%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20support.%20The%20issue%20is%20resolved%20now%20and%20the%20erase%20operation%20is%20working%20as%20expected.%3C%2FP%3E%3CP%3EI%20have%20a%20few%20follow-up%20questions%20regarding%20cache%20usage%20on%20S32K3%3A%3C%2FP%3E%3COL%3E%3CLI%3EIs%20there%20any%20way%20to%20perform%20flash%20erase%20and%20write%20operations%20without%20using%20the%20cache%20module%3F%20Or%20is%20cache%20handling%20mandatory%20for%20reliable%20operation%20on%20this%20platform%3F%3C%2FLI%3E%3CLI%3EIf%20cache%20must%20be%20used%2C%20what%20precautions%20should%20be%20taken%20while%20performing%20flash%20operations%20(erase%2Fwrite)%3F%3C%2FLI%3E%3CUL%3E%3CLI%3EAre%20there%20specific%20steps%20required%20before%20and%20after%20flash%20operations%20(e.g.%2C%20cache%20clean%2Finvalidate)%3F%3C%2FLI%3E%3CLI%3EAny%20recommended%20sequence%20from%20NXP%3F%3C%2FLI%3E%3C%2FUL%3E%3CLI%3EAlso%2C%20could%20you%20please%20share%20the%20pros%20and%20cons%20of%20enabling%20cache%20in%20such%20use%20cases%3F%3C%2FLI%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3EAdditionally%2C%20I%20have%20a%20bootloader%20and%20application%20setup%2C%20and%20I%20am%20using%20the%20following%20API%20to%20jump%20from%20bootloader%20to%20application.%20If%20cache%20cannot%20be%20excluded%2C%20I%20would%20like%20to%20confirm%20whether%20my%20jump%20implementation%20is%20correct%20or%20if%20any%20cache-related%20handling%20needs%20to%20be%20added.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Evoid%20JumpToApplication(void)%3C%2FP%3E%3CP%3E%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20uint32%20appStack%20%3D%20*(uint32%20*)(APP_STARTADDR)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20uint32%20func%20%3D%20*(uint32%20volatile%20*)(APP_STARTADDR%20%2B%200xC)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20func%20%3D%20*(uint32%20volatile%20*)(((uint32)func)%20%2B%200x4)%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Disable%20all%20interrupts%20*%2F%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20DisableAllInterrupts()%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Set%20application's%20vector%20table%20using%20SCB%20register%20*%2F%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20S32_SCB-%26gt%3BVTOR%20%3D%20APP_STARTADDR%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Set%20MSP%20%26amp%3B%20PSP%20*%2F%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20__asm%20volatile%20(%22msr%20msp%2C%20%250%22%20%3A%3A%20%22r%22(appStack))%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20__asm%20volatile%20(%22msr%20psp%2C%20%250%22%20%3A%3A%20%22r%22(appStack))%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20func%20%3D%20((((uint32)func)%20%26amp%3B%200xFFFFFFFEU)%20%7C%201U)%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20(*(void%20(*)(void))func)()%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20while%20(1)%3B%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Estatic%20void%20DisableAllInterrupts(void)%3C%2FP%3E%3CP%3E%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20for%20(int%20i%20%3D%20DMATCD0_IRQn%3B%20i%20%26lt%3B%3D%20SoC_IRQn%3B%20i%2B%2B)%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20IntCtrl_Ip_DisableIrq((IRQn_Type)i)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20IntCtrl_Ip_ClearPending((IRQn_Type)i)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20S32_SysTick-%26gt%3BCSRr%20%3D%200U%3B%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20if%20any%20additional%20steps%20(especially%20related%20to%20cache%2C%20MPU%2C%20or%20barriers)%20are%20required%20before%20jumping%20to%20the%20application.%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EYusup%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358581%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20C40%20Flash%20Erase%2FWrite%20from%20Bootloader%20in%20S32K311%20(Same%20Flash%20Block%20Execution)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358581%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20I%20have%20created%20a%20new%20thread%20for%20the%20cache-related%20questions.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K3-Cortex-M7-Cache-Handling-Requirements-for-Flash-Operations%2Fm-p%2F2358567%23M58273%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K3-Cortex-M7-Cache-Handling-Requirements-for-Flash-Operations%2Fm-p%2F2358567%23M58273%3C%2FA%3E%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20support.%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FS32K3%2Fpd-p%2FS32K3%22%20class%3D%22lia-product-mention%22%20data-product%3D%221688-1%22%20target%3D%22_blank%22%3ES32K3%3C%2FA%3E%3C%2FP%3E%3CP%3EBest%20regards%2C%3CBR%20%2F%3EYusup%3C%2FP%3E%3C%2FLINGO-BODY%3E