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.

CCS/TMS320F28075: Simulink Support Package CAN remote frame transmit

Part Number: TMS320F28075


Tool/software: Code Composer Studio

I have an application which I have been developing for some time using Matlab 2018b (and previous versions) and the TI C2000 SImulink support package.

I now have the requirement to transmit a remote frame from the F28075. I added a CAN Pack and eCAN Transmit block  (like I've done many times before) but this time I selected the "Remote Frame" check box in the CAN Pack block, and set the DLC to 1 (as required in this application). The module transmits the CAN frame with DLC=1, however it isn't a remote frame (RTR bit is not set) and it is sending one data byte (which should not be present in a remote frame.)

It appears the F28075 isn't setting the RTR  bit and is sending one data byte even though I have the remote frame checked.

Any thoughts on why this might be?

Thanks,

Don

  • I've reached out to MathWorks to alert them to your post. You may also want to consider contacting them directly though:

    https://www.mathworks.com/support/contact_us.html

    Whitney

  • Hi Don,

    Please contact MathWorks Tech Support and open a ticket for this one; they don't monitor these TI forums. I'm not sure, but this *feels* to me like a potential bug - so we may need a copy of your model to investigate / replicate the behavior. MW Tech Support may be able to provide a workaround for you, and they can escalate this issue to the development team. 

    Sorry I don't have any firm answers for you, I've never tried the Remote Frame stuff.

    Cheers,

    -Brian

  • Brian,

    Thanks for the direction. I opened Case # 03744431 on the Mathworks support site.

    Don

  • This is an un-implemented feature in the software, per the reply below from Mathworks,

    Don

    Mathworks reply:

    Unfortunately this is a limitation in our software. Although the CAN pack block is able to generate the necessary data to mark the given CAN message as Remote Frame, the same information is not used by the C2000 CAN Tx block.

    The C2000 CAN Tx block treats the CAN message from CAN pack block as another Tx frame and not as Remote frame. The reason being the CAN Tx block does not have the intelligence builtin to parse the Remote bit.

     
    56        GIIMD_CANOpenNMTTestR0_B.CANPack.ID = 1794U;
    57        GIIMD_CANOpenNMTTestR0_B.CANPack.Length = 1U;
    58        GIIMD_CANOpenNMTTestR0_B.CANPack.Extended = 0U;
    59        GIIMD_CANOpenNMTTestR0_B.CANPack.Remote = 1;
    60        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[0] = 0;
    61        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[1] = 0;
    62        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[2] = 0;
    63        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[3] = 0;
    64        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[4] = 0;
    65        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[5] = 0;
    66        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[6] = 0;
    67        GIIMD_CANOpenNMTTestR0_B.CANPack.Data[7] = 0;


    Line 59 from CAN pack block sets the Remote bit. But the CAN Tx block is not looking out for this bit as shown below.

     
    95        /* S-Function (c280xcanxmt): '<S1>/eCAN Transmit' */
    96        {
    97          tCANMsgObject sTXCANMessage;
    98          sTXCANMessage.ui32MsgLen = GIIMD_CANOpenNMTTestR0_B.CANPack.Length;// size of message
    99          sTXCANMessage.pucMsgData = (unsigned char*)
    100            GIIMD_CANOpenNMTTestR0_B.CANPack.Data;
    101          sTXCANMessage.ui32MsgID = GIIMD_CANOpenNMTTestR0_B.CANPack.ID;// CAN message ID - use 1
    102          sTXCANMessage.ui32MsgIDMask = 0; // no mask needed for TX
    103          sTXCANMessage.ui32Flags = MSG_OBJ_NO_FLAGS;
    104          CANMessageSet(CANA_BASE, 18, &sTXCANMessage, MSG_OBJ_TYPE_TX);
    105    
        }

    Line 104 then configures the message object as Tx rather than Tx_Remote.

    I have conveyed this information to the development team and they may consider this as an enhancement in a future release.

  • Don, thanks for sharing the info from MathWorks.

    Whitney