This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: CAN buffer size

Part Number: MSP432E401Y
Other Parts Discussed in Thread: SYSCONFIG,

Hi Charles,

By default, sysconfig sets 

CAN_Frame canMSP432E4RxBuffer[CONFIG_CANCOUNT][4];
CAN_Frame canMSP432E4TxBuffer[CONFIG_CANCOUNT][4];

which I interpret as 4 buffers each for RX and TX of one CAN port.

As there is no such setting in the sysconfig UI, when changing the settings in source/ti/drivers/.meta/can/CANMSP432E4.Board.c.xdt, sysconfig will apply them.

  1. Is the array size the right place to modify the message buffer size?
  2. Is my intepretation correct that MSP432E401Y supports a maximum of 32 message buffers for each CAN port which I need to distribute between RX and TX before can_init. So for instance 8 buffers for TX and 24 buffers for RX and not a maximum of 32 buffers for each direction?

Regards
Peter


PS: I selected the "related post" by mistake but no idea how to remove, so please ignore. Sorry.

  • CAN_Frame canMSP432E4RxBuffer[CONFIG_CANCOUNT][4];
    CAN_Frame canMSP432E4TxBuffer[CONFIG_CANCOUNT][4];

    which I interpret as 4 buffers each for RX and TX of one CAN port.

    Hi Peter,

      Looks like the code you are reading from is C:\ti\simplelink_msp432e4_sdk_4_20_00_12\source\ti\drivers\can\MSP_EXP432E401Y.c

      That is my understanding as well that 4 buffers are defined for each RX and TX of each CAN instance. There are two CAN modules on the MCU. 

    • Is the array size the right place to modify the message buffer size?

    I'm not sure why it is hardcoded to 4. Each buffer has a type structure as follows that makes up a CAN message. I think you can increase or decrease the  buffer size but I will suggest you use the default first. A lot of time you can use acceptance filter to receive more than one message ID per mailbox. If your application really needs all the mailboxes in the module then I think you can change from 4 to others but you will need to rebuild the library.

    struct can_frame {
        union {
            canid_t can_id; /*!< 11/29-bit CAN ID + EFF/RTR/ERR flags, SocketCAN */
            struct {
                uint32_t id  : 29; /*!< 11/29-bit CAN ID */
                uint32_t err :  1; /*!< error flag */
                uint32_t rtr :  1; /*!< remote frame flag */
                uint32_t eff :  1; /*!< extended frame format flag */
            };
        };
        union
        {
            uint8_t can_dlc; /*!< data length code, SocketCAN compatible */
            uint8_t dlc;     /*!< data length code */
        };
        uint8_t __pad;   /*!< alignment padding */
        uint8_t __res0;  /*!< reserved */
        uint8_t __res1; /*!< reserved */
        uint8_t data[8] __attribute__((aligned(8))); /*!< CAN frame payload data */
    };

    1. Is my intepretation correct that MSP432E401Y supports a maximum of 32 message buffers for each CAN port which I need to distribute between RX and TX before can_init. So for instance 8 buffers for TX and 24 buffers for RX and not a maximum of 32 buffers for each direction?

    There are 32 mailboxes for each CAN instance. Each mailbox you can configure for either transmit or receive.  You are right, you cannot have 32 buffers for each direction.