AnsweredAssumed Answered

STM32 USB endpoint configuration (clarification questions)

Question asked by Dominik on Oct 6, 2011
Latest reply on Oct 19, 2011 by Dominik

I started to modify the CustomHID example of the ST USB Lib V3.3 to get it running on my Olimex STM32-P103 evaluation board. I want to use this firmware to start developing a PC controlled board without the need to install an extra driver on a PC (no admin rights). I am stuck at the USB endpoint buffer configuration in usb_conf.h. I hope someone of you could give me a little explanation.

#define BTABLE_ADDRESS      (0x00)
#define ENDP0_RXADDR        (0x18)
#define ENDP0_TXADDR        (0x58)

#define ENDP1_TXADDR        (0x100)
#define ENDP1_RXADDR        (0x104)

So my questions regarding these defines:
Is BTABLE_ADDRESS the start address of the PMA buffer (packet memory area) which is dedicated to USB? If so, is there any good reason not to start with address 0x00?
Why is EP0RX starting at 0x18 and not at BTABLE_ADDRESS? Is the space needed for some data (which one?) and how is the address of 0x18 calculated?
In the file usb_prop.c EP0Rx is configured with a buffer size of 64 bytes (Function SetEPRxCount(ENDP0, Device_Property.MaxPacketSize); ) so the EP0Tx has to start at 0x58.
Why is the EP1Tx bufferspace starting at 0x100 and not at 0x98?
CustomHID_Reset does call SetEPRxCount and configures EP0Rx but not Tx, is it also configured?

Edit: I have an additional question. Where in the USB examples files are the USB data lines configured? I couldn't find any file with initialisation of PA11 and PA12 pin as alternate function pins.