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

suggested fix #25

Open
uliano opened this issue Jan 30, 2023 · 3 comments
Open

suggested fix #25

uliano opened this issue Jan 30, 2023 · 3 comments

Comments

@uliano
Copy link

uliano commented Jan 30, 2023

the last line of clock_init

while ((RCC->CFGR & 12) == 0) spin(1); // Wait until done

should probably be:

while ((RCC->CFGR & 12) != 8) spin(1);

@cpq
Copy link
Owner

cpq commented Jan 30, 2023

@uliano thank you.

Apparently in this context, both ways achieve the same.
Current approach: "wait until the clock is set to something that is not the default (HSI)"
Your suggestion: "wait until the clock is set to PLL"

Your suggestion is more precise, though.

@uliano
Copy link
Author

uliano commented Jan 30, 2023

@cpq Hi Sergey,

thanks for coming back. Yes I was meaning exactly that, it is a “fix” for something that’s already working :-D!

But many more thanks for the effort you put in your tutorial, it provided me a "way out” from AVRs the only MCU I was able to program bare metal (and design hardware too).

In a couple of days I ported your code (without the web server, for sure) to a blackpill F411 and I learned a lot!

My next endeavor will be irq on serial monitor or maybe even exploiting the USB connector of the board

@cpq
Copy link
Owner

cpq commented Jan 30, 2023

@uliano awesome, that's great to hear.

You might want to check out this: https://github.com/cesanta/mongoose/tree/master/examples/stm32/nucleo-f429zi-usb-rndis

This is a bare metal firmware for F429. I think it'll work on 411. Just clone mongoose repo, cd examples/stm32/nucleo-f429zi-usb-rndis && make flash
Maybe the clock settings would need tweaking... But I expect the peripherals (GPIO & UART) be the same.

It should make your F411 to look like an Ethernet connected device (ethernet-over-USB)
It uses our Mongoose Library of course.
With that approach, you can talk to your F411 over a usual browser / REST API.

It uses an awesome TInyUSB library, which is worth checking out

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