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.

Hercules TMS570lc4357 FreeRTOS+TCP port available for testing.

Other Parts Discussed in Thread: LAUNCHXL2-570LC43, HALCOGEN, TMDX570LC43HDK

Hi,

Initial release of FreeRTOS+TCP demo project for Hercules LAUNCHXL2-570LC43 LaunchPad is available for testing at  "loszi.hu/.../ti_launchpad_freertos_demo" based on modified HALCoGen 04.04.00.

Features:

FreeRTOS+IO package:
- Serial CLI: 230400 baud, 8N1 on USB JTAG interface.
- commands: see "emacstat" for ip configuration.
FreeRTOS+TCP package:
- DHCP and NTP client, ICMP ping
- HTTP server: http://hercules/freertos.html
- FTP server: ftp://hercules/
FreeRTOS+FAT package:
- 200 KB RAM disk

It logs every minute the OnChip temperature data into /ram/logfile.txt accessible over command line interface or via ftp.

Please note: it is NOT for production, it is just for testing, use your own risk!

comments are welcome.

Best Regards: Szilárd

UPDATE (2017.04.24)

Hi Guys,

the demo projects are updated on both platform with the latest FreeRTOS+Labs (160919) and contains networkintercace.c (v0.4) with fix for memory leak and CPU overusage at starting without connected ethernet cable.

Regards, Szilárd

  • HI Szilard,
    Thanks for sharing such a demo project for our community. I'm certain it will benefit many people.
  • Hi,
    The FreeRTOS+TCP demo project also available for TMDX570LC43HDK devboard.

    loszi.hu/.../

    with similar features, like:

    FreeRTOS+IO package:
    - Serial CLI: 230400 baud, 8N1 on USB JTAG interface.
    - commands: see "emacstat" for ip configuration.
    FreeRTOS+TCP package:
    - DHCP and NTP client, ICMP ping
    - HTTP server: http://hercules/freertos.html
    - FTP server: ftp://hercules/
    FreeRTOS+FAT package:
    - 8MB RAM disk, "memtest" command for testing external sdram memory.

    It logs every minute the OnBoard light sensor data into /ram/logfile.txt accessible over command line interface or via ftp.

    comments are welcome.

    Best Regards: Szilárd
  • Hi,
    The new, improved version of Hercules FreeRTOS+TCP port is available for Launchpad.

    loszi.hu/.../LaunchPad_FreeRTOS_v03.zip

    The TX speed significantly higher (actually it can do the theoretical limit 94.9 Mbit/sec on TCP or 8127 packet/sec with maximum packet size).
    On RX side nothing important has happened. It can do about 92-93 Mbit/sec TCP. The CPU Load is quite high in this situation, ~80% @ 300MHz, but there is lot of room for increasing efficiency - I'm working on it.

    The previous version (v0.2) was running on my desktop for over more than 40 days connected to the corporate network - so it looks like reliable enough.

    Best Regards, Szilárd


     

  • I've tested it on a Hercules TMS570LC43x LaunchPad and it works fine
    When pinging the board, it nicely runs prvProcessICMPPacket() and replies.

    Just checking: what is the correct setting for the FreeRTOS logging? I tried with 115200 8 1 N . I seem to be unable to get reliable communication up.
  • (answering my own question :) )
    I saw you mention the settings in the first post and it works:
    Serial CLI: 230400 baud, 8N1 on USB JTAG interface
  • I do not have this version of Hercules, could you tell me that could make changes in order to run the code example for a version of hercules RM57.

    Best Regards
    Martin Valencia
  • excellent that you would, could pinging your video on the test this code here, so that other people can see how the example!

    Regards
    Martin Valencia
  • Hi Martin,
    Unfortunately, I have no Hercules RM57Lx LaunchPad Dev Kit. I think the two device are basically same, so I would try to change the device at project -> properties -> general -> Device and see if it works.
    Thank you Guys for spending time with testing.
    Regards, Szilárd
  • Team, I have an RM57. I'll try.
    It is possible that I have to create a new empty HALCoGen project for the RM57, import Szilárd's DIL file in that and regenerate the code.
    I'll first check with a simple device change in CCS only...
  • It doesn't work just like that.
    I first tried to select the right controller and change from big to little endian.
    All compiles and gets in exception as soon as the first freertos call is made.
    Trying to regenerate sources with HALCoGen hasn't worked for me yet... Compile errors...

  • And you need to be careful on the import DIL file step across different parts.
    In particular the pinmux may not like this. It depends on if the pinmux is different
    between the two devices.

    The DIL seems to store pinmux 'line # in GUI' as the key - not pinmux register address.

    So if an RM has USB for example it may have extra pinmux lines in the DIL file and this throws them all off when you import to a 570. I would use a merge tool and do all the pinmux stuff manually after the fact through the HalCoGen GUI .. [dont' merge in the pinmux data but the rest of the data]. That may get you closer.
  • I will check that out. I can confirm that I have at least two incompatibilities in pinmux c code if I do a raw 'naive' import of all settings including the PINMUX values.

    I also have compilations errors in the freertos part. I'll have to do some digging to find that out...
    (in the original project, portCONFIGURE_TIMER_FOR_RUN_TIME_STATS is undefined, when I generate fresh code in HALCogen, this symbol is defined and causes errors)
  • Hi Jan!,
    It wouldn't work that way. As I wrote, the project based on modified HALCoGen. At the begining I tried to maintain the compatibility with HALCoGen, but later
    unfortunately I had to realize that ithe emac interface was quite incomplete. So I forked to my version and made lot of modification includes  FreeRTOS update and some bugfix related to emac interface. If I got permission form Texas, I could share the modified HALCoGen source.

    Maybe Anthony could help us with this permission, or he could pass this post for the right person? I don't know.

    Regards, Szilárd

  • I'm rather grateful to you for sharing your work with us.

    am interested in this type of work for the Hercules, it just seems a setting more systems that address, so I'm facing some limits, hopefully with some help of my good friends (Anthony and Jan hehe), I managed to get my goal.

    Regards from Peru

    Martin Valencia
  • Hi Szilard, I'm a newbie working with ethernet for the first time. I currently have the TMS570LC43x and i have it connected via ethernet to the router, which is also connected to my computer. I've loaded the Free RTOS code onto the TI but the red error light goes off once it loads on. I also cant seem to access the http server, or even see it on my routers client list,

    Please advise

    Thanks
  • Hi Dean,
    What kind of devboard do you have?

    Regards, Szilárd

  • I have the launchpad TMS570LC43x
  • Is the user led2 blinking?

  • yes it is blinking. Ethernet green is solid and yellow is flashing. and the red ERR led is on
  • Hi Dean,
    Ok, the leds behavior looks good. Could you open a terminal emulator and connect to the demo board over serial (check the right serial port number in windows device manager) The settings are: 230400 baud, 8n1. The demo project has a command line interface, you can check the ethernet/tcpip settings with the "emacstat" command. You can see if the demo board has ip address, or least having ETH communication (RX,TX packets).
    Regards, Szilárd
  • Hi Szilard,

    I don't know how to do that. I checked the device manager, under ports I see two USB DEBUG X110. I checked both, one is ADP and the other is UART. both are set to 9600 baud rate, the other settings look good. And the baud rate from the drop down menu for both only goes upto 128000.

    Thanks
  • Hi Dean,

    Ok, no problem. For connecting to the board you have to use a "terminal emulator" program. I prefer using tera term "ttssh2.osdn.jp/index.html.en" , but CCS also have an integrated one (view->other->terminal->terminal). Open the XDS110 UART serial port with 230400,8n1 and try to hit ENTER. The attached picture shows the command line interface and the output of emacstat command.

    Regards, Szilárd

  • Hi Szilard thanks a lot, I got it going and can now see an IP address and ping it!

    My next question is I have a project where I'm trying to get an input as a string over ethernet TCP and then use those values in my c code. What setup do I need to do to my Halcogen code to include the correct drivers?

    I'm thinking all I'll need are to enable the SC1 driver and the EMAC driver, and can you advise what other tabs I would need to modify? and what I'd need to modify in the SC1 and EMAC tabs?

    Thanks
  • Hi Dean,

    I'm happy to read that board works already.

    Actually the demo project is based on a modified HALCoGen 04.04.00.

    Unfortunately I got no permission from TI sharing this forked HALCoGen.So it is not so easy to reconfigure the hardware/software yet - sorry.

    For your other question: you can receive a string over UDP by FreeRTOS_recvfrom() function.

    There is a FreeRTOS+TCP reference: "www.freertos.org/.../FreeRTOS_TCP_API_Functions.html"
    Because FreeRTOS+TCP implements the widely used Berkeley sockets API you can found lot of useful information on it.

    Regards, Szilárd

  • Hi Szilard,

    I see, so right now I have a project on code composer that sends out a bunch of pulses. I used HET IDE to create the pulses and then only enabled the NHET1 driver in halcogen. Can I just add the FreeRTOS-TCP to this?

    I dont think my program is RTOS (Not sure) is there something different I would need to do in order to make my program compatible?

    Thanks

  • Hi,
    >> Can I just add the FreeRTOS-TCP to this?
    I'm afraid it would be a more complex task. Actually it would be possible to copy the HET related generated file from the NHET project to the demo project, but you have to deal with the signal directions and the clock configuration. I think it would be better to start with small steps. Is it the only way for generating pulses? Using nHET can be challenging - mainly in the first time.
    The tick time is 1ms you can generate 500 Hz signal by switching a gpio on/off maybe it would be enough..
    Regards, Szilárd
  • Hi Szilard,

    What licensing trouble are you having w. HalCoGen and forking it into your own project? The HalCoGen output files should all be released with a TI BSD license which is intentionally done so that they can be included in any project including open source so if we missed something please let us know.
  • Dean,

    Your N2HET program doesn't depend at all on RTOS v.s. no RTOS.

    I haven't looked at Szilard's FreeRTOS+TCP but if it has HalCoGen .HCG that can be regenerated, then all you need to do is
    to change the HET configuration to load your own HET program instead of the default one.

    Basically the same change you made from the 'default' HalCoGen project to the project you are runnign w. your pulse program.
    Just do it again on the HET Tab in the FreeRTOS project.

    Then, you just need to create a FreeRTOS task and move your HET code from your standalone project main() to inside that task.

    It'll take a little bit of work in the RTOS to figure out how to trigger that task from the TCP message but that's the beauty of the RTOS it has structures like semaphores and queues that you can use to link up the two tasks, so your HET task could just initialize HET then pend (or sleep) until it gets activated by a message from the TCP stack. This part you'd need to figure out.
    So maybe start by just integrating the HET into the FreeRTOS and triggering it periodically like every second to make sure it's working.

    -Anthony
  • We have to be careful with regenerating from HALCoGen for this example, because not at all times the /*user code */ blocks are used.
    Some parts of the example's code will have to be re-applied after a regenerate. The difficult part is finding out where those blocks are.
  • Thats what I did. I basically enabled the NHET1 driver and included my het files the same way. I'm just trying to strip the ADC stuff right now. But even while keeping everything the same and just deleting the ADC related stuff i get an error : #10010 errors encountered during linking; "Pulses_Ethernet.out" not built Pulses_Ethernet.

    Not sure what that is.

    And yes Jan Cumps. When I enabled Het driver and re-generated the code I got pinball R4 and so on undefined errors. not really sure whats going on there either
  • Dean Stark82 said:
    ADC related stuff i get an error : #10010 errors encountered during linking; "Pulses_Ethernet.out" not built Pulses_Ethernet.

    Dean there should be additional information about the error.

  • After regenerating the code I get 66 compile errors. Szilárd explained in one of his first comments here why he had to step away from only writing code in the HALCoGen /*USER CODE xx */ blocks.

  • I fixed the no built error, I missed a line. And the code compiled but as soon as I go into halcogen and disable ADC and enable HET and re-generate the code, I start getting a bunch of errors in the HL_ADC file. Since I'm not using ADC I just deleted the file completely, resolved some errors, but I still have errors in HL_Pinmux and the following error:

    #35 #error directive: If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base. FreeRTOS.h /Pulses_Ethernet/include line 655 C/C++ Problem
  • Hi Anthony,
    The HALCoGen creates source files covered by TI BSD like licence - so the modification of this files are permitted.
    But what about with the HALCoGen itself? I actually forked the HALCoGen. Could you ask somebody about this?
    If you guys say that its OK, I will be glad to share it.

    Regards, Szilárd
  • Hi Szilard,

    So maybe I need to understand better what you did exactly.. Did you just modify the device.xml and add a *.cnf file for your 'new device type' and then add a drivers folder for it?

    We don't actually provide the sources to the HalCoGen GUI engine so I don't think you rebuilt that did you?
  • Hi Anthony,
    the changes are limited to the "drivers" directory.
    Regards, Szilárd
  • Hi Szilard,

    It might be cleaner to have an independent folder under 'drivers' just for your contribution and then make a small patch or two to the top level config files so that this shows up in the list of new project types. Needs some thought ...
  • Hi,

    the demo projects are updated on both platform with the latest FreeRTOS+Labs (160919) and contains networkinterface.c (v0.4) with fix for memory leak and CPU overusage at starting without connected ethernet cable.

    Regards, Szilárd