Push request: NiosII port and LwIP demo app

dipswitch wrote on Wednesday, January 11, 2012:

Good morning,

I’m almost done integrating LwIP v1.4.0 in FreeRTOS v7.1.0 in the Nios II IDE. I would like to share the demo app and port update. Would it be possible that this source is included in the repository so it will be released with feature releases?

Updated in the Nios II port:
Fixed bug report:
- Nios II port bug when using -O3 or -Os - ID: 3037968
- It’s now possible to keep interrupts enabled while the scheduler has not been started yet. (So now it’s possible to print output via USART before the OS is started for example…)
- The FreeRTOS tick handler is called via the timer hook provided by the Nios II HAL library.

Further more I made an install script which installs the FreeRTOS and LwIP packages into the Altera Nios II IDE (tested for version 11.0 and up, although v9.0 and v10.0 are probably also supported) So FreeRTOS  can be chosen as Board Support Package (BSP) and LwIP can be chosen as software package when an FreeRTOS BSP is chosen.
There will also be installed a FreeRTOS + LwIP demo package. This demo consists of a default FreeRTOS demo and the LwIP stack running a TCP echo server and an HTTP server which displays the currently running FreeRTOS tasks.

rtel wrote on Wednesday, January 11, 2012:

Sounds great.  Please upload your code, with a few words, to the FreeRTOS Interactive site.  There is an Altera forum there already.  I have included a link below for your convenience:



dipswitch wrote on Thursday, January 12, 2012:

Cool create a new topic with the port and the Demo!



rtel wrote on Thursday, January 12, 2012:

On behalf of the FreeRTOS community - Thank you for your contribution!


helarsen wrote on Wednesday, March 07, 2012:

Great work! In order to get the installer to work on one of two win7/64 machines however I had to modify the file alt-freertos-lwip-do-install.sh. The problem is related to POSIX file access rights in. When using cp, POSIX rights are copied. They are apparently not set to u+rw in the distribution.

I did two changes. Changed all distribution code to u+rw like this

echo "    - Silently setting rw POSIX access on the distribution files to avoid access troubles…";

chmod -Rf u+rw FreeRTOS_src
chmod -Rf u+rw freertos_demo
chmod -Rf u+rw nios2_freertos_port
chmod -Rf u+rw altera_nios2
chmod -Rf u+rw freertos
chmod -Rf u+rw lwip

and where the code is copied to the altera directory I added the -f option (force) to the cp command (4 locations):

# now lets copy our stuff to the altera directory
echo -n "    - FreeRTOS..: ";
if cp -rf "${INST_PATH}/freertos" "${COMPONENTS}"; then
	echo "Success";
	echo "Failed with error code: $?";

I dont know how to attach the suggested file. Teach me if you would like a copy. But again great job on this NIOS port.

david-beck wrote on Friday, September 07, 2012:

I’m attempting to create the sof file that this demo relies on. 

The Altera TSE Megacore function can be configured (in Qsys or SOPC Builder) for one of several core variations: “10/100Mb Small MAC”, “10/100/1000Mb Ethernet MAC”, “1000Mb Small MAC”, and “10/100/1000Mb Ethernet MAC with 1000BASE-X/SGMII-PCS”. 

Does it matter which core configuration is used, and if it does, which ones are acceptable?

anonymous wrote on Friday, February 08, 2013:

@ david-beck, any would suffice I think, I only tested it with the “10/100/1000Mb Ethernet MAC” and the “1000BASE-X/SGMII-PCS”
@helarsen thanks for your feed back. I’ll update the install file and push the new version to github. I also updated LwIP to 1.4.1 and applied some bug fixes.

Sorry for the late answer, haven’t really worked on the project for quite some time.