STM32GENERIC Arduino implementation

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
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.


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
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
Sun Jul 16, 2017 1:52 pm
[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 ;-)

Yes I will have to think about it.

[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?

Just a github repository with a library.properties file in root, and the source in src folder.


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
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
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
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
Mon Jul 17, 2017 1:28 pm
I might make the STM32-only libraries as git submodules, and pack into the board manager package.

ChrisMicro
Tue Jul 18, 2017 4:25 am
It would be quite useful if you could make one as example.

ChrisMicro
Tue Jul 18, 2017 4:35 am
I just saw that you added the hardware timer library and examples.
Would it be possible to use this library for PWM-sound like I did it with the HAL-interrrupt timer?:

vitor_boss
Thu Jul 20, 2017 8:21 pm
danieleff thank you very much for HardwareTimer library. Your repo rocks

ChrisMicro
Thu Oct 19, 2017 5:58 am
Interesting: Huaweiwx seems to support really a lot of boards and has integrated all the libs in the repository.
The commit is now 106 ahead of Daniel’s and it seems to be a fork now.

RogerClark
Thu Oct 19, 2017 7:42 am
Its a shame we have no way to contact the person who maintains that repo

ChrisMicro
Thu Oct 19, 2017 3:02 pm
Is it not possible via github? I think if you create an issue there they should respond.

martinayotte
Thu Oct 19, 2017 4:40 pm
Simply use his email taken from his main github page :

[email protected]


Slammer
Thu Oct 19, 2017 6:54 pm
It seems that he is active in a Chinese forum : http://bbs.mydigit.cn/u.php?uid=1023450 informing about the progress of the project.

RogerClark
Thu Oct 19, 2017 7:47 pm
Perhaps we can get one of the forum members who lives in China to contact this guy ( in Chinese ) via that forum.

ChrisMicro
Thu Oct 19, 2017 8:35 pm
But what would you tell him?

logd32
Wed Dec 06, 2017 12:14 pm
now i want to merge this and the USB DFU bootlader,i contacted Hua Wei to ask him about what bootloader he uses

TFTLCDCyg
Sat Sep 22, 2018 3:15 am
Hi again danieleff!. Congratulations for share with us your generic core for STM32.

I found this issue with the Servo library:

Image

Opciones de compilación cambiadas, reconstruyendo todo
C:\arduino-1.8.0\hardware\STM32GENERIC_danielefF\STM32\libraries\Servo\src\Servo.cpp: In member function 'void Servo::writeMicroseconds(int)':

C:\arduino-1.8.0\hardware\STM32GENERIC_danielefF\STM32\libraries\Servo\src\Servo.cpp:45:5: error: 'pwmWrite' was not declared in this scope

pwmWrite(this->pin, dutyCycle16Bits, 50, 0);

^~~~~~~~

C:\arduino-1.8.0\hardware\STM32GENERIC_danielefF\STM32\libraries\Servo\src\Servo.cpp:45:5: note: suggested alternative: 'write'

pwmWrite(this->pin, dutyCycle16Bits, 50, 0);

^~~~~~~~

write

exit status 1
Error compilación en tarjeta Nucleo-144 boards.


madias
Sat Sep 22, 2018 8:20 am
Daniel isn’t active in this forum since “Last active:12 Dec 2017, 14:58”
It’s better to write an issue on github.

TFTLCDCyg
Mon Sep 24, 2018 3:59 pm
offtopic:

Ok!, THX for the tip.


Leave a Reply

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