TRK-KEA128 BOARD, READ A CAN MESSAGE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TRK-KEA128 BOARD, READ A CAN MESSAGE

613 Views
emilioaronmoyer
Contributor III

HELLO I´M USING TRK-KEA128 BOARD, I'M TRYING TO READ A CAN MESSAGE BUT CAN´T SEE ANY RESULT. I DON´T KNOW IF IT IS READING OR NOT, I DON´T KNOW WHERE CAN I SEE DE DATA. I'M USING CW AND THE CODE I'M USING I DOWNLOAD IT FROM KEA Reliable, Low-power MCUs|NXP .THE CODE I´M USING IS:

  Clk_Init();

  MSCAN_ModuleEn();

  GPIOB_PDDR |= (1<<16);    /*! MC33901 STB, Mapped from GPIOB16 */

  GPIOB_PCOR = (1<<16);

  /*write your own code here*/

  int err_status;    //To store the return value of the driver APIs.

  uint8 data[9];

  int buffer_status[9];

  /* Configure message buffer 0 */

  Config_CAN_MB(0, 0, RXDF, 0);

  /* Wait until new data has been received in message buffer 0 */

  while (buffer_status[0] != NEWDATA)     //Wait for the Receive ISR to finish and change the buffer status, NEWDATA indicates that the buffer has receive a new data

     {           //check buffer status

         err_status = Check_CAN_MB_Status(0, 0, buffer_status);  

     } 

  err_status = Read_CAN_MB_Data(0, 0, data); //Copy the received data in msCAN channel 0 buffer 0 to data;

  return 0;

}

I CAN TRANSMIT A MESSAGE BUT I DON'T KNOW IF IT'S READING.

CAN SOMEBODY HELP ME??

Labels (1)
0 Kudos
1 Reply

338 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Emilio Aron Moyers,

    About the MSCAN question of TRK-KEA128 board, there has a lot of similar questions in our community, please refer to this post:

CAN_LDD TRK_KEA128 sendFrame (NOT LOOPBACK)

   I already give two CAN sample code for KEA128 in that post, one is with Processor expert, another is the bare bone code, I also give the test result, you can refer to it.

Wish it helps you!

If you still have question, please let me know!

Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------

0 Kudos