This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SAM7X RL-USB Library not work

Hi, I've made a board to use SAM7X'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't support USB3 port). now I want to test it's USB feature but when I compile any example of USB (from atmel's website or other resources) the Keil compiler give errors about headers codes like this error :

Undefined symbol USB_Connect (referred from main.o).
Undefined symbol USB_Init (referred from main.o).

with this errors I searched the help of keil and found migration page and RL-USB library and completely changed my codes to make it compatible with the library. after changing the code with challenges and obviating the errors, program compiled successfully and I programmed it into the chip. but after connecting it to USB port of computer, the windows (7 & 64bit) indicated "USB device not recognized" error.
I think that the hardware don't have problems because the SAM-BA works correctly. what is the problem ? do I need to make any change in pins status other than DDM and DDP ?

#include <RTL.h>
#include <rl_usb.h>
#include <AT91SAM7X256.H>

int main (void) {
  static U8 but_ex;
         U8 but;
         U8 buf[1];

  usbd_init();                          /* USB Device Initialization          */
  usbd_connect(__TRUE);                 /* USB Device Connect                 */

  while (1) {                           /* Loop forever                       */
    but = (((AT91C_BASE_PIOA->PIO_PDSR ^ (0x1F << 21)) >> 21) & 0x1F);
    if (but ^ but_ex) {
      buf[0] = but;
      usbd_hid_get_report_trigger(0, buf, 1);
      but_ex = but;
    }
  };
}

Please help me solve this problem.
Thanks
Best Regards.

Parents
  • > I've made a board to use SAM7X's USB Port...
    > the windows (7 & 64bit) indicated "USB device not recognized" error.

    Likely, hardware issue.

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

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

    SAM7.s
    
    PMC_USBDIV      EQU     (0x03<<28)      ; USB Clock Divider
    

    Tsuneo

Reply
  • > I've made a board to use SAM7X's USB Port...
    > the windows (7 & 64bit) indicated "USB device not recognized" error.

    Likely, hardware issue.

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

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

    SAM7.s
    
    PMC_USBDIV      EQU     (0x03<<28)      ; USB Clock Divider
    

    Tsuneo

Children