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.

TMS570LC4357: How CAN communicates properly with external debugging tools

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

This is  my test code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/** @file HL_sys_main.c
* @brief Application main file
* @date 11-Dec-2018
* @version 04.07.01
*
* This file contains an empty main function,
* which can be used for the application.
*/
/*
* Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello ,

        HALCoGen contains several step-by-step example projects including CAN example.

        They can be located in HALCoGen by going to Help -> Examples, or Help -> Help Topics -> Contents -> Examples.

        There is FAQ for development resource , including CAN example code also.

        [FAQ] TMS570LC4357: Examples and Demos available for Hercules Controllers (E.g. TMS570x, RM57x and RM46x etc) - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

         If you have further concern , please review the user guide linked below.

        2.1. Description — Hercules Safety MCUs Documentation

  • Hello Alice.

          Thank you for your reply.I want to know what configuration I need if I want to communicate with USB_CAN Tool in order to communicate successfully.

           I have tried the baud rate 500K.As in my code above, the USB_CAN tool cannot receive the message sent, and the development board cannot receive the message sent by the USB_CAN tool.The CAN bus mode I configured is normal.There is a CAN transceiver on the development board, the model is SN65HVDA541.

         This is my configuration code:

     

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void canInit(void)
    {
    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    /** @b Initialize @b CAN2: */
    /** - Setup control register
    * - Disable automatic wakeup on bus activity
    * - Local power down mode disabled
    * - Disable DMA request lines
    * - Enable global Interrupt Line 0 and 1
    * - Disable debug mode
    * - Release from software reset
    * - Enable/Disable parity or ECC
    * - Enable/Disable auto bus on timer
    * - Setup message completion before entering debug state
    * - Setup normal operation mode
    * - Request write access to the configuration registers
    * - Setup automatic retransmission of messages
    * - Disable error interrupts
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    and Circuit diagram:

    I have no problem using cases to communicate between CAN1 and CAN2.However, communication with the USB_CAN Tool failed.

    Is it the problem of my configuration of CAN module? How do I configure to properly communicate with USB_CAN Tool?

       Looking forward to your reply.Thanks !

              Alice

  • Hello,

          Unfortunately, We  do not familiar with "USB_CAN Tool" you noted.

         Please use the CAN demo in last reply to test your hardware.

  • thank you very much ,I solved my problem.It's a hardware connection problem