Flash Init Problem

cancel
Showing results for 
Search instead for 
Did you mean: 

Flash Init Problem

Jump to solution
412 Views
michaellüthold
Contributor III

Hello together

I have a project where I use the internal EEPROM functionality of the S32K148. I adjusted the example code from NXP to write an driver which uses the SDK. For several versions of our Software it worked correctly without any problems.
But now I'm facing the problem that the software gets stucked in the Flash Init routine. But this problem pops up only during flashing a brand new MCU, which was never flashed before.

If I'm flashing an older version of our software, it works without problems (even if the driver of the flash/EEPROM has no changes between these two versions).
I attached the Init routine of my driver. The software stucks as follows:
...
flashinit()
      |__>  FLASH_DRV_DEFlashPartition()
                     |__> FLASH_DRV_CommandSequence()
                                  |__> Programm stops and restart from beginning.

What could be the problem here?

Thanks and regards

Mario

Labels (1)
0 Kudos
1 Solution
402 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Mario,

If this init routine has not been changed, the issue must be elsewhere.

If it crashes during this function FLASH_DRV_CommandSequence(), I think there could be two reasons.

1. The function is not in SRAM - please check the .map file of the new SW.

2. The MCU accesses the Flash memory during the partitioning (interrupts, DMA) - can you disable interrupts before the partitioning starts?

I have noticed you install FTFC interrupt routine there. But do you use it in the application?

 

Thanks,

BR, Daniel

View solution in original post

0 Kudos
3 Replies
403 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Mario,

If this init routine has not been changed, the issue must be elsewhere.

If it crashes during this function FLASH_DRV_CommandSequence(), I think there could be two reasons.

1. The function is not in SRAM - please check the .map file of the new SW.

2. The MCU accesses the Flash memory during the partitioning (interrupts, DMA) - can you disable interrupts before the partitioning starts?

I have noticed you install FTFC interrupt routine there. But do you use it in the application?

 

Thanks,

BR, Daniel

View solution in original post

0 Kudos
394 Views
michaellüthold
Contributor III

Hi Daniel

Thanks for your answer.

In the .map file I Couldn't find the FLASH_DRV_CommandSequence. I'm not sure if it should be listed in there in this case?
But your second hint about the interrupts was helpful.

I found something in another part of the software, that caused some interrupts. These were interrupting the partitioning and caused the reset. Now I init the flash as early as possible, before the other part is initialized and starts to cause interrupts.

With this change, I tested it successfully.

Regards
Mario

0 Kudos
386 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Mario,

To be sure, you can mask (PRIMASK) all the interrupts before the partitioning starts.

There would be no problem if the interrupt vector table, the interrupt routines and all the resources that the routines use were in SRAM.

 

Regards,

Daniel

0 Kudos