I would like to introduce the new Arduino core for STM32:
https://github.com/stm32duino/Arduino_Core_STM32
A first package version is available through the Arduino IDE Boards manager by adding the following link to the “Additional Boards Managers URLs” field of the “Preferences” dialog:
https://github.com/stm32duino/BoardMana … index.json
It now support every STM32 families based on HAL (all version added to the repo) , some boards are already available:
- F0: Nucleo F091RC, Nucleo F030R8
F1: Nucleo F103RB
F2: Nucleo F207ZG
F3: Nucleo F303RE
F4: Nucleo F429ZI, STM32F407G-DISC1
F7: STM32F746G-DISCOVERY
L0: Nucleo L053R8, Nucleo L432KC
L4: Nucleo L476RG
BP and MM will come soon.
No more static libraries for the HAL. By modifying the stm32YYxx_hal_conf.h in the variant, it is possible to enable or disable HAL features.
CMSIS is no more include in the source, it a package dependency and use the one package by Arduino: CMSIS 4.5.0.
ARM gcc toolchain has been updated to 6-2017-q1-update version to support F7 family (cortex-m7) but for other families the 4.8.3-2014q1 version still valid.
All pins are available based on mbed pinmap feature.
PeripheralPins.c automatically generated from stm32cube mcu xml file. This avoid issue on pins definition.
Python script to generate it, is available thanks the Arduino_Tools package or the github repo:
https://github.com/stm32duino/Arduino_Tools
Pins capabilities are configurable through this file by commenting or not pin description.
USB feature is available and disabled by default. To enable it, use the menu “Tools->USB Interface”
Further features will be added. Do not hesitate to contribute or submit issues.
uSD with FatFs has been added and tested on F7.
USB Serial is ongoing (CDC).
Ethernet support based on LwIp will be added. added:
https://github.com/stm32duino/STM32Ethernet
https://github.com/stm32duino/LwIP
ADC features will be extended.
…
I will update the wiki in order to be inline with this new core and adding add a page on how to include a new variant (PeripheralPins.c generation, config,…).
Wiki:
https://github.com/stm32duino/wiki/wiki
If i add ‘-DUSBCON’ to .build.upload_flags in ‘boards.txt’,
i get this error:
AppData\Local\Arduino15\packages\STM32\hardware\stm32f1\2017.1.20\cores\arduino\main.cpp:54:2: error: 'USBDevice' was not declared in this scope
USBDevice.attach();
^
exit status 1
Error compiling for board BluePill F103C8.
i’ve added ‘-USBCON’ instead of ‘-DUSBCON’ and now it compiles.
And if i add ‘Serial.begin()’ to the sketch i get USB virtual COM.
very good
I try the STM32F7 Discovery because I didn’t have the compiler before.
Here is my first test:
1. download the package by the board manager as described above
==> status message:
Index error: could not find referenced tool name=openocd version=0.10.0-arduino1-static packager=arduino-org
Index error: could not find referenced tool name=nrf5x-cl-tools version=9.3.1 packager=arduino-org
Index error: could not find referenced tool name=openocd version=0.10.0-arduino1-static packager=arduino-org
Index error: could not find referenced tool name=nrf5x-cl-tools version=9.3.1 packager=arduino-org
Index error: could not find referenced tool name=openocd version=0.10.0-arduino1-static packager=arduino-org
Index error: could not find referenced tool name=nrf5x-cl-tools version=9.3.1 packager=arduino-org
2. compiling the blink example and download by mass storage:
==> it is blinking, very good
3. compile and download the ” Arduino TFT Bitmap Logo example”
==> screen remains blank
You are not working with the repo mention in this thread. You work with the stm32f1.
@ChrisMicro
1. for the download status it is not link to the STM32 package as it do not mention openocd not the nrf5x.
Probably, link to another json file you have used.
2.
3. Right, nice shot
I need to update the SD lib to use the default one if the card slot used is on the shield (SPI) or use the other if we want use the onboard card slot.
FYI, currently the LCD is not managed. I will add the support later.
fork/exec /home/holla/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++: no such file or directory
Error compiling for board BluePill F103C8
looks like the board manager isn’t downloading the compiler.
—–
update: I deleted my ~/.arduino15 directory and re-installed the tools using board manager and
https://github.com/stm32duino/BoardMana … index.json
then blink compiled fro BluePill F103CB, yay!
All current open issues on F1 will be reported and corrected.
Is there any problem with that ?
FYI, the new pins managements is fully inspired from mbed.
I just tried the repo with the SM32F746 discovery.
The SD-Card examples work, but the TFT examples did not.
In the STM32GENERIC repo the TFT examples are working including touch.
it is a known issue.
https://github.com/stm32duino/Arduino_C … 2/issues/2
I have to change the name of the modified SD library (SD.h) in order to use the default one through SPI (when you use th SD from the TFT shield).
And make some correction to the modified SD lib to be able to use the onboard SD with TFT shield (TFT lib pass the File opende by copy and in this implementation the copy reset the fp, so it read always from the beginning)
Note: the LCD from the F746 is not supported at this time
All pins are available based on mbed pinmap feature.
PeripheralPins.c automatically generated from stm32cube mcu xml file. This avoid issue on pins definition.
Python script to generate it, is available here:
https://github.com/fpistm/stm32_tools
Pins capabilities are configurable through this file by commenting or not pin description.
it is a known issue.
https://github.com/stm32duino/Arduino_C … 2/issues/2
I have to change the name of the modified SD library (SD.h) in order to use the default one through SPI (when you use th SD from the TFT shield).
And make some correction to the modified SD lib to be able to use the onboard SD with TFT shield (TFT lib pass the File opende by copy and in this implementation the copy reset the fp, so it read always from the beginning)
Note: the LCD from the F746 is not supported at this time
When you say it is using the mbed pinmap feature, do you mean the same structure?
But still, how to access the touch chip on I2C3(PH8/PH7)? It is commented out: https://github.com/stm32duino/Arduino_C … ins.c#L112
(Slightly unrelated, how to access non-first peripherals in general, SPI2, SPI3, I2C2, I2C3, UART2, …)
PeripheralPins.c automatically generated from stm32cube mcu xml file. This avoid issue on pins definition.
The call command should be:
genpinmap_arduino.py NUCLEO_F446RE “STM32F446R(C-E)Tx.xml”
Xml file should be in <STM32CubeMX install dir>\db\mcu
The script expect to find the cubemx in default install dir:
if sys.platform.startswith('win32'):
#print ("Windows env")
cubemxdir = 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu'
cubemxdirIP = cubemxdir+"\\IP\\"
input_file_name = cubemxdir+"\\" + sys.argv[2]
out_path = cur_dir+'\\Arduino\\_'+sys.argv[1]
output_filename = out_path+"\\"+out_filename
else:
#print ("Linux env")
if sys.platform.startswith('linux'):
cubemxdir = os.getenv("HOME")+'/STM32CubeMX/db/mcu'
cubemxdirIP = cubemxdir+"/IP/"
input_file_name = cubemxdir+'/'+ sys.argv[2]
out_path = cur_dir+'/Arduino/'+sys.argv[1]
output_filename = out_path+'/'+out_filename
Since the utility did not support Mac OSX, I added support and created a pull request.
Regards,
Rob
thanks I will add it.
What is the use of Arduino_Core_STM32-master since u already added the STM32 boards from boards manager???
I saw the Arduino_Core_STM32 has some libraries and cores for STM32. But how to add it to my arduino IDE?
The libraries are available through the Library manager of Arduino IDE. Search “stm32duino”
Thanks in advance.
If it has TFT and touch support it will be very useful.
Thanks.
I will provide the updated examples in the STM32Examples library.
So be patient.
I have tried to add LTDC as local library from STM32GENERIC but it needs lots of backup files and it throws more linker errors.
[fpiSTM – Fri May 11, 2018 4:51 am] –
No, I will see if I can do it today but I’ve lot of stuff to do and you’re not alone.
So be patient.
Ok. thanks.
- Is the DFU upload available? In platform.txt I only see mass storage, St Link, Serial and Black Magic Probe (nice, depending on the board capabilities. But no DFU. I know DFU works for my board, since I can upload the hex file with DFUsedemo after converting the .hex file to .dfu, but would be nicer if I could do it from the IDE
- I wanted to try our the CMSIS DSP library, and I see that it’s included in the distribution. How do I use the DSP library from the Arduino IDE? I could not find any documentation in the wiki? I’d be happy to help write some, if I could get a starting point
DFU should be available soon. Probably in the next release.
BennehBoy made a PR to add the support: https://github.com/stm32duino/Arduino_C … 2/pull/415
About CMSIS DSP, I never use it, I guess you have to include the proper header, probably the path should be added in the platform.txt:
https://github.com/stm32duino/Arduino_C … rm.txt#L65
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.3.0.path}/CMSIS/Core/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Source/Templates/gcc/"
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.3.0.path}/CMSIS/Lib/GCC/" -l{build.cmsis_lib_gcc}
I’ll wait patiently for the DFU option, I’m good at that
Not sure if it will use the HID option for F4 or native DFU, though. In the F4, the HID bootloader uses 16Kb of flash, even if it’s mitigated by the fact that the F4 has plenty of flash anyway compared to the F103 I used before
As soon as I have a moment I’ll try and play with one of the DSP libraries, and if I can make it work I’ll provide additional info. And, yes, I noticed that CMSIS 5.4.0 was already available, so I already copied that in my install… even if the DSP library has been unchanged in forever, and still at 1.5.2
