@martinayotte
You could just try the current F4 version
It works on the F407 as Mubase is using it.
Note. Its from an older branch of LibMaple so uses the older Arduino 0022 API, e.g doesnt have Serial.peek or Stream etc etc
But it does work
I really wish I had more time to update the F4 stuff to the level of the F103 but I just dont at the moment as there is so much still to do on the F103
I have been thinking about how we can merge the codebase, for F1 and F4 but yet still have different files.
The problem is that the Arduino IDE just compiles and links all files it finds in the cores folder
So we’d need to move the processor specific files from being in C files to having the code in headers
and then do conditional includes back onto the original files
e.g.
gpio_f1.c would need to be renamed to gpio_f1_c.h and a new file gpio.c created, that includes gpio_f1_c.h (or gpio_f4_c.h) etc
The other complication is that some includes are taken from the system folder and some aren’t
Actually, if we put gpio_f1_c.h into the system folder and have sufolders under system for f1 and f4, we would not need to do conditional includes in gpio.c as it could just have
#include “gpio_c.h” and it we could change the compiler include paths in the baords.txt file
This would need a change to boards.txt and platform.txt, but I think is something that could be done iteratively, i.e file by file, rather than trying to change the whole lot in one go and breaking it totally
I know ultimately we’d be better off with switching to STM’s headers, but I think that would be a much bigger job than just trying to merge the F1 and F4
I can only see 13 files in the F1 repo that have _f1 in their file name
Umm
Now I look at it.
They have done things a different way, but its less efficient,
in the F4 folder they have files with #ifdef STM32F2 around all the code
This is will work, but it means the compiler will be compiling at least 12 empty files each time, so will slow the build down a bit
I think the include method via different include paths specified to in platform.txt is probably the most efficient
Edit.
Not sure why they did this
But its the F2 files in the F4 repo that will be used as in boards.txt it defines
-DSTM32F2