STM32GENERIC Arduino implementation

Discussions about the STM32generic core
danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

STM32GENERIC Arduino implementation

Post by danieleff » Wed Jul 05, 2017 11:38 am

STM32GENERIC: Arduino implementation on top of STM32 HAL, for all STM32 boards.

Code on GitHub: https://github.com/danieleff/STM32GENERIC

Documentation: https://danieleff.github.io/STM32GENERIC/

Installation instructions: https://danieleff.github.io/STM32GENERIC/

For submitting problems, please use GitHub Issues: https://github.com/danieleff/STM32GENERIC/issues

For some usage examples, check in the Arduino IDE, menu File=>examples=>STM32 board examples for users

This is an alternative to the official implementation: https://github.com/stm32duino/Arduino_Core_STM32, it should be very similar in Arduino API, and STM32 HAL API.

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: STM32GENERIC Arduino implementation

Post by danieleff » Sun Jul 16, 2017 5:23 am

Given that the main focus is on libmaple and the official implementation,this takes a turn the following way.
The focus is on experimental, non-essential stuff.

You can create libraries for peripherals as their own repo, if you use HAL, both official and this can use them. (If it works, I can add it to board examples (as in, download X library from here: ...)) (I will also create some of these, if nobody else does)

Almost all of Arduino API works, I want to work on fun stuff that need support from the core:
  • libmaple-compatible HardwareTimer, and extend it to more timer modes
  • Extend AN2594 to variable size data (1-512 bytes), and multiple-pages, for EEPROM emulation, and...
  • ...use the previous point for flash disk emulation with on-chip flash, and as a mass storage drive backend
  • Virtual file system, like in ESP32.
  • analogRead starts DMA read, and all subsequent reads only read from the dma-buffer
  • Add weak mutex API to transactions for SPI/I2C/SDIO, implement in FreeRTOS, for thread safe access of same peripheral
  • Clock API, common defaults for most used clocks, common ldscripts. The variant folder will only contain variant.h.
  • DFU for F407?
  • delay() puts the MCU to sleep??
  • ...
So stuff almost nobody uses, it should not change the Arduino API.

There won't really be branches, just the master, as nobody would test non-master anyway. It might break compilation for some chips, but I want this to be fast moving. The other cores might give you a more stable experience.

User avatar
RogerClark
Posts: 7500
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32GENERIC Arduino implementation

Post by RogerClark » Sun Jul 16, 2017 6:11 am

Daniel

You can use the github Releases system if you want to mark a particular commit as being relatively stable ;-)

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

Re: STM32GENERIC Arduino implementation

Post by ChrisMicro » Sun Jul 16, 2017 6:34 am

You can create libraries for peripherals as their own repo, if you use HAL, both official and this can use them.
I don't understand exactly how you mean it. Can you describe the procedure?

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: STM32GENERIC Arduino implementation

Post by danieleff » Sun Jul 16, 2017 1:52 pm

RogerClark wrote:
Sun Jul 16, 2017 6:11 am
Daniel

You can use the github Releases system if you want to mark a particular commit as being relatively stable ;-)
Yes I will have to think about it.
ChrisMicro wrote:
Sun Jul 16, 2017 6:34 am
You can create libraries for peripherals as their own repo, if you use HAL, both official and this can use them.
I don't understand exactly how you mean it. Can you describe the procedure?
Just a github repository with a library.properties file in root, and the source in src folder.

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

Re: STM32GENERIC Arduino implementation

Post by ChrisMicro » Mon Jul 17, 2017 4:38 am

My fear is a little bit that the whole system becomes a little bit inconvenient if you have to download "one zillion" of libraries before you can try to use any example.
Your argument that the libraries can be used from different base frameworks has to be taken into account.
But how can we keep the Arduino 3 step principle of

1. download
2. choose example
3. press compile and flash

when you first have to look for a lot of libraries?

zmemw16
Posts: 1494
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: STM32GENERIC Arduino implementation

Post by zmemw16 » Mon Jul 17, 2017 12:46 pm

1.stop ide
2.download and install libraries or clone repo's into sketchbook/libraries, issue with updating one as git refuses to overwrite?
3.restart ide to refresh the libraries it sees
stephen

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

Re: STM32GENERIC Arduino implementation

Post by ChrisMicro » Mon Jul 17, 2017 1:03 pm

Yes, but the problem e.g.
You have a STM32F746 Discovery, you need a lot of drivers:
- touch
- TFT
- Microphone
- Ethernet
- Sound out
This means searching, finding ... not working on the first click

zmemw16
Posts: 1494
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: STM32GENERIC Arduino implementation

Post by zmemw16 » Mon Jul 17, 2017 1:09 pm

surely that's precisely the current state, Adafruit_XXX needs Adafruit_GFX etc.
i've installed a few others as well and have had to go round that loop more than once as then some of the 'needed' libraries have their own 'needs', so reading the source of the original set is not always enough to detail them all.
stephen

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: STM32GENERIC Arduino implementation

Post by danieleff » Mon Jul 17, 2017 1:28 pm

I might make the STM32-only libraries as git submodules, and pack into the board manager package.

Post Reply