Embedded Web demo code on AT91SAM7A1

Hi, Your demo code using AT91SAM7X evaluation board is wonderful. Unfortunately, I’m using AT91SAM7A1 chip and SMSC’s Lan9115 MAC chip. I would like to try out your demo program on our board to see how freeRTOS works out. However, apparently, the EMAC driver code needs to be replaced. (Of course, the startup assembly code also need to be replaced.) What does it take to adapt the AT91SAM7X EMAC code so that it will work with SMSC’s Lan9115 chip? (SMSC only provides code for Win CE and Linux. So, there is no code available for CrossStudio.) Thanks for your help.

Embedded Web demo code on AT91SAM7A1

The EMAC driver code is tightly coupled to the EMAC peripheral within the AT91SAM7X chip.  The driver configures the EMAC peripheral, then processes events to pass data into and out from the peripheral – presenting the data to the demo source code.  If you are wanting to use a different NIC then you will require an equivalent driver for your LAN9115 chip.  The driver source code is (hopefully) well commented so you can see what it is doing.  If everything were ideal you would be able to keep the same function prototypes and just change the function implementation to access your LAN9115 registers as necessary rather than the EMAC registers. I have had a quick look on the SMSC WEB site and the following links may provide some useful information: http://www.smsc.com/main/catalog/lan9115.html#Additional%20Information   Right down the bottom of this page is a ‘generic driver’ source code link.  I have not looked at it as I don’t have an SMSC login, but normally this type of driver will do everything you require with a ‘portable’ interface that you have to complete for your particular hardware configuration. Again I have not looked at it but from the title http://ftp.smsc.com/main/anpdf/an1212.pdf appears to give the register information you would require. Also the Linux driver might provide a useful reference but would presumable require a lot of stripping. Which board are you using? Regards.

Embedded Web demo code on AT91SAM7A1

Richard, Thanks for your detailed help. I appreciate it very much. It seems that I don’t have an easy way out but follow your recommendations, which is also what I would do if I have to adapt it myself. The generic code on SMSC web site is pseudo code, I can only use it as a reference. So, I think I just have to create an animal from several different animals, i.e., SMSC pseudo code, SMSC linux code, Atmel EMAC code and SMSC documentations. I’m using a custom board. Thanks again for your help.