STM32F3 Discovery board support

Violet Giraffe
Wed Mar 22, 2017 10:00 am
I have this board and I would like to use in my project, and I would also like to use Arduino because the native STM32 ecosystem is awful.
So, I can see that you do offer basic support for this board, I can select it and compile some simple stuff and even some libraries. But not some other libraries. I want to use a TFT display so I’ll need Adafruit GFX and Adafruit ST7735 ports. I’ve tried compiling these libs for STM32F103C and was successful, but the F3 Discovery platforms is missing some crucial bits.

Specifically, I’ll need SPI.h and pins_arduino.h to compile the aforementioned libraries. Is there a serious reason why these headers are not supplied? Is there a problem with them on F3, or is it just that no one bothered? If you help me port these headers I’ll be happy to test and contribute them to the project.


BennehBoy
Wed Mar 22, 2017 10:46 am
I think it’s just that Roger has not had time to do the conversion work from the maple core that he did for F103 – he’s stated many times that anyone wishing to do so and submit a PR on the github repo is very welcome to do so.

I’m not using F3 but may be tempted if the core was fleshed out further…

I think you’d get good support from the forum if you attempted to make this happen


Violet Giraffe
Wed Mar 22, 2017 11:18 am
Thanks. So what would be the best way to start? Take these files from F103 and adjust for F303?

BennehBoy
Wed Mar 22, 2017 11:25 am
Violet Giraffe wrote:Thanks. So what would be the best way to start? Takes these files from F103 and adjust for F303?

RogerClark
Wed Mar 22, 2017 9:45 pm
I dont know if you will be able to simply take F1 libraries and modify them.

The F3 core is only part of the repo to save it from being lost.

I forget who ported the original LIbmaple core to F3, but they abandoned it.

A load of work has gone into the F1 and some work into the F4 over the last 2 years, to bring them more up to date with the current Arduino API, but there have only been occasional minor changes to the F3 core as hardly anyone uses the F3.

I generally recommend people use the Koduino Arduino core, written by Avil De, if you want to use the F3, as Avil wrote the core specifically for the F3.

Google for it in github.


Violet Giraffe
Wed Mar 22, 2017 11:41 pm
RogerClark wrote:
I generally recommend people use the Koduino Arduino core, written by Avil De, if you want to use the F3, as Avil wrote the core specifically for the F3.

RogerClark
Thu Mar 23, 2017 6:33 am
I don’t think there is an easy solution at the moment.

AFIK the F3 is a lot different from the F1 and from the F4, and when I discussed things with Avik, he said that there was a lot of difference between the devices in the F3 range so it was not easy to add support for any of the F3’s that he does not already support.

Another option is to use the STM F1 core as the base and try converting it to F3.

I know @danielef did something similar to make a core for the F4, but a lot of things didn’t work, including the ADC , though I think SPI was supposed to be working.

Its not that difficult to make a new core based on STM’s F1 core, as you just need to replace the files in the library folder with F3 versions exported from the STM32 CubeMx code generating program.

However if you have not used the CubeMX before or are not familiar with how an Arduino Core is structured, it could be a steep learning curve.

I think in the long term STM are supposed to be releasing a Core for the Nucleo F3 board, but their rate of progress is quite slow, and so far they have only produced 3 cores in about 9 months, (F1, L4 and F0) and I think the next core they are working on is the F4, and I don’t know what they intend to produce after that.

So you could be waiting a very long time for an official STM F3 core :-(


Riva
Thu Mar 23, 2017 9:23 am
What does the F3 offer you that makes it a must over the F1/F4 options?

Pito
Thu Mar 23, 2017 9:34 am
FYI – in addition to a typical 72MHz F4:
Ultra-fast comparators (25 ns)
Op-amp with programmable gain

12-bit DACs
Ultra-fast 12-bit ADCs with 5 MSPS (Million Samples Per Second) per channel (up to 18 MSPS in Interleaved mode)
Precise 16-bit sigma-delta ADCs (21 channels)
Core Coupled Memory SRAM (Routine Booster), a specific memory architecture boosting time-critical routines, accelerating the performance by 43%
144 MHz Advanced 16-bit pulse-width modulation timer (resolution < 7 ns) for control applications
High resolution timer (217 picoseconds), self-compensated vs power supply and temperature drift
Supporting 1.8 volt operation


While F1 and F4 are more-less general purpose mcus, the F3 is oriented towards industrial control apps..
For example the 217ps resolution timers are unique, quite handy when you chase the highest efficiency with switching power supplies or precise motor control..

Violet Giraffe
Thu Mar 23, 2017 9:53 am
RogerClark wrote:
However if you have not used the CubeMX before or are not familiar with how an Arduino Core is structured, it could be a steep learning curve.

RogerClark
Thu Mar 23, 2017 10:07 am
Try PM’ing @danielef and ask him about his F4 port of the STM Core

The official STM repo’s are here

https://github.com/stm32duino

Its hard to know which one to base the F3 upon. The F1 core has had the most work, as we had to rework it because it was written poorly and initially consumed loads of RAM etc
This was because STM wrote the L4 core first and it had loads of RAM so they didnt consider how to minimise RAM usage.
So when they created the F1 core based on the L4 core it too far too much RAM.

Anyway, if you look in the system folder

https://github.com/stm32duino/Arduino_C … ter/system

you can see that those files are generated from the STMCube and I think only have minor (or no modifications)

So you could have a go by copying the F1 core and replacing the system file with the F3 export from the cube.

There are several threads in the forum about the STM core, that are probably worth reading as it details the RAM usage issues etc

BTW. @sheepdoll also started to write a core using the STM Cube files before STM started their version, but I don’t think it has SPI and has generally been superseded by the STM core

PS. The core most people still use is the one based on LibMaple as its still got a smaller footprint and works fine as long as you don’t want HAL API compatibility


Pito
Thu Mar 23, 2017 10:11 am
I need a hardware audio DAC. Don’t know if any F1 chip has it, but certainly no F1 mini-board that I’ve seen.
There is a dozen of 103s having dual channel 12bit DAC, from RC up and with larger packages..
Even the old F1VLDiscovery got a dual channel 12bit DAC.
Is that the “audio DAC” you are looking for??

RogerClark
Thu Mar 23, 2017 10:28 am
Re: Audio DAC

I know some people also use an external DAC and the I2S thats available on the higher end F103 e.f. RC or better.


Violet Giraffe
Thu Mar 23, 2017 10:36 am
Pito wrote:
There is a dozen of 103s having dual channel 12bit DAC, from RC up and with larger packages.

ag123
Tue Apr 04, 2017 2:16 pm
agreed those high density f103 do have dac built-in
http://www.st.com/en/microcontrollers/stm32f103ve.html

one way though may be like ordering it on ebay or aliexpress
http://www.ebay.com/sch/i.html?_from=R4 … t6&_sop=15
unfortunately for the low cost (or perhaps some ‘free’) shipping, they tend to take a long time to arrive e.g. a month

as for myself i find the high densities f103s tad pricy and rather than settle for f103 i’d go for stm32F4 instead e.g. a stm32f407ve, the main reason being that the price difference between a high density F10x vs the average e-bay F40x is rather modest
e.g. http://www.ebay.com/itm/Core407V-STM32F … 2150729877
in that way i’d gain both the performance jump 168mhz vs 72mhz, normally much beefier hardware e.g. has fpu, faster adc more spi, more and faster dma etc.

if you are not ‘targetting’ the built-in DAC, and is willing to settle for a separate dac, there are some rather cheap I2S audio dac discussed in this thread
http://www.stm32duino.com/viewtopic.php?t=519

alternatively, u’ve that f3 :lol:


Leave a Reply

Your email address will not be published. Required fields are marked *