[deprecated]First release of STM32F4 core

The official STMicroelectronics Arduino core
fpiSTM
Posts: 177
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: First release of STM32F4 core

Post by fpiSTM » Thu Apr 06, 2017 7:43 am

arcnor wrote:Thanks for that, it worked great!

However, I have a (very beginner) question: How do I use the serial console with this? There is no serial port being created or detected when I connect the board (I upload using the STLink, and that seems to work fine), so the Arduino IDE fails when trying to use the serial port.

I'd also like to use the USB for MIDI, but I saw that USB says "not tested" (and also not sure if the Arduino USBMIDI stuff will be included) so I'll guess I'll need to be patient :).

Thanks again!
For F407, as I said it seems required some hw stuff to have the Serial. See the user manual of the F4 disco. For USB, there is only a HID support available that I've not tested.
I do not know USBMidi from Arduino.

edogaldo
Posts: 255
Joined: Fri Jun 03, 2016 8:19 am

Re: First release of STM32F4 core

Post by edogaldo » Thu Apr 06, 2017 8:08 am

Sorry @fpiSTM, what is USART3_E?
The pins mapping seems not match with F407's USART3, does it?

Sorry, I double checked the pins mapping and found it: USART3_E = USART3..

fpiSTM
Posts: 177
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: First release of STM32F4 core

Post by fpiSTM » Thu Apr 06, 2017 8:27 am

edogaldo wrote:Sorry @fpiSTM, what is USART3_E?
The pins mapping seems not match with F407's USART3, does it?
I do not manage this part but USART3_E is an enum used by uart.c to link with U(s)ART3.
Moreover, based on PeripheralPins:
const PinMap PinMap_UART_TX[]:
{PD8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
const PinMap PinMap_UART_RX[]:
{PD9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
In uart.c

static uart_conf_t g_uart_config[NB_UART_MANAGED] = {
//USART3 (PD8/PD9)
{
//UART ID and IRQ
.usart_typedef = USART3, .irqtype = USART3_IRQn,
//tx pin configuration
.tx_port = GPIOD, .tx_pin = {GPIO_PIN_8, GPIO_MODE_AF_PP, GPIO_NOPULL, GPIO_SPEED_FREQ_HIGH, GPIO_AF7_USART3},
//rx pin configuration
.rx_port = GPIOD, .rx_pin = {GPIO_PIN_9, GPIO_MODE_AF_PP, GPIO_NOPULL, GPIO_SPEED_FREQ_HIGH, GPIO_AF7_USART3},
//uart clock init
.uart_clock_init = usart3_clock_enable,
//uart force reset
.uart_force_reset = usart3_force_reset,
//uart release reset
.uart_release_reset = usart3_release_reset,
//TX gpio clock init
.gpio_tx_clock_init = gpiod_clock_enable,
//RX gpio clock init
.gpio_rx_clock_init = gpiod_clock_enable,
.data_available = 0,
.begin = 0,
.end = 0,
.uart_option = NATIVE_UART_E
},
So pinmapping seems ok.
Maybe @Wi6Labs could comment.
FYI, The UART will be reworked to be more generic and allow more instance.

arcnor
Posts: 4
Joined: Wed Apr 05, 2017 10:51 am

Re: First release of STM32F4 core

Post by arcnor » Thu Apr 06, 2017 10:16 am

fpiSTM wrote:
arcnor wrote:Thanks for that, it worked great!

However, I have a (very beginner) question: How do I use the serial console with this? There is no serial port being created or detected when I connect the board (I upload using the STLink, and that seems to work fine), so the Arduino IDE fails when trying to use the serial port.

I'd also like to use the USB for MIDI, but I saw that USB says "not tested" (and also not sure if the Arduino USBMIDI stuff will be included) so I'll guess I'll need to be patient :).

Thanks again!
For F407, as I said it seems required some hw stuff to have the Serial. See the user manual of the F4 disco. For USB, there is only a HID support available that I've not tested.
I do not know USBMidi from Arduino.
Ah, I've checked your previous comment and saw the wires required, I'll try to make the change then, thanks!

MIDIUSB is one of the Arduino libraries (https://github.com/arduino-libraries/MIDIUSB), and it requires some kind of USB support, not sure how much (it only works on Arduinos with full USB support like the Atmega32u4 based ones, but this board should be totally capable of doing that as well).

Thank you again!

michael_l
Posts: 336
Joined: Mon Aug 24, 2015 6:11 pm

Re: First release of STM32F4 core

Post by michael_l » Fri Apr 07, 2017 6:27 am

Thanks. This is good news ! I'm running out of ram in my STM32F103 and will have to switch to STM32F4 soon.

Going a bit off-topic here but are there any STM32F4 boards that are size of a blue pill available ? Of course all F4 mcu's are not yet supported by this project but if I find a small STM32F4 board I can start working on the variant config based on this project.

User avatar
sheepdoll
Posts: 234
Joined: Fri May 22, 2015 12:58 am
Location: Silicon Valley Vortex
Contact:

Re: First release of STM32F4 core

Post by sheepdoll » Sat Apr 08, 2017 5:29 pm

arcnor wrote:
...

MIDIUSB is one of the Arduino libraries (https://github.com/arduino-libraries/MIDIUSB), and it requires some kind of USB support, not sure how much (it only works on Arduinos with full USB support like the Atmega32u4 based ones, but this board should be totally capable of doing that as well).

Thank you again!
MIDI USB is my number one priority. I have had to take a break from STM32 and use the Atmega32u4 based Leonardo as I have a deadline at the end of the month to get something working. The sketch is around 500 lines which would be nice to run on one of my STM32F4 boards without change.

There are two main Arduino MIDI libraries. arcore which can run separate on the UNO with the smaller ATMega16u2 sub processor that requires isp programming. The other library MIDIUSB seems to be the more supportive for all things MIDI allowing both CDC and MIDI on the same bus

There are a number of STM32 MIDI examples using older code (SPL.) There are no HAL examples for MIDI only AUDIO. What examples there are, are dependent on specific hardware or large projects such as midibox.

Ideally I would like to get something working on the STM32F429I-DISCO discovery board (the one with the TFT display.) I was never able to merge the CDC examples with the Nucleo board I have (Nucleo-F401RE) With the HAL code was working with 2 years ago. That is where I got sidetracked writing scripts to generate makefiles, pinmapping code, and eventually USB device descriptor code. I am glad to see that the ST folk have taken the scripting idea and extended it to the more widely available Python.

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: First release of STM32F4 core

Post by BennehBoy » Tue Apr 11, 2017 12:52 pm

michael_l wrote:Thanks. This is good news ! I'm running out of ram in my STM32F103 and will have to switch to STM32F4 soon.

Going a bit off-topic here but are there any STM32F4 boards that are size of a blue pill available ? Of course all F4 mcu's are not yet supported by this project but if I find a small STM32F4 board I can start working on the variant config based on this project.
I think the various cheap VET6 incarnations from china are about as small as you can hope for, they're considerably larger than a pill board due to the much expanded GPIO however.
-------------------------------------
https://github.com/BennehBoy

palmerr
Posts: 58
Joined: Tue Jan 31, 2017 6:21 am
Location: Melbourne, Australia

Re: First release of STM32F4 core

Post by palmerr » Wed Apr 12, 2017 12:18 am

BennehBoy,

I haven't seen any tiny F4's. (Others feel free to chip in here!) The most powerful, small ARM boards I'm aware of are the Teensys (Paul Stoffregen) with processors and speeds similar to the F4s. Googling Teensyduino will get you there.

There are a number of brave souls who have desoldered F103s from blue/red pills and put F4s in their place. Not for the faint hearted!

STM has kept the pin functions remarkably similar across the lines F1XYZ to F4XYZ, with only a few differences. You would need to look at the pin designations of the two chips before proceeding, to ensure enough of the right pins were available.

Creating a new variant is not difficult, though a bit tedious. If you find a variant with the same base chip already available, the only things to do are copy the variant to a new directory, set the Board Pins to something than makes sense and add a new board to the boards.txt file. Of course there are a number of other tweaks you will need to do, but that's the basics to get something that will fire up your board.

The original Maple cores are very stable and reliable, but a few functions in the F4 code simply refuse to work well (USB DFU uploads for instance).

The Koduino core is coming along nicely, though the F1 code is much more complete than the F4 code, due to where Avik and friends have focused to date.

The new STM32duino code - based on STM's CUBE is similar to Koduino, though even newer. The alpha release (yes alpha!) F4 core is less than two weeks old, but many functions work very well in their basic form - but usually just one interface of each type, and often no alternate pins (yet). The Issues log says that substantial improvements to SPI, I2C and Timers are next on the list.

So, whichever you choose, the F4 code still has some catching up to do - but it's getting there quite quickly, due to the efforts of a few hard-working individuals.

stevestrong
Posts: 1510
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: First release of STM32F4 core

Post by stevestrong » Wed Apr 12, 2017 7:10 am

Just wanted to shortly ask: will this core be totally different from the Arduino Star OTTO?

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: First release of STM32F4 core

Post by BennehBoy » Wed Apr 12, 2017 7:47 am

palmerr wrote: I haven't seen any tiny F4's. (Others feel free to chip in here!) The most powerful, small ARM boards I'm aware of are the Teensys (Paul Stoffregen) with processors and speeds similar to the F4s. Googling Teensyduino will get you there.
As I was saying there aren't any...

Something like this is about as small as you can get: http://www.ebay.co.uk/itm/STM32F407VET6 ... 1784914936
-------------------------------------
https://github.com/BennehBoy

Post Reply