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.

TMS320F28377S: CAN driver how to communicate with the mailboxes/message objects

Genius 5910 points

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

I'm trying to use the Driverlib but i come more and more to the conclusion that it is made without any vision how to use it in a real application.

So I'm digging in the documentation and that is not helping me either.

Can someone please give a flow diagram how to get access to a mailbox?

I don't understand/can't find in the documentation how the content switching is done.

 For example:  I like to enable or disable TX  interrupt  for mailbox 16? or check of mailbox 4 has an RX overflow?

Thanks!

  EVS

  • EVS

    Have you looked at the examples in C2000Ware?
    To reconfigure a message object setting, you use CAN_setupMessageObject().
    If want to get specific info regarding the message object control register, you'll have to use the HWREG command to trigger a read from the message object into the IFx register(s). In your development, if you find that the driverlib is lacking, please detail what type of APIs are missing and I can file an enhancement request.

    Best regards
    Chris
  • Chris,

    I spend already a long time programming with Ti products. So I way passed generalities I need details! So how do I switch between mailboxes?

    Changed the setup with CAN_setupMessageObject is a way to general approach. When I change setting not all the information is available at that time. There needs to be a way so read and write flags for individually mailboxes.

     Also There a multiple mailbox for receive messages and only one for sending. why do you need more than one mailbox  for sending? Especially when you have only 32.

    So configure msgID for sending messages needs to be added.

    Other problems:

     I2C adding reading and writing a data sequences. The datasheet is incomplete and the TI expert unable to tell precise (again details) how it is done. So I thinks it helps a lot of people to get I2c to work properly.

     example:

     write sequences:  multiple data bytes in a row.

     read sequences:  first write data wait to get ready and continue with the read sequences.

    And this bothers me more then it should:

        //
        // Check the arguments.
        //

    Are you payed per new line of code? There is no information in this text and the library is littered with it.

    My experiential with updating Ti software to get something changed is not that great.  I'm still waiting to get this compiler issue fixed:  CODEGEN-3927. Manual adding nops in the compiler assembly is not a work around!

    Thanks for the help,

     EVS

  • EVS

    I apologize for any frustration. If you are having issues with I2C, please start separate thread on that.
    I'm not sure I am completely clear on what you mean by "switching between mailboxes". If you mean taking the configuration for message object 1 and moving it to messsage object 2, you'll need to use the HWREG to perform this using the IFx regsiters (refer to the message interface register sets section in the technical reference manual).

    For example, you configure HWREG_BP(CANA_BASE + CAN_O_IF1CMD)=(0x1 | CAN_IF1CMD_DATA_B | CAN_IF1CMD_DATA_A | CAN_IF1CMD_CONTROL|CAN_IF1CMD_ARB|CAN_IF1CMD_MASK) which will read the contents of message obj 1 into the IFx registers and then you run HWREG_BP(CANA_BASE + CAN_O_IF1CMD)=(0x2 | CAN_IF1CMD_DATA_B | CAN_IF1CMD_DATA_A | CAN_IF1CMD_CONTROL|CAN_IF1CMD_ARB|CAN_IF1CMD_MASK|CAN_IF1CMD_DIR) to write those contents to message object 2.

    Any of the 32 message objects can be configured for TX or RX. You may have different DLC or other settings which would then require having another TX message object. That's just one example.

    Best regards
    Chris
  • Chris,

    I understand that you are doing your best to help and you can do nothing about it. But I think the general quality of TI is low and there is no alternative. So in general I'm here to ask my questions without any expectation to get it answered.

    As in the I2C issue I'm at my own to get it solved. Only it takes way to much time to get it solved.

    I solved both:

    I didn't find any info in the documentation how to select a message object/mailbox to for configuration or reading status bit like MsgLst. (message lost, important not supported in driverlib)

    So how is it done:

    Write to message object:

    Check if IF1CMD busy bit  is 0 . If not wait

    Fill registers if needed: IF1MSK, IF1ARB, IF1MCTL, IF1DATA

    Select in IF1CMD the bits in that corresponding the registers you have filled. Which bit corresponding which IF1 register, TI assume you know.

    Last select which message object you want to configure.

    Done:

    Reading a message object:

    Check if IF1CMD busy bit  is 0 . If not wait

    Select in IF1CMD the bits in that corresponding the registers you have want to read. Which bit corresponding which IF1 register, TI assume you know.

    Select the Message object you want to read.

    Check if IF1CMD busy bit  is 0 . If not wait

    Read the selected registers: (IF1MSK, IF1ARB, IF1MCTL, IF1DATA )