FlexCAN Rx mailbox locking not working

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

FlexCAN Rx mailbox locking not working

ソリューションへジャンプ
1,069件の閲覧回数
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 件の賞賛
返信
1 解決策
1,050件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

an MB is unlocked when the CPU reads the Free Running Timer Register (TIMER) or the C/S word of another MB. So if debugger displays registers or MB area it can cause this too.

BR, Petr

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,051件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

an MB is unlocked when the CPU reads the Free Running Timer Register (TIMER) or the C/S word of another MB. So if debugger displays registers or MB area it can cause this too.

BR, Petr

0 件の賞賛
返信