Forum: ARM programming with GCC/GNU tools FreeRtos/lwIP Demo: What CPU resources used up?

Author: Mh Tay (lpc2103)
Posted on:

Rate this post
0 useful
not useful
What are the AT91SAM7X CPU Resources/peripherals used
on the Rowley FreeRtos/lwIP port demo? Is it that only:
- Ethernet MAC on the AT91SAM7X
- USB (Used as virtual port for data dumping only)
- One Timer for FreeRtos Kernel (I still do not know which)
- Few I/O port pins for switches and LED

The following CPU resources/peripherals are not used,
right? (min resources I need for my application)
- All three serial ports
- 2 Timers (out of the total three)
- 1 to 2 Kbytes of SRAM
- About 64KB of Flash Code Space

My Application:
- Need Ethernet/WebServer
- Need some TCP/IP Communication
- Need Some Code Space+RAM
- Need The Serial Ports
- Need Timers (Interval Timer, ~0.1 to 1mS)
- Need WDT (Not turn on by FreeRtos now?)


Author: Andy Kunz (andykunz)
Posted on:

Rate this post
0 useful
not useful
Use a search function (grep) to identify the items which are not used.
Basically, just search for the control register (<peripheralname>_CR)
for the peripheral you wish to use.  The names are found in

I believe you are correct in your lists.

I have not had success with WDT yet under FreeRTOS/lwIP either.  The
problem is that it is disabled by default in CSTARTUP_SAM7.C and you are
only able to write once to the register to configure it.  But if you
configure it, and it takes too long to start up (which it may do,
especially if no Ethernet cable is attached), it will trip.

I have for the short term implemented a software WDT.  One software
countdown timer that is reset by application, decremented by isr.  If
the isr counts down to 0, it issues a reset manually:



Author: Mh Tay (lpc2103)
Posted on:

Rate this post
0 useful
not useful
Hi,  Thanks for the info.

For WDT:  I tried turn it on and used maximum timeout
of ~16 Seconds.  It looks working OK.  Looks like always
can get the ethernet portion initialised.
- WDT feeding done in FreeRtos kernel TickHook function
  (I'm still not familiar with FreeRtos task creating/switching,
  so keeping it inside TickHook is easier)
- Still have not get a WDT timeout/reset (with or without the
  ethernet cable)
- Patched the http WebServer "Get" section to test disabling the
  watch dog feeding.  WDT looks working fine => it bites... :)
- Will need to modify the WDT feeding code in TickHook to monitor
  some semaphore (Another level of software WDT feeding) once I
  get to know the FreeRtos later.

I'm new to this AT91SAM7X+FreeRtos+lwIP.  Busy trying
to fix few other weird problems now.
- The AT91SAM7X-EK with the FreeRtos/lwIP demo could hang up
  after a while (LED no longer blinking).  I do not know
  what is happening.
- If I add some initialising code (e.g. I2C eeprom) taking up
  slightly longer time (Before the EMAC etc is initialized), the
  ethernet could not get connected properly.
- Ethernet Not working if I move Task Switching time interval to
  about 2KHz.  Demo is running at 1KHz
- Too short/long hardware reset pulse (RC value) also cause the
  ethernet not to connect properly..

Once, I could get the above problems rectified, I will then need
to add in an SNTP protocol.  Hope you could help me with some
questions then (How to handle those socket and call back
under FreeRtos+lwIP and etc)



Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.