Hello ,
Are there any sample code/example for usage of classic CAN in LPC54628?
regards,
Hemanth
Solved! Go to Solution.
Hello Hemanth,
Just change the definition to 0:
#define USE_CANFD (0U)
Hope it helps,
Alice
Hello Hemanth S,
There is CAN demo under MCUXpresso SDK for lpc54628, it support MCUXpresso IDE,
keil and IAR, you can download from:
https://mcuxpresso.nxp.com/en/select
Regards,
Alice
Yeah, those SDK examples are worthless. They use function macros that you cannot follow into the code to find out why the example does NOT work.
Hello Alice,
The both example in SDK are mostly CAN FD based.
Are any sample code for Classc CAN and not CAN FD?
regards,
Hemanth
Hello Hemanth,
Just change the definition to 0:
#define USE_CANFD (0U)
Hope it helps,
Alice
Hello Alice,
Thanks for your inputs.
I had more queries regarding the CAN usage:
1. Which is the recommended work flow for Receiving the CAN messages?
CAN Bus-> RX FIFO -> Application Buffer
CAN Bus-> RX Buffer -> Application Buffer
2. I am able to receive messages based on CAN filter configuration.
But when I tried to read the received message ID from the structure "mcan_rx_buffer_frame_t",
it show some value which is not the same which I configured to receive.
The CAN RAM location also seem to contain this value.
e.g. for msg ID 0x11 (STD ID) -> 0x00464022 (R0 bits figure 133 in manual)
for msg ID 0x21 (STD ID) -> 0x00864042 (R0 bits figure 133 in manual)
So even tough the message are correctly received in FIFO/Buffer,
I am unable to read-back the message ID from the structure.
regards,
Hemanth
Hello Hemanth,
Why do you think "it show some value which is not the same which I configured to receive.",
what value do you read ?
There is no problem about the ID in below:
e.g. for msg ID 0x11 (STD ID) -> 0x00464022 (R0 bits figure 133 in manual)
for msg ID 0x21 (STD ID) -> 0x00864042 (R0 bits figure 133 in manual)
Regards,
Alice
Hello Alice,
Thanks for you inputs, I was looking in wrong bits (11:0)
any inputs for other question?
Hello Hemanth,
“
1. Which is the recommended work flow for Receiving the CAN messages?
CAN Bus-> RX FIFO -> Application Buffer
CAN Bus-> RX Buffer -> Application Buffer
”
I think both can ok, recommend you refer to demo, thanks.
Regards,
Alice