EmbeddedRelated.com
Forums

FreeRTOS with AT91SAM7x512

Started by bhavintailor_ec May 29, 2009
I am using YAGARTO Tool to compile my project based on AT91SAM7X512. I have developed one project without RTOS. Its code size become higher than 265K and ram size around 64K. It works Ok. Now, i want to add TCP/IP. So, that i first make working webserver on my hardware. The TCP/IP Stack which i have used is for AT91SAM7X256. So, i modified every where with AT91SAM7X512 header file with its flash and ram size. The stack which i have used is based on uIP with FreeRTOS. Currently this webserver is working ok. This stack size around 80K. Now, as i mearge this STACK (based on FreeRTOS) with my previous developed project, it stop working after total code size become higher than 265K. I am just adding code. I m not calling any function. As i remove some functions code and as code size less than 264K then it works ok but as it reach limit of 265K, webserver code stop working. I think this problem is created either by STARTUP File or some makefile command which limit code to AT91SAM7X256 flash size. So, How can i remove this problem ?
For refrence i have added below code of boot.s, atmel-rom.ld & Makefile.





I see you have updated the linker script to be correct for the part with the
larger memory. I don't think there should be any other changes necessary,
so if the rest of the code is the same (startup file, makefile, etc.) then
you should be ok, but evidently no.

How are you programming the flash? Are you using a bootloader or remapping
the vector table?

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.
I am programming the AT91SAM7x512 using SAM-BA 2.6. After programming the flash I program "BOOT FROM FLASH (GPNVM2)" by click on EXECUTE Command Button. I think SAM-BA don't have problem. Because my main project size is around 267K. Which is ARM Mode base execution. I can run this thing without any problem. Now, my purpose is to merge TCP/IP stack (based on FreeRTOS) with my code. So, after merging both code it will reach 267K + 80K > 265K. Because in FreeRTOS base as my code size increase after 265K it stop working.
And other problem I m facing with web server. I have modified uIP stack to run with ENC28J60. In original stack it is using on chip Ethernet module. But in my hardware I don't have sufficient i/o so that I have used ENC28J60. In original stack, in uip-conf.h file there is
#define UIP_CONF_BUFFER_SIZE 1480
for size of long buffer. I need to change this to start webserver. If I don't change this size then I can ping my hardware but I cant run webpage. To, make working web server I have to do
#define UIP_CONF_BUFFER_SIZE 65600

This is actually RAM wasting. But without this I am not able to run webpage. I don't think that in run time this much large buffer size required. Because in run time around 10 to 20 COMPUTER will be connected with my hardware through LAN or INTERNET. So, by increasing buffer size I can run my webpage. But I need to solve this thing because it is consuming RAM which will not require at run time.
> #define UIP_CONF_BUFFER_SIZE 1480
> for size of long buffer. I need to change this to start
> webserver. If I don't change this size then I can ping my
> hardware but I cant run webpage. To, make working web server
> I have to do
> #define UIP_CONF_BUFFER_SIZE 65600
>

I don't know why you would want to do that - anything above the Ethernet
frame size will not be used anyway. From the uIP documentation:

/**
* The size of the uIP packet buffer.
*
* The uIP packet buffer should not be smaller than 60 bytes, and does
* not need to be larger than 1500 bytes. Lower size results in lower
* TCP throughput, larger size results in higher TCP throughput.
*
* \hideinitializer
*/

Regards,
Richard.

+ http://www.FreeRTOS.org
Now includes an Atmel SAM3 Cortex M3 demo!
>
> /**
> * The size of the uIP packet buffer.
> *
> * The uIP packet buffer should not be smaller than 60 bytes, and does
> * not need to be larger than 1500 bytes. Lower size results in lower
> * TCP throughput, larger size results in higher TCP throughput.
> *
> * \hideinitializer
> */
>
> Regards,
> Richard.
>
> + http://www.FreeRTOS.org
> Now includes an Atmel SAM3 Cortex M3 demo!
>
I dont like to increase the size of buffer. But if i dont do this than i can not run my webpage on PC. If i dont increase the size of buffer then i can only ping hardware with given IP ADDRESS. I have just changes in stack to work with ENC28J60. So, how can i solve to make working webserver with minimum buffer size. Is it related to ENC28J60. To configure ENC28J60, i have used one ready made code. This code is based on uIP with LPC controller without any RTOS. So, instead of LPC Controller SFR, i have put AT91SAM7x512 SFR to communicate with ENC28J60 through SPI Module. I try to debug using WinSHARK to capture TCP/IP data. With 1480 buffer size in hardware, i found that as request send to hardware through Internet Explorer for webpage then through ARP Protocol it first find IP address OK. Then in webpage request through TCP Protocol, hardware send [ACK,RST] flag. After that it is not procedding further. Currently my webserver is working ok but with buffer of 65K RAM. And getting [ACK,RST] flag in response with 1480 buffer RAM. So, how can i solve this ?
And what could be the reason that after 265K of code size with FreeRTOS, it stop running. If code size is less then 265K then it works ok but as it cross this limit then code is not showing any result on hardware.