CAN Bus messages missing during Flash write operation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CAN Bus messages missing during Flash write operation

ソリューションへジャンプ
1,570件の閲覧回数
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,553件の閲覧回数
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,554件の閲覧回数
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

 

1,005件の閲覧回数
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,550件の閲覧回数
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 件の賞賛
返信