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

bad examples #166

Open
karlp opened this issue Jan 16, 2018 · 6 comments
Open

bad examples #166

karlp opened this issue Jan 16, 2018 · 6 comments

Comments

@karlp
Copy link
Member

karlp commented Jan 16, 2018

https://github.com/libopencm3/libopencm3-examples/blob/master/examples/stm32/f1/stm32-h103/exti_rising_falling/exti_rising_falling.c

does not mention the AFIO requirements if you happen to want to change to another port for the EXTI

That's wrong, exti_select_source() sets the SYSCFG or the AFIO registers depending on target. original reported bug was misidagnosed.

examples/stm32/f1/other/usb_hid/usbhid.c and lots of others copied there use HSI for USB on F1, which is really not supported, even though it sometimes works. Should replace them all with hse8_72, and usb div 1.5 to show the "right" way of doing it

@karlp
Copy link
Member Author

karlp commented Aug 18, 2019

@ChuckM
Copy link
Contributor

ChuckM commented Aug 19, 2019

adc.c: In function 'clock_setup':
adc.c:135:23: error: 'rcc_hsi_8mhz' undeclared (first use in this function); did you mean 'rcc_osc_off'?
  rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_64MHZ]);
                       ^~~~~~~~~~~~
                       rcc_osc_off
adc.c:135:23: note: each undeclared identifier is reported only once for each function it appears in
adc.c:135:36: error: 'RCC_CLOCK_64MHZ' undeclared (first use in this function); did you mean 'RCC_CLOCK_HSI_64MHZ'?
  rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_64MHZ]);
                                    ^~~~~~~~~~~~~~~
                                    RCC_CLOCK_HSI_64MHZ
../../../../rules.mk:201: recipe for target 'adc.o' failed
make[1]: *** [adc.o] Error 1
Makefile:71: recipe for target 'examples/stm32/f3/stm32f3-discovery/adc/' failed
make: *** [examples/stm32/f3/stm32f3-discovery/adc/] Error 2

Fails to build

@karlp
Copy link
Member Author

karlp commented Aug 19, 2019

Works with current code as is in repo? had you updated the library ahead or something? (Also, that's just straight up breakage. this ticket is more for examples that might work, but aren't good examples to copy)

@karlp
Copy link
Member Author

karlp commented Aug 19, 2019

I also pulled the library to latest and it still builds fine, are you sure you're looking at latest code?

@ChuckM
Copy link
Contributor

ChuckM commented Aug 19, 2019

Ok, I remoted the libopencm3 library to upstream, fetched it and pulled master on the sub module to latest. That got rid of that build error but still has a warning about flash_erase_page() on usbdfu_getstatus_complete about fallthrough of the case statement.

And I submitted a PR with a fix for the msleep issue in tick_blink

@karlp
Copy link
Member Author

karlp commented Aug 20, 2019

yeah, the fallthrough warnings are a different matter. In one case we even had a comment saying, "fall through" but it was't the style that gcc recognized :)

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