CAN Bus messages missing during Flash write operation

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CAN Bus messages missing during Flash write operation

跳至解决方案
1,521 次查看
pejo
Contributor III

Hi,

I have a bare metal OS system working for a while. I noticed recently that sometimes canbus messages are lost when I run a FLASH Write operation. It happens only in case of high traffic. 

- Canbus communication is configured as non-blocking.

- I don't detect MCAN Errors. I check in callback function for : kStatus_MCAN_RxFifo0Full & kStatus_MCAN_RxFifo0Lost

I checked for non blocking flash but no such function exists. Apparently there is no interruption associated to flash operations, meaning that I cannot prioritize can over flash operations.

Any ideas or suggestions? Currently my only solution would be to make sure that I write to Flash when there is not a lot of canbus traffic.

 

标签 (1)
0 项奖励
回复
1 解答
1,504 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that you use LPC55xx family, which has only one flash block, if you erase/program sector or page of the same block where you save code and execute, you will have issue. while the flash block is erased/programed by calling IAP function, you can not access the block, so you have to disable interrupt, but you use CAN non-blocking mechanism, which uses interrupt mechanism, it will leads to error.

If you want to erase/program flash and hope you can use interrupt mechanism, you have to copy the interrupt table to SRAM and copy the ISR to SRAM from flash, because core fetches interrupt table from RAM and execute code from RAM, it is okay, although you erase/program flash page or sector

Hope it can help you

BR

Xiangjun Rong

 

在原帖中查看解决方案

3 回复数
1,505 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that you use LPC55xx family, which has only one flash block, if you erase/program sector or page of the same block where you save code and execute, you will have issue. while the flash block is erased/programed by calling IAP function, you can not access the block, so you have to disable interrupt, but you use CAN non-blocking mechanism, which uses interrupt mechanism, it will leads to error.

If you want to erase/program flash and hope you can use interrupt mechanism, you have to copy the interrupt table to SRAM and copy the ISR to SRAM from flash, because core fetches interrupt table from RAM and execute code from RAM, it is okay, although you erase/program flash page or sector

Hope it can help you

BR

Xiangjun Rong

 

956 次查看
pejo
Contributor III

Hi Xiangjun,

we're now considering to port the code to SRAM in order to try one of the solutions that you suggested. That way we could still be able to use interruptions during the flashing of the data.

Would you please answer a couple of questions?

- As I understand I need to copy to ram the interruptions table, the interruption function with ALL the dependencies, functions and code used in the interruption function. Can you confirm this?

- The APIs for flashing the memory are blocking, so during the flashing only the interruption functions will be executed. Is it so?

Thank you!

0 项奖励
回复
1,501 次查看
pejo
Contributor III

Hello Xiangjun,

your explanation makes all the sense. Thank you very much.

Probably the easiest is to avoid using interruptions with canbus as I understand that the function MCAN_TransferReceiveBlocking allows. 

0 项奖励
回复