SAM7XDemo Build for Latest Yagarto!

namnum wrote on Tuesday, February 21, 2012:

Good day FreeRTOS forum,

Has any one been successful with compiling a working Yagarto build for the SAM7x lwIP web server project?
I have compiled the source code a few years back on an older Yagarto build, however the later Yagarto compiler needs a syscall addition to the linker addition when compiling. I did add this file and it complies with the latest Yagarto compiler. The project runs, however the web server is unstable.

I’d like to know if someone has been successful with this before I spend more days debugging this.

Best regards,

rbekkers wrote on Tuesday, February 21, 2012:

Hi Warren,

I’m not sure if it will solve the problem but you could give it a try:

I found a bug in the linker script which causes the initialisation of c-variables to fail. It is described here:

I didn’t test it on the demo but when I started with FreeRTOS I had the same experience with the demo. Some tasks are dodgy. Let me know your results. My tasks are running stable now.


namnum wrote on Thursday, February 23, 2012:

Hello Rob,

Thank you for this advice! I followed your post and it fixed the problem of the USB task falling over when I plugged in the Ethernet cable. I’m still having a hassle with the webserver but I should get to the bottom of that a lot quicker now that the stability of the tasks has been resolved.

Did you also add a syscalls file to your project?

Best regards,

rtel wrote on Thursday, February 23, 2012:

The Yagarto site used to have an FAQ on this, as I recall, and even supply a syscalls file for download.  The file is only required to provide stubs of the functions that the linker is looking for (unless you actually make use of them of course).  You may even find a syscalls.c containing these stubs in the FreeRTOS distribution.

Please post any updated/working files to the FreeRTOS interactive site.


rbekkers wrote on Thursday, February 23, 2012:

Hi Warren,

Good to hear the fix at least solved part of the problems. And yes, I added a syscalls.c file to my project. I found a basic version on the internet and modified it until it works with the stdio library in combination with the debug unit of the microcontroller. You can find my modified version here: Not all functions are tested but the read and write function work for standard input and standard output, which is the debug unit. The sbrk functionality also appears to work because FreeRTOS is able to allocate memory. The only thing you need to do is include this code to initialise the uart of the debug unit:

	// Disable PIO control for debug unit RX/TX pins
	/* Initialise the debug unit USART. */
	DBGU_Configure(0x00000800, 9600, 48000000);

You can always change the baud rate and other communication parameters of course.