I'm starting work on a Netduino Plus 2 libmaple port.
My ultimate goal is to get Arduino-like code (esp. w/support for ENC28J60, SD card, XBEE and also to get the excellent I2C Device Library ported over and running on these targets:
- STM32F4DISCOVERY
- Netduino Plus 2
After poking around the forums and reviewing the different branches, I've decided to start w/the openstm32sw as a base.
Here's what I've encountered so far, if any of the experts have any insight on best practices, please let me know:
1) The USB OTG is not supported in the F2/F4 libmaple branches. I can see why, it's a pretty big change. I'd really like to get CDC working, but DFU would be nice too. I'm thinking of tackling this, but not until 2) is resolved. For what I can tell, ala42 has considered something like this but I haven't found anything concrete yet.
2) In general, the F405 (Netduino Plus 2) and F406 (STM32F4Discovery) have:
- More peripherals. Specifically, there's a USART6 that the Netduino Plus 2 really needs.
- More Interrupt Vectors. Includes USART6, ETH, More DMA 2 Channels, USB OTG and I2C3.
So here's the immediate question on 2). I'm starting to extend the existing STM32F4 (F2) code, changes appear reasonably minimal to get USART6 and the additional interrupt vectors added in. However, my current approach is to add some more kludgy #if defined (BOARD_netduinoplus2) statements while extending usart.h/.c, and nvic.h/.c. Seems like some sort of new symbol (like F405, or F4_DENSITY or something (?) more reasonable) should be used, otherwise we'll have BOARDxxx littered all over the place.
So my primary question here: does anyone have any recommendations for an approach to add USART6 and associated interrupts (and ultimately other details that are F405/F406 specific)?
I'd like to think I'd be following a standard and that would make it easier to potentially merge this into the main libmaple stream. I think the netduinoplus2 hardware support, and also the port of the i2cdevlib (www.i2cdevlib) would be helpful not only to me but others.
Thanks for any input you may have,
Cheers,
- scott