<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SAM7X RL-USB Library not work</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/30328/sam7x-rl-usb-library-not-work</link><description> 
Hi, I&amp;#39;ve made a board to use SAM7X&amp;#39;s USB Port. the board works
correctly with other functions like buttons and LEDs also SAM-BA work
correctly (during test of SAM-BA I found that SAM-BA 2.12 don&amp;#39;t
support USB3 port). now I want to test it&amp;#39;s USB feature</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: SAM7X RL-USB Library not work</title><link>https://community.arm.com/thread/107250?ContentTypeID=1</link><pubDate>Sat, 24 Aug 2013 05:40:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:90dc0150-a14e-4a74-a5b1-f2575277467d</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
I&amp;#39;m not sure, why above code change solves &lt;b&gt;USB enumeration&lt;/b&gt;
problem.&lt;br /&gt;
Abvoe change swaps just LEDs/key switches/joystick ports from the
original to yours.&lt;br /&gt;
The change doesn&amp;#39;t directly concern to USB setup.&lt;br /&gt;
Maybe, one of the original ports causes power failure on your
board.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAM7X RL-USB Library not work</title><link>https://community.arm.com/thread/81401?ContentTypeID=1</link><pubDate>Sat, 24 Aug 2013 04:12:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:82406725-aa0c-41b3-be81-5561bad7287a</guid><dc:creator>R A</dc:creator><description>&lt;p&gt;&lt;p&gt;
I used 18.432MHZ crystal. I think the hardware don&amp;#39;t have problem
because the SAM-BA works correctly, is this true ?&lt;/p&gt;

&lt;p&gt;
with the changes below the problems resolved and PC detected the
board and installed it but finally I used Atmel&amp;#39;s sample and have
problem with keil&amp;#39;s sample yet.&lt;/p&gt;

&lt;pre&gt;
#include &amp;lt;AT91SAM7X256.H&amp;gt;
#include &amp;lt;AT91SAM7X-EK.h&amp;gt;
#include &amp;lt;type.h&amp;gt;
#include &amp;lt;usb.h&amp;gt;
#include &amp;lt;usbcfg.h&amp;gt;
#include &amp;lt;usbhw.h&amp;gt;
#include &amp;lt;demo.h&amp;gt;


AT91S_PIO * pPIO_Led = AT91D_BASE_PIO_LED;  /* Global Pointer to PIO */
AT91S_PIO * pPIO_Sw  = AT91D_BASE_PIO_SW;   /* Global Pointer to PIO */


U8 InReport;                                /* HID Input Report */
                                            /*   Bit0..4: Buttons */
                                            /*   Bit5..7: Reserved */

U8 OutReport;                               /* HID Out Report */
                                            /*   Bit0..3: LEDs */
                                            /*   Bit4..7: Reserved */

/*
 *  Get HID Input Report -&amp;gt; InReport
 */

void GetInReport (void) {
  U32 key;

  key = pPIO_Sw-&amp;gt;PIO_PDSR;                        /* Read Pin Data */
  InReport = 0x00;
  if ((key &amp;amp; AT91B_SW1) == 0) InReport |= 0x01;   /* Check if SW1 is pressed */
  if ((key &amp;amp; AT91B_SW2) == 0) InReport |= 0x02;   /* Check if SW2 is pressed */
  if ((key &amp;amp; AT91B_SW3) == 0) InReport |= 0x04;   /* Check if SW3 is pressed */
  if ((key &amp;amp; AT91B_SW4) == 0) InReport |= 0x08;   /* Check if SW4 is pressed */
  if ((key &amp;amp; AT91B_SW5) == 0) InReport |= 0x10;   /* Check if SW5 is pressed */
}


/*
 *  Set HID Output Report &amp;lt;- OutReport
 */

void SetOutReport (void) {

  if (OutReport &amp;amp; 0x01) pPIO_Led-&amp;gt;PIO_CODR = AT91B_LED1; else pPIO_Led-&amp;gt;PIO_SODR = AT91B_LED1;
  if (OutReport &amp;amp; 0x02) pPIO_Led-&amp;gt;PIO_CODR = AT91B_LED2; else pPIO_Led-&amp;gt;PIO_SODR = AT91B_LED2;
  if (OutReport &amp;amp; 0x04) pPIO_Led-&amp;gt;PIO_CODR = AT91B_LED3; else pPIO_Led-&amp;gt;PIO_SODR = AT91B_LED3;
  if (OutReport &amp;amp; 0x08) pPIO_Led-&amp;gt;PIO_CODR = AT91B_LED4; else pPIO_Led-&amp;gt;PIO_SODR = AT91B_LED4;
}


/* Main Program */

int main (void) {

  /* Enable Clock for PIO */
  AT91C_BASE_PMC-&amp;gt;PMC_PCER = (1 &amp;lt;&amp;lt; AT91C_ID_PIOA);         /* Joystick */
  AT91C_BASE_PMC-&amp;gt;PMC_PCER = (1 &amp;lt;&amp;lt; AT91C_ID_PIOB);         /* LEDs     */

  pPIO_Led-&amp;gt;PIO_PER  = AT91B_LED_MASK;      /* Enable PIO for LED1..4  */
  pPIO_Led-&amp;gt;PIO_OER  = AT91B_LED_MASK;      /* LED1..4 are Outputs     */
  pPIO_Led-&amp;gt;PIO_SODR = AT91B_LED_MASK;      /* Turn off LED&amp;#39;s (&amp;quot;1&amp;quot;)    */

  USB_Init();                               /* USB Initialization */
  USB_Connect(__TRUE);                      /* USB Connect */

  while (1);                                /* Loop forever */
}
&lt;/pre&gt;

&lt;p&gt;
.&lt;/p&gt;

&lt;p&gt;
also added hiduser.c usbcore.c usbdesc.c usbhw_SAM7X.c usbuser.c
to the project and configured usbcfg.h.&lt;/p&gt;

&lt;p&gt;
Thanks,&lt;br /&gt;
Best Regards.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAM7X RL-USB Library not work</title><link>https://community.arm.com/thread/81402?ContentTypeID=1</link><pubDate>Sat, 24 Aug 2013 03:54:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cd43146d-ebab-4c75-8b84-24b00a724444</guid><dc:creator>R A</dc:creator><description>&lt;p&gt;&lt;p&gt;
yes that&amp;#39;s right but I use debug tool to solve problems when the
code don&amp;#39;t have structural problems like headers replacement.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAM7X RL-USB Library not work</title><link>https://community.arm.com/thread/62205?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2013 19:49:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f1fc9e8d-825b-4adf-b997-deb2a5b993d6</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;gt; I&amp;#39;ve made a board to use SAM7X&amp;#39;s USB Port...&lt;br /&gt;
&amp;gt; the windows (7 &amp;amp; 64bit) indicated &amp;quot;USB device not
recognized&amp;quot; error.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Likely, hardware issue.&lt;/p&gt;

&lt;p&gt;
1) Check the connections between MCU USB pins and the USB
connector. DDP --- D+ (3) DDM --- D- (2)&lt;br /&gt;
On custom boards, these connections are often swapped.&lt;/p&gt;

&lt;p&gt;
2) Crystal frequency&lt;br /&gt;
Keil and Atmel examples are tuned for a 18.432MHz crystal on
AT91SAM7X-EK board.&lt;br /&gt;
To apply other frequency, you have to tune the PMC_USBDIV value&lt;/p&gt;

&lt;pre&gt;
SAM7.s

PMC_USBDIV      EQU     (0x03&amp;lt;&amp;lt;28)      ; USB Clock Divider
&lt;/pre&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAM7X RL-USB Library not work</title><link>https://community.arm.com/thread/68332?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2013 09:44:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8137fe72-8229-449b-89ab-ca0c3705b6ad</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Don&amp;#39;t you feel that a crucial step after managing to compile code
without warnings or errors from the compiler is to switch tools and
start debugging? Or you think your part of the problem ends when you
can compile?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>