Flash Init Problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
3,826件の閲覧回数
EE_CW
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

ラベル(1)
タグ(5)
0 件の賞賛
返信
1 解決策
3,816件の閲覧回数
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

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
3,817件の閲覧回数
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

0 件の賞賛
返信
2,198件の閲覧回数
TM_207
Contributor I

hello:

I have encountered the same problem。

1)"FLASH-DRV_CommandSequence"was not placed in SRAM。When I run the "FLASH-DRV-DEFlashPartition" function,Generated 'b Default ISR'. The address of the 'FLASH-DRV_CommandSequence' function is 0x000000f54.

2)"FLASH-DRV_CommandSequence" was  placed in SRAM。When I run the "FLASH-DRV-DEFlashPartition" function.D-Flash Partition successful."FLASH-DRV_ The CommandSequence "function address was not found in the map file

My question is why we need to use FLASH-DRV_ The CommandSequence function is placed in RAM to avoid generating abnormal interrupts

 

0 件の賞賛
返信
3,808件の閲覧回数
EE_CW
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 件の賞賛
返信
3,800件の閲覧回数
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 件の賞賛
返信