Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

FreeRTOS


  • Please log in to reply
45 replies to this topic

#21 Illishar

Illishar

    Advanced Member

  • Members
  • PipPipPip
  • 146 posts

Posted 27 January 2011 - 09:16 AM

Casper, I've posted a small native sample here: http://forums.netdui...kingled-native/

#22 Casper

Casper

    New Member

  • Members
  • Pip
  • 6 posts

Posted 27 January 2011 - 05:31 PM

Casper, I've posted a small native sample here: http://forums.netdui...kingled-native/


Thank you! I´m sure a lot of people, including me, find this very useful. :)

#23 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 January 2011 - 05:55 PM

Quick aside...should we make a "FreeRTOS and C/C++ programming" forum?

#24 billy

billy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 28 January 2011 - 06:24 PM

As Illishar tested Nut/OS too, maybe a more general name? "Other RTOS and 3rd parties"?

Quick aside...should we make a "FreeRTOS and C/C++ programming" forum?



#25 teachop

teachop

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 28 January 2011 - 07:07 PM

Quick aside...should we make a "FreeRTOS and C/C++ programming" forum?

Makes sense to me, I agree use a generic name for non .NET applications, and have the FreeRTOS and NUT/OS as sub-categories, I am sure more will follow. Can you move existing FreeRTOS and NUT/OS threads under them to seed the process?

#26 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 28 January 2011 - 07:56 PM

Quick aside...should we make a "FreeRTOS and C/C++ programming" forum?

I thought something like what the original post said would be clever: "Netduino without a .Net"

#27 Illishar

Illishar

    Advanced Member

  • Members
  • PipPipPip
  • 146 posts

Posted 29 January 2011 - 08:18 AM

I thought something like what the original post said would be clever: "Netduino without a .Net"


Heh, yeah. Catchy.

Or perhaps just something (boring but descriptive) like "Native development".

#28 teachop

teachop

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 30 January 2011 - 06:25 PM

FreeRTOS builds fine for the Netduino Plus under Ubuntu Linux as well. The same toolchain, gcc CodeSourcery lite, with eclipse as the IDE (no jtag). Of course SAM-ba is a pain - it works best for me to run it in VirtualBox+XP. Under linux there are a couple case-sensitive edits, only two, to get the first time build to go. If interested, find attached the list of what tweaks got this setup to work on both Vista and Ubuntu.

Attached Files



#29 billy

billy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 31 January 2011 - 07:05 PM

Has anyone tried lwIP 1.3.2 with FreeRTOS, with minor changes, I got it compiled, but neither ping worked, not httpd. Thanks

#30 Illishar

Illishar

    Advanced Member

  • Members
  • PipPipPip
  • 146 posts

Posted 01 February 2011 - 08:12 AM

ottawa, I had the same experience. However, the lwIP sample from the Atmel driver package seems to work fine. Perhaps it would be easy to strip the FreeRTOS and insert the Atmel lwIP instead. ... or perhaps not. Both the lwIP and the uIP samples are rather obscure.

#31 billy

billy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 02 February 2011 - 12:42 PM

Thanks, the tcpip thread stack size macro has been renamed, it is TCPIP_THREAD_STACKSIZE now.
with TCPIP_THREAD_STACKSIZE defined as 600, i can see data coming in from debug console.

BTW, I made some changes in syscalls.c, which is required but absent in the sample. I replaced putchar with xUSBSendByte,
now, all printf output are redirected to USB-CDC output, including lwip debugging information.



ottawa, I had the same experience.

However, the lwIP sample from the Atmel driver package seems to work fine. Perhaps it would be easy to strip the FreeRTOS and insert the Atmel lwIP instead.

... or perhaps not. Both the lwIP and the uIP samples are rather obscure.



#32 Illishar

Illishar

    Advanced Member

  • Members
  • PipPipPip
  • 146 posts

Posted 02 February 2011 - 01:27 PM

Very interesting. Did you also make it support 'connect ethernet after startup'?

#33 billy

billy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 02 February 2011 - 02:55 PM

What do you mean by 'connect ethernet after startup'?

I'm still unable to ping the board running lwip 1.3.2, I added printf("%d", ulLength) to the end of ulEMACInputLength function.
There are some data coming in. But not making any further than that.




Very interesting.

Did you also make it support 'connect ethernet after startup'?



#34 billy

billy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 05 February 2011 - 06:46 AM

ok, lwip 1.2.0 is working, just dump it to your sample folder, copy contrib and ethernetif.c from 1.1.0 folder, make proper makefile change, it will work, no need to make any change.

#35 teachop

teachop

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 06 February 2011 - 12:03 AM

ok, lwip 1.2.0 is working, just dump it to your sample folder, copy contrib and ethernetif.c from 1.1.0 folder,
make proper makefile change, it will work, no need to make any change.

Good deal. I want to try lwip next to compare with uIP, which is working well.

#36 teachop

teachop

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 06 February 2011 - 12:15 AM

Linux host update: SAM-BA for linux is working again with new kernels. There is a new driver called sam-ba.ko - it is in 2.6.38 kernels - I grabbed the alpha of Ubuntu Natty (which is SUPER FULL OF POTHOLES being an alpha). And guess what. Atmel SAM-BA works properly. I don't know what cross-kit they used for the GUI but it looks pretty funny in Ubuntu Gnome. Who cares, it works great. So that means good things ahead. A full toolchain in linux, except there is no debugging. What I used was eclipse + CodeSourcery lite + FreeRTOS + SAM-BA + Netduino Plus. On this thread, above I see other compilers work too. One thing I had to do to get the sam-ba driver to always load was to blacklist cdc-acm, because sometimes it would jump in there and interfere. You don't do any of the usbserial driver dance that is in the readme file any longer.

#37 billy

billy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 11 February 2011 - 07:12 AM

ok, lwip-1.3.0 is working. I traced the source, it is a change on June/08/2007 in lwip. The main problem is that the function signature of ethernetif_output() and etharp_output() were different in lwip-1.1.0 and lwip-1.2.x. They had different parameter order. In lwip-1.3.0, this has been fixed, they share same parameter order. assuming you are using demo\lwIP_Demo_Rowley_ARM7 from FreeRTOS 6.1.1 1. unzip lwip-1.3.0 source to lwIP_Demo_Rowley_ARM7 folder. 2. make proper change to your makefile, some lwip files are renamed, some are moved. the following are minimum lwip files required. LWIP_THUMB_SRC= \ lwip-1.3.0/src/core/init.c \ lwip-1.3.0/src/core/tcp_out.c \ lwip-1.3.0/src/core/ipv4/inet.c \ lwip-1.3.0/src/core/mem.c \ lwip-1.3.0/src/core/memp.c \ lwip-1.3.0/src/core/netif.c \ lwip-1.3.0/src/core/pbuf.c \ lwip-1.3.0/src/core/raw.c \ lwip-1.3.0/src/core/stats.c \ lwip-1.3.0/src/core/sys.c \ lwip-1.3.0/src/core/tcp.c \ lwip-1.3.0/src/core/tcp_in.c \ lwip-1.3.0/src/core/ipv4/ip.c \ lwip-1.3.0/src/core/ipv4/ip_addr.c \ lwip-1.3.0/src/core/ipv4/icmp.c \ lwip-1.3.0/src/core/ipv4/inet_chksum.c \ lwip-1.3.0/src/api/tcpip.c \ lwip-1.3.0/src/api/api_msg.c \ lwip-1.3.0/src/api/err.c \ lwip-1.3.0/src/api/api_lib.c \ lwip-1.3.0/src/api/sockets.c \ lwip-1.3.0/src/api/netbuf.c \ lwip-1.3.0/src/netif/etharp.c \ lwip-1.3.0/contrib/port/FreeRTOS/AT91SAM7X/sys_arch.c \ lwip-1.3.0/src/netif/ethernetif.c \ EMAC/SAM7_EMAC.c \ lwip-1.3.0/src/core/udp.c \ lwip-1.3.0/src/core/ipv4/ip_frag.c 3. find SAM7X_Keil_RVDS_lwIP_1.3_MM.zip from FreeRTOS community.(It's RVDS sample, so I didn't want use the ethernetif.c from it, and I didn't notice in this sample the function parameter order has been fixed until yesterday.) 4. copy contrib folder to your lwip-1.3.0, it is better. 5. make proper change to other files, mainly, solve #define errors. 6. if you take step 4 and 5, you will also need define TCPIP_THREAD_STACKSIZE as 600 in lwipopts.h file 7. MEMP_NUM_API_MSG and MEMP_NUM_TCPIP_MSG are deprecated, removed them from lwipopts.h, DHCP_DOES_ARP_CHECK also need to be set to 0 or removed from this file. 8. check my previous posts in this thread, make proper change to the LED task etc. 9. make, I think that's it. tested with the latest gnuarm toolchain with optimization level 2, httpd and ping are working.....

#38 Illishar

Illishar

    Advanced Member

  • Members
  • PipPipPip
  • 146 posts

Posted 11 February 2011 - 12:06 PM

Cool

#39 teachop

teachop

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 12 February 2011 - 08:56 PM

ok, lwip-1.3.0 is working.

Rats, I didn't pull this off after an afternoon of head banging. I have undefined references to _exit _kill and _getpid so must be library issues, or need to add stuff to syscalls.c to fill the gaps. Also something about ethernetif_init that I have not gotten to.

#40 billy

billy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 13 February 2011 - 09:00 PM

haha, depends on your toolchain, if you are using newer, such as the latest yagarto or similar, you will need define
the _exit, _kill and _getpid, at least as dummies, the newlib library in thoes newer toolchain require them from your
target system.

I didn't have any problem with ethernetif_init, last night, I moved on to lwip 1.3.2, also works.
well, now my little board is working with the lastest FreeRTOS and lwip stable release.

Let me know if you need more info.

Rats, I didn't pull this off after an afternoon of head banging. I have undefined references to _exit _kill and _getpid so must be library issues, or need to add stuff to syscalls.c to fill the gaps. Also something about ethernetif_init that I have not gotten to.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.