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/TMS570LC4357: Problem integrating lwIP and CAN communication

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN,

Tool/software: Code Composer Studio

Hello,

I have recently used the lwIP demo provided to send some data over udp to a pc, the end goal of this is to send data received on CAN over udp. I have modified in Halcogen everything so that CAN communication should work. I have done this using a previous project where CAN communication works, however, in this project, with lwIP, CAN does not work. I have tried to find some difference between the two projects, I even made the same alterations in Halcogen to the working CAN communication project as the lwIP demo, and the previous project works, adn the lwIP project still fails to send / receive CAN messages.

I have even checked the control register of the can module of the 2 projects and they are the same, the halcogen project for the two is the same. There is clearly something in the lwIP demo or files that somehow disables can communication, but I cannot figure it out.

Has anybody had the same problem? Does anybody know of anything in the lwIP demo that can interfere with CAN communication?

Thank you.

  • I added all of the lwip files to the project with the working CAN communication, I do not use any of the lwip functions, just placed the lwip files in the project directory and added the include paths just like the ones in the lwip example. And now, the can communication has stopped on the working project as well. It is clear to me that something is being changed in the files of the lwip, and somehow stops can communication alltogether.

    Hopefully I will find it soon.
  • I finally found the problem. Hopefully this would be helpful if others find themselves in the same situation as me :)

    The halcogen implementation of the lwIP demo sets in the file HL_sys_common.h two defines :

    #ifndef __little_endian__
    #define __little_endian__ 1

    #endif
    #ifndef __LITTLE_ENDIAN__
    #define __LITTLE_ENDIAN__ 1

    #endif

    As it can be seen, these are set to 1. But, the tms570lc4357, as far as I know, is big endian. So, changing these defines to a 0 solves the problem, and now both can communication and the lwip library work together.

  • Thanks Adrian for updating. I could not find those two lines in HL_sys_common.h file.