I have a custom made board based on STM32F207. I am examining ChibiOS as a possible platform and am very satisfied with the results until now. I have a working Serial driver, ICU and SDIO driver with fatfs for SD card handling. Next step would be to utilize the serial over USB driver for OTG_FS, but I have no success here. First I've tried to adapt the STM32F4 USB_CDC testhal code, but I had a building problem in stm32f2xx.h where the definition of the RCC_AHB2RSTR_OTGFSRST was missing. I have seen that you had a fix here recently (I use the trunk of the git repository now), but I could not get the point in that. I have temporarily changed it like this:
Code: Select all
#define RCC_AHB1RSTR_DMA1RST ((uint32_t)0x00200000)
#define RCC_AHB1RSTR_DMA2RST ((uint32_t)0x00400000)
#define RCC_AHB1RSTR_ETHMACRST ((uint32_t)0x02000000)
-#define RCC_AHB1RSTR_OTGHRST ((uint32_t)0x10000000)
+#define RCC_AHB1RSTR_OTGHSRST ((uint32_t)0x10000000)
/******************** Bit definition for RCC_AHB2RSTR register **************/
#define RCC_AHB2RSTR_DCMIRST ((uint32_t)0x00000001)
#define RCC_AHB2RSTR_CRYPRST ((uint32_t)0x00000010)
#define RCC_AHB2RSTR_HSAHRST ((uint32_t)0x00000020)
#define RCC_AHB2RSTR_RNGRST ((uint32_t)0x00000040)
-/* CHIBIOS FIX *
-/*#define RCC_AHB1RSTR_OTGHRST ((uint32_t)0x10000000)*/
-#define RCC_AHB1RSTR_OTGHSRST ((uint32_t)0x10000000)
+#define RCC_AHB2RSTR_OTGFSRST ((uint32_t)0x00000080)
After this it compiles, but my host linux cannot attach the device, I have the following messages with dmesg:
[96431.565905] usb 1-1.3: device not accepting address 55, error -110
[96431.566142] hub 1-1:1.0: unable to enumerate USB device on port 3
I assume that probably I have a hardware related problem here:
I have only the DM and DP pins of the USB connector connected, nor ID and VBUS. As far as I have seen in the OTGv1 driver it uses forced peripheral mode, so the ID pin does not matter, but I have not found the NOVBUSSENS bit definition in there. I am affraid, this is needed for operation without VBUS connected (the PA9 PIN is used for a different function), and also I don't exactly know if I have to trigger somehow the start of the communication instead of VBUS...
Do you have any experience with USB_CDC on F2? Do you plan to support NOVBUSSENS in the near future?
Thanks,
Csaba