EmbDev.net

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


von Mh T. (lpc2103)


Rate this post
useful
not useful
Hi,
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?)

Regards

von Andy K. (andykunz)


Rate this post
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
at91sam7x256.h.

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:

   *AT91C_RSTC_RCR=0xA500000F

Andy

von Mh T. (lpc2103)


Rate this post
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)

Regards

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.