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.

LAUNCHXL-F2800157: Analyzing Error Handling During Firmware Updates via DCAN Flash Programmer Utility on F2800157

Part Number: LAUNCHXL-F2800157
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello TI Community,

We are testing the reliability of firmware flashing using the DCAN Flash Programmer Utility on the F2800157 LaunchPad and would like to better understand how CAN behaves at a low level during this process.

Setup Overview:

  • Target: LaunchPad F2800157
  • CAN Interface: PCAN USB Pro (dual-channel)
  • Programming Tool: dcan_flash_programmer utility, C2000Ware
  • Flash kernel: DCAN flash kernel
  • Monitoring: PCAN-View on a second channel (listen-only mode)

Objective:
We want to understand how the bootloader reacts to communication errors like bit flips, missing ACKs, or CRC errors so we can make the update process more reliable for production.

Challenges Encountered:
While monitoring the CAN bus during updates, we observe only application-level payloads (e.g., Rx 2 AA 08, Rx 2 C0 7A, etc.), which match the flash kernel and the application firmware content. However, we are unable to observe:

  • CAN ACK bits or error frames
  • Retransmission attempts
  • Any protocol-level error handling

We Seek Clarification On:

  1. Are there diagnostic features or tools that offer better visibility into the update process at the protocol level?
  2. How can we simulate or observe communication errors during updates? 
  3. What is the bootloader’s response to a corrupted CAN frame? Specifically:

    1. Are checksums or validation methods used?

  4. For production setups in electrically noisy environments, what additional error-handling measures should we consider beyond those implemented in the standard utility?

To avoid issues during production updates, we are looking for ways to improve how errors are handled. Any suggestions would be very helpful.

Thank you in advance for your support.

Best regards,
Taif Shamsi

  • Hi Taif,

    On the CAN protocol test that you are doing are you deliberately injecting errors to the CAN frames sent to LAUNCH-F2800157 while running the DCAN flash kernel?  How is the error injection done?  Have you tried checking our application note on CAN error injection? 

    SPRACQ3 (Configurable Error Generator for Controller Area Network) describes how DCAN frame is generated and how error is injection can be configured in any section of the CAN frame.  One of the methods that this is accomplished is through bit manipulation with GPIO upon locating the desired bit position where error is injected.  Error can be injected (bit flip) in the arbitration, control, payload and CRC section. It can also generate CAN frames without bit stuffing.  The GPIO method is the most straightforward one and this can be done with another launchpad with a GPIO that would directly drive the CAN frame in the LAUNCH-F2800157 under test or using the LAUNCH-F2800157 itself in loopback mode to receive the modified CAN frame with injected errors.

    The DCAN in all of the C2000 devices have register CAN_ES (CAN error status register) and contains the field LEC (Last Error Code).  Inspecting this register content after error injection would report the error which can be in the form of stuff, form, ACK, bit1, bit0 or CRC.  A corresponding error increments the error counter and CAN protocol will take action when the error threshold is met.  This is also described in the application note and how the injected errors affect the LEC status depending on the error injected.  Tis conforms with the CAN protocol error handling.

    As far as retransmission goes CAN protocol will automatically re transmit frames that have lost arbitration or have been disturbed  by errors or have not received any ACK.  This is true as long as automatic retransmission is not disabled by setting the DAR bit in CAN control register.  By default automatic retransmission is enabled.

    Lastly, CAN communication is very robust in that it is tolerant to electrical noise the fact that it uses differential bus lines (CANL/CANH) that cancel out common mode noise.  It also checks for data integrity that uses the built in CRC (15-bit polynomial) routine in the CAN protocol and automatically calculated and added as part of the transmitted frame.  CAN protocol also automatically introduces stuff bits wherein it adds a bit that is opposite the state of the last bit where there are at least 5 consecutive bits of the same state to ensure that there is continuity in the transmitted frame.

    To ensure proper CAN bus operation, the CAN nodes need to be terminated with a 120-ohm impedance to minimize reflection.  CAN is also sensitive to timing so ensure that the CAN clock source is stable (see app notes SPRAC35 for bit timing and tolerances as well as app note SPRACE5 under Debug Checklist for Physical Layer Issues and Hardware debug tips).

    Best regards,

    Joseph

  • Hi Joseph,

    Thank you very much for your detailed explanation. It was very helpful.

    Just to confirm:

    Am I right in understanding that tools like PCAN-View do not show low-level protocol details such as ACK bits, retransmission attempts, or error frames? Are these events only visible through internal registers like CAN_ES (especially the LEC field) or indirectly through repeated messages?

    Also, are there any diagnostic tools you would recommend that can provide more visibility into these low-level protocol events?

    Thank you again for your support.

    Best regards,
    Taif

  • Hi Taif,

    For the PEAK CAN or the oscilloscopes with CAN capability that I'm using, I'm not aware that these have the ability to show the low-level details of the CAN protocol.  This is the reason that we developed the configurable error generator to check how our C2000 MCUs report the frame errors.  I presume that there probably are CAN diagnostic tools out there from third parties but have not had the chance to work with any tool.

    Best regards,

    Joseph