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.
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.
You can use the github Releases system if you want to mark a particular commit as being relatively stable ![]()
I don’t understand exactly how you mean it. Can you describe the procedure?
[RogerClark – Sun Jul 16, 2017 6:11 am] –
DanielYou 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.
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?
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
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
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
Would it be possible to use this library for PWM-sound like I did it with the HAL-interrrupt timer?:
The commit is now 106 ahead of Daniel’s and it seems to be a fork now.
I found this issue with the Servo library:

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.
It’s better to write an issue on github.
Ok!, THX for the tip.


