FlexCAN Rx mailbox locking not working

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

FlexCAN Rx mailbox locking not working

595件の閲覧回数
ola_gook
Contributor III

I have a setup with an MPC5744P and am following the reference manual instruction for FlexCAN reception.

The problem is that after reading the Control/Status word of a certain MB (in an interrupt disabled context, the Can_Isr), the contents of the MB is still constantly updating.

Not sure if it is the debugger (Lauterback( that is causing this of if I am missing some crucial setting in the FlexCAN register.

As a result, every now and then the data passed from the Isr (ID + contents) is inconsistent.

Code extract from the Can_Rx ISR:
          McuE_DisableInterrupts();

          data = canHw->MB[mbNr].CS.R;

          while( data & 0x01000000 )      // Check BUSY bit (of the CODE field)

          {

            data = canHw->MB[mbNr].CS.R;  // If set, wait for it to be cleared

          }

          memcpy(dataTmp,(uint8 *)&canHw->MB[mbNr].DATA.W[0], 8);

 

Any help greatly appreciated.

0 件の賞賛
返信
0 返答(返信)