I have an (old?) TMS570LS20216 USB stick and HALCoGen V03.05.02 and CCS v5.4.0.
I have been testing several basic features using and extending the provided examples.
For CAN, the example configures one CAN message for TX and sends it once with "HERCULES" as data. On the other end I am using a PC with a proven USB-CAN interface.
I tried to extend this example as follows:
- Send the message (message 0x101, TX, DLC=8) several times with updated values
- Define more CAN messages for TX and send all of them
Well, unfortunately I stumbled upon a lot of issues that (imho) suggest that HALCoGen is not generating the correct code for the TMS570LS20216:
Issue#1 I have configured DCAN1 (not DCAN2) in HALCoGen and canInit() in can.c initializes both DCAN1 and DCAN3 !!. This is strange since the TMS570LS20216 has no DCAN3.
Issue#2 The resulting configuration produces spurious messages. For the single message case: DCAN1 enabled, message id:1, DLC=8, data "HERCULES". My main() code is basically:
I have verified with the debugger that the first of the two spurious messages is sent by canInit() itself ?!?
If I try to send the same message several times with different values:
I get :
Again you can see for each intended message there is a previous spurious message with old data.
Issue#3 When defining several messages the configuration somehow overwrites some of them.
For this case I have configured 3 TX messages for DCAN1: