Example S32K144 FlexCAN TX/RX/Error ISR test S32DS2.2

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

Example S32K144 FlexCAN TX/RX/Error ISR test S32DS2.2

Example S32K144 FlexCAN TX/RX/Error ISR test S32DS2.2

The purpose of this demo application is to show you the usage of the FlexCAN module configured to use Flexible Data Rate using the S32 SDK API.
- In the first part, the application will setup the board clocks, pins and other system functions such as SBC if the board uses this module as a CAN transceiver.
- Then it will configure the FlexCAN module features such as FD, Bitrate and Message buffers
- The application will wait for frames to be received on the configured message buffer or for an event raised by pressing one of the two buttons which will trigger a frame send to the recipient.
- Pressing SW3 button of board 1 shall trigger a CAN transfer that results in toggling the RED led on board 2.
- Pressing SW2 button of board 1 shall trigger a CAN transfer that results in toggling the GREEN led on board 2.
- This demo application requires two boards, one configured as master and the other one configured as slave (see MASTER/SLAVE defines in application code)
or single board connected with CAN tool.
- Both the event and error callbacks are installed, callback_test variable indicates event entering
bit0 .. RX complete
bit1 .. TX complete
bit2 .. ERR INT flag set
bit3 .. BOFF INT flag set
- to enter bus off simply short CANH with GND and send message using either SW1 or SW2, FlexCAN enters bus off (error event) and blue LED is ON.
Also TX MB is aborted. Remove short connection and send message again normally, blue LED is off.

 

------------------------------------------------------------------------------
* Test HW: S32K144EVB-Q100
* MCU: FS32K1441 0N57U
* Compiler: S32DS.ARM.2.2
* SDK release: S32SDK_S32K1xx_RTM_3.0.3
* Debugger: Lauterbach, OpenSDA
* Target: internal_FLASH

 

Attachments
100% helpful (3/3)
Version history
Last update:
‎05-18-2021 05:20 AM
Updated by: