[deprecated]First release of STM32F4 core

The official STMicroelectronics Arduino core
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 05, 2017 7:49 am

Thanks. I'll give it a go.

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

Re: First release of STM32F4 core

Post by fpiSTM » Wed Apr 05, 2017 10:12 am

Hi,
I've just pushed a branch STM32F407G-DISC1-Example
https://github.com/stm32duino/Arduino_C ... C1-Example
This will be more easy to see what is required to add a variant.
As mentioned in the git commit:
Basic test on ADC/DAC/PWM/IO are functionnal.
USB not tested.
Serial over STLink required connection.
See UM1472 §6.1.3 ST-LINK/V2-A VCP configuration


Hope this help ;)

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

Re: First release of STM32F4 core

Post by arcnor » Wed Apr 05, 2017 10:54 am

Hi,

This is awesome! I just discovered this project and the only board I have is the STM32F4DISCOVERY, and just found that half an hour ago you released a branch with support for it, excellent! I'll try to follow the steps scattered through this forum to make it work (it seems there is a bit of outdated information)

Thanks!

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

Re: First release of STM32F4 core

Post by fpiSTM » Wed Apr 05, 2017 12:19 pm

arcnor wrote:Hi,

This is awesome! I just discovered this project and the only board I have is the STM32F4DISCOVERY, and just found that half an hour ago you released a branch with support for it, excellent! I'll try to follow the steps scattered through this forum to make it work (it seems there is a bit of outdated information)

Thanks!
Hi arcnor,
I do not release yet the package for F4. Some features needs some rework to be more generic.
But If you want to try it quickly, then follow the wiki:
https://github.com/stm32duino/wiki/wiki/Getting-Started
to install the L4 core for example. This will allow to install the arm toolchain and the STM32 tools (including stlink).
Then simply clone the F4 repo into the arduino install dir:
cd <arduino_install_dir>/hardware/
create an STM dir
mkdir STM
then clone the repo:
git clone https://github.com/stm32duino/Arduino_Core_STM32F4 stm32f4
Do not forget to checkout the stm32f407 branch ;) <-- merge on master
Start arduino you should see the STM32F4 boards
Last edited by fpiSTM on Fri Apr 14, 2017 8:24 am, edited 1 time in total.

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 05, 2017 12:45 pm

It worked a treat, thanks.

Tomorrow I'll try out the variant.

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 05, 2017 1:23 pm

I spent the day creating a Cube F407VET variant (not Disco).

Given that the static library config files (build_gcc, particularly Makefile and stm32f4.mk) are related to the variant more than the F4 platform, would it make sense to move some, or all, into the variant's directory?

I made quite a few changes to the stm32f4.mk file to add/subtract features (e.g. no Wolfson codec) on my board.

Maybe the discos all have similar hardware features, and a common build_gcc makes sense for them.

I'm about to look at the new 407 disco code - and see how it is done properly!

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

Re: First release of STM32F4 core

Post by fpiSTM » Wed Apr 05, 2017 2:37 pm

palmerr wrote: Given that the static library config files (build_gcc, particularly Makefile and stm32f4.mk) are related to the variant more than the F4 platform, would it make sense to move some, or all, into the variant's directory?
Only the Makefile is changed and the main diff for the lib is the HAL config (stm32f4xx_hal.h).
I think, stm32f4.mk could be changed if some BSP features or components is required.

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 05, 2017 11:24 pm

Yes, exactly.

Wouldn't it be better for the files that need to be changed to be in the variant folder rather than the shared code folders - so that features could be edited in and out for particular boards without the possibility of breaking other variants?

Happy to go with whatever you decide, but there's an opportunity now to adjust things before lots of people (like me) start to donate variants to your excellent core.

Richard

fpiSTM
Posts: 224
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 6:22 am

palmerr wrote:Yes, exactly.

Wouldn't it be better for the files that need to be changed to be in the variant folder rather than the shared code folders - so that features could be edited in and out for particular boards without the possibility of breaking other variants?

Happy to go with whatever you decide, but there's an opportunity now to adjust things before lots of people (like me) start to donate variants to your excellent core.

Richard
Of course, you're right.
All enhancement/corrections are welcome :) It is a collaborative source code.
We brought the first version but up to the stm32duino community to make it live ;)
Currently, I'm thinking to rework how to manage the lib.
For example CMSIS could be a package as it is mainly common to all repo except the specific device part. Moreover, this will reduce the size of each repo.
Then add the possibility to rebuild the lib during the arduino build thanks a switch which can be add in the boards.txt.
Because if you want to enable or disable an HAL feature, no needs to go in a command line env.
I will do probably a pull request for this when I will have some time.

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

Re: First release of STM32F4 core

Post by arcnor » Thu Apr 06, 2017 7:05 am

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!

Post Reply