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.
yes that's right but I use debug tool to solve problems when the code don't have structural problems like headers replacement.