Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB MSC not compiled into libopencm3_stm32f0.a #927

Closed
soerenbnoergaard opened this issue Jun 5, 2018 · 1 comment
Closed

USB MSC not compiled into libopencm3_stm32f0.a #927

soerenbnoergaard opened this issue Jun 5, 2018 · 1 comment

Comments

@soerenbnoergaard
Copy link

soerenbnoergaard commented Jun 5, 2018

I get an undefined reference to usb_msc_init() when trying to modify the following example for an stm32f042f6p6:

https://github.com/libopencm3/libopencm3-examples/tree/master/examples/stm32/f4/stm32f4-discovery/usb_msc

My example is basically the same as above, using the ramdisk-files and descriptors. I have reduced FILEDATA_SECTOR_COUNT to 1).

And running strings libopencm3_stm32f0.a | grep msc confirms that no USB MSC is compiled into the library.

Simply adding usb_msc.o as shown below seems to fix it, and my example compiles.

diff --git a/lib/stm32/f0/Makefile b/lib/stm32/f0/Makefile
index ca93a220..b176f428 100644
--- a/lib/stm32/f0/Makefile
+++ b/lib/stm32/f0/Makefile
@@ -51,7 +51,7 @@ OBJS          += usart_common_all.o usart_common_v2.o
 OBJS           += i2c_common_v2.o
 OBJS           += spi_common_all.o spi_common_v2.o
 
-OBJS           += usb.o usb_control.o usb_standard.o
+OBJS           += usb.o usb_control.o usb_standard.o usb_msc.o
 OBJS           += st_usbfs_core.o st_usbfs_v2.o

Best,
Søren

@karlp
Copy link
Member

karlp commented Jun 7, 2018

fixed in bc70d3b thanks! (Added it to all the other families that were missing it too)

@karlp karlp closed this as completed Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants