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.

Concerto and lwip

Other Parts Discussed in Thread: CONTROLSUITE

Greetings community!

I'm trying to use lwip with concerto.
I've been searching forums for some time now and found information that the last release of the controlSuite would include a concerto lwip example. But so far no luck.
link

As it didn't came out, I start digging through stellaris forums and with my poor c++, CCS and almost inexeting TCP/IP skills made a new project where I included all the files in the list:

Added:

lwipopts.h
locator.c
lwiplib.c
uartstdio.c
ustdlib.c
startup.c

Linked:

driverlib.lib
enet_lwip_ccs.cmd (tried other with no luck, this compiles without erros, from stellaris enet_lwip example)

Included the following folders:

- "${workspace_loc:/z_master_lwip_man/lwip}"
- "C:\TI\controlSUITE\device_support\f28m35x\vBeta1\MWare"
- "C:\TI\controlSUITE\device_support\f28m35x\vBeta1\MWare\third_party"
- "C:\TI\controlSUITE\device_support\f28m35x\vBeta1\MWare\third_party\lwip-1.3.2\src\include"
- "C:\TI\controlSUITE\device_support\f28m35x\vBeta1\MWare\third_party\lwip-1.3.2\src\include\ipv4"
- "C:\TI\controlSUITE\device_support\f28m35x\vBeta1\MWare\third_party\lwip-1.3.2\ports\C2000\include"

After this I made a new source file where I only initiate the board, the GPIO and Ethernet peripherals and one function from lwip, the lwIPInit().

So far I think I'm doing everything ok, right? (with the includes, linked and added files?)

When I compile the code a bunch of errors appear, in the first was something to do with missing and not added/linked necessary files, a lot of unresolved symbols would appear. But now there are errors that I think I can't solve, example:

- Missing files. In ...\controlSUITE\device_support\f28m35x\vBeta1\MWare\third_party\lwip-1.3.2\ports\C2000\sys_arch.c

/* Concerto header files required for this interface driver. */

(...)

#include "driverlib/rom.h"

#include "driverlib/rom_map.h"

(...)

In controlSuite these files don't exist! (can I use the ones from stellaris software?)

-error in functions calls, In ...\controlSUITE\device_support\f28m35x\vBeta1\MWare\third_party\lwip-1.3.2\ports\C2000\netif\concertoif.c

(line 601)

   /* initialize the hardware */
    conertoif_hwinit(netif);  // conertoif? Should be concertoif

Other functions like MAP_IntMasterDisable() or MAP_IntMasterEnable(), they give errors when we compile everything and should be changed to IntMasterEnable and IntMasterDisable.

Still after "correcting" these errors /typos I still get a bunch of errors afterwards (most of them in lwip api, file pbuf.c), one simple error that "'doens't exist' like "expected a ";" in                .../controlSUITE/device_support/f28m35x/vBeta1/MWare/third_party/lwip-1.3.2/src/core     netif.c   line 456

netif.c file:
(...)
454         */
455         void netif_set_down(struct netif *netif)
456         {
457             if ( netif->flags & NETIF_FLAG_UP )
458             {
(...)

With the thought that I might have changed something critical in the software I have reinstalled controlsuite several times, I have 5 folders of lwip on third_party folder (I keep changing names conforming the folder as most of them have a fixe include path for only lwip-1.3.2 folder)

I'm trying to build a data client (or server) that connects to a servers (or client) and sends/receives data. Due to the need of sending big data, lack of knowledge in the area and after reading that uIP 1.0 is worst then lwip regarding throughput, I chose the last one to my project. But it's giving me a hard time to actually do something with it.

PS: all examples compile fine, I'm able to run them all. Including the stellaris example enet_lwip with only one warning in a file system related c file (ff.c).

Can you help me put the lwip api working on concerto?

Thank you for your time.

 

  • In a reply to self (bump me?)

    Along with other work, I've been trying to figure out what is needed to change to put lwip working on the Concerto. My project depends on 4 departments and it’s almost done, only thing that is keeping it from working flawlessly is Ethernet/communication with PC (labview) I successfully implemented UIP 1.0 but with all the limitations and my poor skills on telecommunications and the TCP/UDP protocols I couldn’t achieve more then to send/receive information at 2 to 3 bytes/second! And UIP is limited to 4 connections at the same time?!

    As this communication part is the only one missing in my work, at least to make this Concerto solution a valid one to implement, I would appreciate a little help here, so I return to this forum asking for it :) Is there a way to put lwip working on Concerto? If so, con you point me to some reading and example if possible? (for concerto, not Stellaris)

    I remember that I had many difficulties related to RTOS, as lwip needed on installed, but didn’t used many functions of a RTOS. (only needed the clock?!) I can’t remember.

    Thank you for your time!

  • R,

    Sorry for the delay. Have you downloaded the latest version of controlSUITE?

    We've included the example project enet_lwip. It's a ported version from stellarisware, but all the MAP_ functions have been replaced, along with a few other changes ( like the linker command file).

    Check out the example and let me know if that helps.

    Regards,

    Alvaro

  • Alvaro Prieto

    Thank you for your answer!

    I have updated ControlSuite and only now I see the enet_lwip example! I will work on it for the next days!

    Once angain, thanks for the reply,

    Rui Ventura

  • Did you solve the problem with the enet_lwip project??

    I didn't!

    In that project there is no way to send/reiceve packets towards an host system. It is only to receive an IP using DHCP.

    Could anyone sposting a complete example using an UDP or TCP protocol??

    Thanks

    Andrea

     

  • Hello Andrea Saltari, 

    First of all make sure you have the last ControlSuite installed!

    I was able to build my aplication using the example in enet_lwip project. However I can't communicate using a known server aplication (ex: webserver) as I lack the skills to code the HTTP protocol. To solve this problem, as in my application I just need to send and receive raw data, I had to build a new one, server (Concerto) and client (PC with LabView). This way I know what to send and when to send it.

    I recommend you to read the online help on lwip webpage. Using the lwip functions wisely you will be able to run your send/receive application. I was amassed on how a few code lines solved my problem :) 

    I also recommend you to use thirdparty software to emulate the PC sending and receiving information (search for 'tcp test tool' on the internet).

    Enet_lwip is a webserver (host) so you need to connect a client. In the main() it calls httpd_init(); following that function returns:

    httpd_init(void)
    {
    struct tcp_pcb *pcb;

    LWIP_DEBUGF(HTTPD_DEBUG, ("httpd_init\n"));

    pcb = tcp_new();
    tcp_bind(pcb, IP_ADDR_ANY, 80);
    pcb = tcp_listen(pcb);
    tcp_accept(pcb, http_accept);
    }

    Notice that it listen to port 80, and when a connection is made, it will run http_accept(), passing through the pcb structure, unique to any connection  (dont know the limit for lwip, but for uip was very low, 8?).

    For a basic/simple operation you might not need all of those used in this particular example. For a client application please read the help in the lwip webpage, as for that you have to try and connect until you stablish a communication and not be listening to a port. 

    Hope it helps,

    R. Ventura