2012-10-19 04:18 AM
I'm developing some software for multiple STM32 devices. One of the features it needs is a USB Virtual COM port.
I've developed a version that works with USB VCP on the STM32F103 using this library:stm32_usb-fs-device_lib.zipAnd I expected that I could recompile it for STM32F4 devices (such as the F4 Discovery board) with a relatively minor set of changes. But it seems not?It looks like I have to rewrite with the completely different library:stm32_f105-07_f2_f4_usb-host-device_lib.zipIs this the case, or is there a single library that presents a single API for using any USB-capable STM32 part as a simple USB device? (without the OTG support) #stm32f103-vcp #stm32-usb-vcom-library-f1-f42012-10-19 08:32 AM
Doesn't the 103 have a different USB hw implementation to all the other parts? Including the 105/107? The 103 is an orphan in this regard, I don't see a unification of the library at this juncture.
You could try asking third party stack vendors.2012-10-19 08:39 AM
possibly an interesting project.
I have, on several occasions, been tasked with ''unification of code''. you put a b8nch of 'if's' and 'elses' into the code where the processors diverge and after much sweat and a few ''debugging horrors'' end up with code that works everywhere. Erik2012-10-19 08:49 AM
Thanks for the quick response...
So the STMF103 and STML1XX parts are pretty much on their own then as far as USB goes.Do we know if all new devices are going to use the USB OTG Library mentioned above? is that likely to remain stable?2012-10-19 08:53 AM
possibly an interesting project.
Or a very tedious one. I think you'd need to find a common abstraction point, and separate the work the library is doing from the functionality you want to add. For a VCP this might be done with some ring buffers. I just don't expect a cadres of ST coding ninjas to show up and fix it for free. Adjust your expectations accordingly.2012-10-20 01:18 AM
> you'd need to find a common abstraction point
Keil has already done it for their RL-USB library I believe you'll take more or less similar interface as Keil's. MDK-ARM provides these source files for device-specific implementation. Lite/evaluation versions ( http://www.keil.com/download/product/ ) also have these files. STM32F103 C:\Keil\ARM\Boards\Keil\MCBSTM32\RL\USB\Device\HID\usbd_STM32F103.c OTG-FS on STM32F4 C:\Keil\ARM\Boards\Keil\MCBSTM32F400\RL\USB\Device\HID\usbd_STM32F4xx_FS.c OTG-HS on STM32F4 C:\Keil\ARM\Boards\Keil\MCBSTM32F400\RL\USB\Device\HID\usbd_STM32F4xx_HS.c Take a loop on these files. Tsuneo2012-10-22 04:55 AM
ST coding ninjas ? Looking at their USB stack and the way the periph lib is written :
2015-03-25 01:06 AM