# USB issue on Atmel AT91SAM7X-EK boards

**URL:** <https://forums.freertos.org/t/usb-issue-on-atmel-at91sam7x-ek-boards/202>\
**Category:** Kernel\
**Created:** [July 2, 2009, 7:57pm UTC](https://forums.freertos.org/t/usb-issue-on-atmel-at91sam7x-ek-boards/202 "2009-07-02T19:57:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 2, 2009, 7:57pm UTC](https://forums.freertos.org/t/usb-issue-on-atmel-at91sam7x-ek-boards/202/1 "2009-07-02T19:57:27Z")

</div>

**[dharper08](https://sourceforge.net/u/dharper08/)** wrote on [Thursday, July 02, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/0e7ee2a7/#6d38):

I just stumbled across a problem using the FreeRTOS USB task (from the lwIP\_Demo\_Rowley\_ARM7 demo) on the AT91SAM7X-EK board and thought I would share it with anyone else in a similar situation.&nbsp;

I have been using this board to get familiar with FreeRTOS, lwIP and a number of other things before I design a custom board for my final application.&nbsp; I had previously completed an Eclipse project that had an AT45DB642D task (this is the dataflash on the AT91SAM7X-EK board).&nbsp; The task performed a series of tests on the dataflash and displayed the results on a web browser using lwIP.&nbsp; The next step in the roadmap was to add USB as this will be a great way to initially configure my custom board.&nbsp; Using the above demo as a guide, I added the USB to my new project but it didn’t work.&nbsp; I finally tracked the problem down to the USB-CDC.c code which manipulates PA16.&nbsp; The comments in the code indicated that this controlled the USB pullup resistor, but looking at the schematics for the AT91SAM7X-EK showed that PA16 was used for SPI0\_MISO which is connected to the dataflash device.&nbsp; It appears that the AT91SAM7X-EK doesn’t have the ability to control the pullup resistor as this is an integral part of the STMicroelectronics USBUF02W6 part.&nbsp; I commented out all of the PA16 related lines in the code and everything started working.&nbsp; Wondering how this could have happened, I decided to take a look at the Atmel AT91SAM7S-EK schematics (the version of the board WITHOUT Ethernet).&nbsp; Sure enough, this board doesn’t have dataflash but it does have the ability to control the USB pullup with - you guessed it - PA16.&nbsp;

The latest versions of board.h from the Atmel at91lib distribution check for a #define of the chip type to pull in the appropriate \*.h chip definition file.&nbsp; This definition could also be used within the USB-CDC.c code to either enable or ignore the use of PA16.&nbsp;

Regards,  
Dave

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 3, 2009, 6:38am UTC](https://forums.freertos.org/t/usb-issue-on-atmel-at91sam7x-ek-boards/202/2 "2009-07-03T06:38:23Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, July 03, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/0e7ee2a7/#6d38/82ab):

Thanks for the feedback.&nbsp; You are right of course, the ‘x’ board is a bit of a pain when developing USB because of its inability to turn in on an off.&nbsp; Note that the drivers in the demo are just that, a demo, and not intended to be a fully compliant example.

Regards.
