[deprecated]First release of STM32F4 core

The official STMicroelectronics Arduino core
User avatar
sheepdoll
Posts: 236
Joined: Fri May 22, 2015 12:58 am
Location: Silicon Valley Vortex
Contact:

Re: First release of STM32F4 core

Post by sheepdoll » Thu Apr 13, 2017 9:50 pm

palmerr wrote:Frederic,

I've been looking through your variant files for MCU Port to Arduino pin mappings while working on a "Black STM32F407VET6" variant - as we've described on the Wiki http://wiki.stm32duino.com/index.php?title=STM32F407.

The Nucleo board is fairly straightforward with its Uno V3 style headers.

With the Disco Board
- what was the reasoning behind starting with the inner pins on both sides, and the the outer pins?
- how hard did you try to match Uno-style Dxx standards for functions (e.g. SPI, I2C, UART)?

Thanks for any guidance you can provide on how to make the variants as easy to use as possible for programmers.

Richard
While I am not Frederic, I can sort of address the DISCO board weirdness. I have a number of these going back to the F0. It came with a link and examples to two libraries. This was STM's first attempt into arduino land by attempting to make a SPL interface to Arduino Shileds. The other examples were for microbus.
from the readme - the Arduino shield boards were :

Code: Select all

Bluetooth BEE shield board,NFC ,Sparkfun MIDI shield board  ST MEMS DIL24 board STEVAL-MKI108V2 board.
microbus boards were:

Code: Select all

ADC_Click, BLUETOOTH_Click, BUZZ_Click, DIGIPOT_Click, RTC_Click and IDC10 EasyLED boards.
	IDC10 LCD board "COG 2x16 LCD" is used as display board in some examples.
The kit came with a blank perf board and some PDF guides as to how to wire the external boards to the DISCO headers.

What is also interesting is some of the ST examples (Mostly Nucleo) can also control an Adafruit 1.8" TFT Joystick shield with microSD based on the ST7735R TFT controller. This product seems to date to 2012 and is product 802. (currently out of stock.)

Why I bring this up here is these boards seem to be the ones that the ST labs use to create code examples for. So are the best documented. While they are the reverse (mostly using SPL) of say the Arduino Dxx standards, they do show (as of 2012, when I took the seminar classes.) the way ST thought the Arduino pins should be mapped.

I have mentioned this subject before, but I do think it is important in the understanding of how ST and the ST engineers look at things like pin mapping.

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

Re: First release of STM32F4 core

Post by palmerr » Fri Apr 14, 2017 1:28 am

Thanks Sheepdoll,

It's good to hear where the STM folks started from, which illuminates how they arrived where they are.

I think we're coming to some kind of consensus that, for the more advanced boards, Dx style numbering in code is counterproductive.

That means abandoning some of the Uno Dx defaults (SPI, LED, TXn, SDA/SCK, etc) for the default interfaces. It will break some libraries, but they're probably in need of rewriting anyway, if they have library-level hard coded defaults for function/pin mappings, rather than obtaining them from platform/board defines.

PortToPin maps seem to have more relevance to quickly finding pins on headers, so it seems to be worth the time in the enums and arrays to list the PXNNs in some sort of order that makes sense in the physical world.

Why I'm harping on all this in the forums, is that if we DO come to a new consensus, and document how to approach the tradeoffs in creating variants, we can avoid a little chaos downstream!

For instance, at the moment Stephen (zmemw16) and I are collaborating on Black_F4VET6 variants. Daniel has put one up in GENERICSTM32, and Michel (MskMichel) has added to the Wiki documentation (and maybe working on a variant also). We could end up with three or four sub-variants of the same board! Maybe we all contribute our two cent's worth and let the market decide which is (are) best.

Richard

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

Re: First release of STM32F4 core

Post by palmerr » Fri Apr 14, 2017 1:43 am

Ag123,

I agree with your logic about not tying things down too tightly, so that the developer can choose which set of functions to enable, and thus have some flexibility on pins.

However, I think we may be able to get by with a single variant for almost all purposes.

1. Leave as many AF options open as possible for each peripheral - providing almost all of the flexibility you mention.
2. Only restrict pins that might cause functional issues:
- e.g. the CS pin for the flash, which must disable the chip for other hardware (including SPI modules) using PB4/5 to work.
- SWDIO/SWCLK?

On the Black F4VET6 the SPI1/SPI3 choice seems to be the only one that's at all significant. NRF, USB (?) & SDIO are all options that can (could? should?) be disabled at code level along with the AF mappings.

Daniel Eff has opted for SPI3 to map to the NRF/Flash, and this seems to be a good choice, thought there are some NSS tradeoffs. I'm not sure whether DMA/SPI would be affected by not using NSS pins for CS.

Richard

ChrisMicro
Posts: 293
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: First release of STM32F4 core

Post by ChrisMicro » Fri Apr 14, 2017 7:40 am

Hello together,

thank you very much for all your work. I successfully installed the STM32F4 from Rogers directory and it worked fine.
My goal was to write some examples for the STM32F4 discovery. Because the STM32F4 core is newer and has more support for the peripherals I tried to install it relating to this description:
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/fpistm/arduino-core-stm32f4.git stm32f4
Do not forget to checkout the stm32f407 branch ;)
Start arduino you should see the STM32F4 boards
I tried it on Windows10 with Arduino IDE 1.6.9 and Arduino 1.8.0
I tried it on Linux Ubuntu 16.04 LTS with Arduino IDE 1.8.1

I had no success. In none of this IDEs the STM32F4 discovery appeared in the Board-Manager. I tried it for two days now in every way I could think of. No success.

Do you have any hints? Is it probably a problem of the current commit.

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

Re: First release of STM32F4 core

Post by arcnor » Fri Apr 14, 2017 7:45 am

Hi ChrisMicro,

Please be advised that the instructions you copied have the wrong repository. The right one is "https://github.com/stm32duino/Arduino_Core_STM32F4.git". You also don't need to change the branch anymore (it's been merged to master).

Hope that helps.

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

Re: First release of STM32F4 core

Post by fpiSTM » Fri Apr 14, 2017 8:23 am

Oups, yes I've made a mistake... this repo is not the good one... :oops:
I will update my post to point on the right one.
And now the F407 is merged in the master.

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

Re: First release of STM32F4 core

Post by palmerr » Fri Apr 14, 2017 8:30 am

Thanks Frederic,

I'll download the changes tomorrow and have a play.

BTW: are the floating point functions implemented yet, I'm getting slowish arithmetic?

Single precision float = 8 x fixed point, for add and multiply.

It should be closer to 1:1 for FPU?

Richard

ChrisMicro
Posts: 293
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: First release of STM32F4 core

Post by ChrisMicro » Fri Apr 14, 2017 7:06 pm

Please be advised that the instructions you copied have the wrong repository. The right one is "https://github.com/stm32duino/Arduino_Core_STM32F4.git". You also don't need to change the branch anymore (it's been merged to master).
Uhhh .. .finally that works ... after this many tries.
Thank you very much ;-)

My working installation procedure ( I hope it can help some other people ):

My Arduino IDE directory is
C:\Tools\Arduino\Arduino1_8
I make a directory inside the Arduino IDE folder and change to this directory:
C:\Tools\Arduino\Arduino1_8\hardware\STM\
then:
git clone https://github.com/stm32duino/Arduino_Core_STM32F4.git stm32f4

ChrisMicro
Posts: 293
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: First release of STM32F4 core

Post by ChrisMicro » Sat Apr 15, 2017 5:13 am

The STM32F4 Discovery has very interesting peripherals for sound generation and processing:

- MP45DT02 ST-MEMS-Microphone
- Audio-DAC CS43L22 with class D amplifier
- 3-Axis-ST-MEMS-accelerometer

Is it planned to support them with drivers? The board is very well suited to create synthesizers if there is a possibility drive the codec.

Here I found a example using the accelerometer which uses Rogers repository.
But it is not working with this core.

There is also an example which I made using the Microphone for a VU meter including the OTG LED with Rogers repository. How can it be done with this core?

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

Re: First release of STM32F4 core

Post by palmerr » Sat Apr 15, 2017 5:43 am

Pin Maps for the Black F4 VET6 board are now up on the wiki and my repo https://github.com/palmerr23/Black-F407 ... /Documents

Corrections gratefully accepted.

Richard

Post Reply