I try to implement a CAN communication with the K22 flexcan. I used the clocks tool from the MCUxpresso IDE to setup the bus clocks. The programm compiles well. The communication runs in callback, but when I try to use external PEAK CAN USB adapter I receive only "kStatus_FLEXCAN_ErrorStatus". All experts I asked, have no idea. The code I mainly copied from the SDK examples. Only my board works with 16 Mhz crystal (the board from the example works with 8 Mhz). Which timing setups are important for correct CAN communication? I added the to files generated by the clocks tool. Do anybody see a mistake in the clock setup? What could I check to find the mistake? Thanks for all your help or tips, Ulrich
Hi Ulrich Schmidt,
The clock source of flexcan is OSCERCLK or Bus clock.
That example using 8MHz OSCERCLK(from crystal).
Since the frequency of crystal has increased to 16MHz, have you you modify the values of flexcanConfig?
You can refer: FlexCAN 800K Baud issue in KinetisK series
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------