Hello,
I use S32K148 with S32DS driver SDK3.0.2 to implement the application erasing and reprogramming.
1. when I use the following functions:
FLASH_DRV_EraseSector(&flashSSDConfig, 0x10000, 4096);
FLASH_DRV_Program(&flashSSDConfig, 0x10000, 4096, data_ptr);
>> It stucks and triggers lockup reset.
2. I realize that interrupts SHOULD be disabled first:
INT_SYS_DisableIRQGlobal();
FLASH_DRV_EraseSector(&flashSSDConfig, 0x10000, 4096);
FLASH_DRV_Program(&flashSSDConfig, 0x10000, 4096, data_ptr);
INT_SYS_EnableIRQGlobal();
>> It works fine and it takes around 30ms to finish.
3. However, it comes up the problem in time critical system.
We use also Flexcan to communicate with client and heart-beat message should be sent periodically in every 4ms maximum. It's implemented using interrupts (both rx and tx).
After disabling all interrupts for 30ms, all functions which use interrupt would be delayed.
Is there some wrong the way I use the S32DS driver?
Please give some suggestion if any.
BRs,
Matthew Xu