libopencm3-examples icon indicating copy to clipboard operation
libopencm3-examples copied to clipboard

Add examples for ST Nucleo-F303RE

Open jbm9 opened this issue 8 years ago • 4 comments

This adds some basic examples for the STM ST Nucleo-F303RE devboard. This is a model of F3 chip that doesn't have examples here yet, so there's a new st-nucleo-f303re.ld file to allow using the full memory out-of-the-box.

ST moved a lot of stuff around on the dev board between Discovery and Nucleo, so blinking LEDs that are "together" requires many (ugly and grumpy-making) pin changes. This sort of thing made it impractical to try and merge the changes down into the stm32f3-discovery directory.

I've run it through 'make stylecheck'; there are a few places it complains, but "fixing" them would either make the code not compile or markedly less legible.

Thanks in advance for any feedback on this PR. I tried to read through a bunch of PRs and find the usual sticking points before submitting, but I may have missed things. Sorry if there's an obvious problem that I overlooked, and thanks for taking the time to gatekeep for this library!\

jbm9 avatar Mar 08 '16 07:03 jbm9

I'm not super keen on adding usart and adc examples for every example of all the nucleos, those don't change between the disco and these boards. I do appreciate the use of a working out of box experience for each board, though, for things like a miniblink to test your toolchain and working environment. fwiw, I'm quite likely to leave off more examples for the short term, until probably merging the "devices.data" pull https://github.com/libopencm3/libopencm3/pull/614 lands in the library, then converting the examples repo to use that style.

karlp avatar Mar 08 '16 09:03 karlp

Ah, I didn't see PR613 (admittedly, I didn't look too hard at that level), but it seems promising. Once that's landed and settles, it would be helpful if there was a HACKING file in the examples directory that referred back to the main HACKING file, and also called out a specific known-good example board to template other work off of, as well as what sorts of examples are most appropriate. Literally half of my time on this PR was spent figuring out local conventions and norms; having that in one place would be handy.

I'd be happy to just land miniblink and the adc-uart example (which I can rename). I think there should be one USART example, though, simply because the ST-provided documentation for those pins is not super-helpful.

The others I can take or leave; I like having fancyblink because it gives a quick example of the less-trivial GPIO manipulation APIs, but can take it or leave it. The separate USART example mostly exists because it took me a while to figure out what the heck was up with the serial pins on the arduino/morpheo headers (the solder bridges are poorly documented), so it's not a big deal to cut it loose.

I'll make those changes when I get a chance (tonight hopefully), and follow up further.

jbm9 avatar Mar 08 '16 20:03 jbm9

Agreed on the style and conventions, the -examples repo grew a bit out of control, and has too many poorly tested variations.

Agreed that there should be a usart example, no question there :)

Don't rush on getting anything reworked, the examples are a bit further down my plate at the moment, unfortunately.

karlp avatar Mar 09 '16 09:03 karlp

the miniblink at least has landed in https://github.com/libopencm3/libopencm3-miniblink/blob/master/boards.stm32.mk#L98

karlp avatar Aug 29 '18 14:08 karlp