Keil Logo

Initialization

On its first invocation, the CAN_init function does two things:

  • It initializes the hardware of all CAN controllers. This includes setting up dedicated pin functions for CAN transmit and receive and assigning interrupt routine addresses and priorities to the CAN transmit and receive interrupts according to the parameters in CAN_CFG.H.
  • It initializes the memory pool used for CAN transmit and receive message buffers.

    The size of the memory pool is determined by constants in RTX_CAN.H and CAN_CFG.H. These parameters are constants CAN_CTRL_MAX_NUM, CAN_No_SendObjects and CAN_No_ReceiveObjects.

    CAN_CTRL_MAX_NUM is maximum index of the hardware CAN controller used, this constant is set automatically by preprocessor inside RTX_CAN.H file.

    CAN_No_SendObjects is the number of messages available for usage in the transmit software message FIFO buffer.

    CAN_No_ReceiveObjects is the number of messages available for usage in the receive software message FIFO buffer.

    The memory pool uses (CAN_CTRL_MAX_NUM * (CAN_No_SendObjects + CAN_No_ReceiveObjects) * 4 + 3) * 4 of bytes of memory.

Note

  • Mailbox size is specified in the CAN_CFG.H file using the CAN_No_SendObjects and CAN_No_ReceiveObjects manifest constants.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.