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.

TMDXRM46HDK: RM46x HDK - unable to configure CAN1 using BTR register for different baud rates

Part Number: TMDXRM46HDK
Other Parts Discussed in Thread: HALCOGEN

I am seeking to confirm the ability to configure DCAN port 1 to several different baud rates.  I have been attempting to use HalCoGen to determine the correct values for BTR.

It has not been as successful as I hoped.

Can someone direct me to the correct value (and reason for the values) for 125kb, 250 kb and 500kb

  • I have possibly found (just by experimenting with various values) functional settings.  Just because they work for me, does not mean they are the optimal values.  I would like to hear from others if you know the preferred setup values for BTR.

  • The values I have obtained by experimenting are not the same as those generated by HalCoGen, so I doubt the HDK is actually running at the documented clock speed for the CAN.

    Also, can anyone say where to find the ISR support in the 9.0 FreeRTOS sample code. I might want to set breakpoints to see certain values.
  • Hi Neil,

    Unfortunately, I do not understand the issue that you have presented. You stated you are unable to generate the values for the BTR register for specific CAN baud rates. You then stated that you have used Halcogen to generate them which are not the same as those generated by hand. I believe you have stated that the manually generated values seem to be working. Have you confirmed that the HalCoGen generated values are working as well or that they are not working?

    You also state that you have doubts that the HDK is operating at the documented clock speed for CAN. Have you been able to see the CAN communications and measure the pulse widths in order to determine the cycle timing and thus the frequency/bit timing?

    In regard to the ISR support in FreeRTOS v.9.0, I don't have experience with FreeRTOS so I can't anser or provide useful information for this question. Do you know if this is the same between version 9 and the version supported by Halcogen? If so, I can pull in our SW team to help with this part of your question.
  • Thank You for your reply.

    When I use HalCoGen to create BTR setting values, the RM46x HDK does not operate the CAN port in a compatible manner with other CAN devices in my test setup at the expected baud rate. I am not saying HalCoGen is wrong.
    Using a scope and other tools, I was able to find BTR setting values for baud rates that I am interested in evaluating.

    I am currently hoping to see some non-extended can frames arrive. My Simma SDK code samples appear to allow extended J1939 frames to arrive. Do you have any suggestions in setting that up? Where would I adjust "arbitration" or other values?
  • Update: I do not think the ISR functions are setup correctly, so that might explain why I am failing to see frames arrive on the CANBUS. Does anyone know a good reference or quick guide to look over?
  • Neil,

    Are you using the HalCoGen drivers? It should have fairly straight forward CAN send and receive function interfaces. In regard to your comment previously about extended CAN frames, do you mean the extended CAN IDs? This is described in the TRM and also is configurable in HalCoGen, I believe.

    For your question about adjusting the arbitration and other values, arbitration is established by the CAN2.0B spec/standard. If I recall correctly, it is based on the CAN ID but I don't recall if lower values or higher ones have the higher priority. What other values are you referring to?
  • Thank You for replying.

    This project is using the FreeRTOS 9.0 example demo for RM48 on CCS. That was pretty easily adjusted to download and run on the RM46 HDK.

    We added the Simma SDK for CAN and J1939. Based on the appearance of the J1939 Address Claim on USB CAN logging/recording tools (and seeing break points in the Address Claim logic being hit), I initially thought the Simma SDK was accepting frames. As of today, I do not think my example was actually accepting frames. I will continue to try to get this code base to accept both extended and non-extended frames. I think the original question about BTR settings is covered, but I would be interested in knowing what expected settings for clocks and VCLKs there are for the RM46 HDK on CAN1.

    I think HalCoGen is clear of any problem or fault.
  • I did locate a thread which might explain why I saw this behavior. The theory being that some HDK have a minor malfunction which prevents CAN from clocking on VCLK as expected.

    e2e.ti.com/.../1931744
  • Hi Neil,

    A couple of points about the thread you pointed to.

    First, the board referenced is a Launchpad and not an HDK.

    Second, the described behavior was not reproduced at TI and doesn't make since from a HW perspective. i.e., if you do a fault analysis of this type of issue, it does not track to a HW issue if there are no other issues present with VCLK driven IP such as ADC, ECLK output, other communication baud rates, etc. Since VCLK is our peripheral clock and would lead to catastrophic chip issues if it were faulty or incorrectly set the isolated CAN issue seems unlikely to be related to a VCLK issue. The last post asked the customer to verify ECLK output to see if it, in fact, could confirm the clock misbehavior but there is no response after that.