uip demo for gcc: status, emac isr woes

nobody wrote on Wednesday, April 26, 2006:

Examine how the uIP demo uses the semaphore.  Each is initialised at some point and used correctly.

rtel wrote on Wednesday, April 26, 2006:

There are three variables, which are all different, but are configured during the initialisation.  The code you sent over had some of the initialisation missing due to the combination of the IAR and GCC builds.

The IAR build contains the THUMB and ARM code in the same file, so xSemaphore is defined in this file and used by the demo http server task also.

The GCC build contains the THUMB and ARM code in separate files.  This means the semaphore is also needed in the ARM source file.  You had declared the variable again in that file but never set it.  The GCC initialisation routine has an extra step which passes a valid value for the variable into the ARM source file.  I have added this in the zip file I just emailed to you.

The variables are kept separate as the EMAC driver is generic, and in this demo used by the http server file.  To keep the driver generic no assumption can be made as to how the http server is going to use the driver and therefore a global variable should not be used (and for other reasons).

Regards.

imajeff wrote on Friday, April 28, 2006:

I think initialized sempahore means
vSemaphoreCreateBinary( xSemaphore );

must be called before it’s used. Certainly `xSemaphore = NULL’ would un-initialize it instead.