STM32 Architecture
Introduction
This is the page for all things STM32. Currently working with a Nucleo F302R8
Setting Up
This was a trial and a half and here in case some others struggle and find this help.
STM32CubeIDE (Eclipse)
My goal was to use eclipse because this is what is used in the videos. So with ubuntu 23.04 install went to install this with eclipse. But the eclipse version requires python 2.7 which is no longer available.
VS Code
Luckily STM32 had brought out an extensions for my preferred solution VS Code. Installed the extension and went about installing the 3 other products it mentioned.
- STM32CubeMX
- STMCUFinder
- stm32cubeclt_1.12.1
Started it up but the import project button did nothing at all so I assumed it must need STM32CubeIDE. So went back to trying to install libpython2.7 and found https://askubuntu.com/questions/101591/how-do-i-install-the-latest-python-2-7-x-or-3-x-on-ubuntu. Unfortunately whatever I did must have move ld.so or something serious so had to re-install. But the good news was I could retry the STM32 extension. Having a new install I tried the STM32 Extension and it did indeed say could not find STM32CubeIDE. I documented this on the STM32 forum under https://community.st.com/s/question/0D53W00002IMDFZSA5/import-project-in-vs-code-ubuntu-2404
STM32CubeIDE Attempt 2
The was an additional install for STM32CubeIDE for vanilla linux. So I downloaded this and installed it. But on start up it failed with an error org.eclipse.swt.internal.C::strlen.
But the next morning googling I found https://github.com/adoptium/adoptium-support/issues/785 and the solution to getting it to work.
mkdir /tmp/SWT-GDBusServer
So may find solution was
- Ubuntu 23.04
- en.st-stm32cubeide_1.12.1_16088_20230420_1057_amd64.sh.zip
- en.ST-MCU-FinderLin_v5-0-0.zip
- en.stm32cubemx-lin-v6-8-1.zip
Debugging
Getting Started
Well now have all of the bits installed. Next it is time to start debugging
Update nucleo f302r8
This required an Update to the firmware. Google is your friend. Downloaded en.stsw-link007-v3-12-3.zip. This contained the udev rules which you can install using dpkg. Don't forget to reload rules with
sudo udevadm control --reload-rules
sudo udevadm trigger
Next under the stsw-link007/AllPlatforms
sudo java -jar STLinkUpgrade.jar
Hopefully this all goes well
Launch Settings
This was surprisingly easy once I had all the other things in place. Here is my file.
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug via ST-Link",
"cwd": "${workspaceRoot}",
"type": "cortex-debug",
"executable": "./build/debug/build/Test6.elf",
"request": "launch",
"servertype": "stlink",
"device": "STM32F02R8",
"interface": "swd",
"runToEntryPoint": "main",
"svdFile": "STM32F302.svd",
"v1": false,
"showDevDebugOutput": "both",
"armToolchainPath": "/opt/st/stm32cubeclt_1.12.1/GNU-tools-for-STM32/bin"
},
]
}