January 8, 2024

STM32H747I-DISCO "Discovery kit with STM32H747XI MCU" -- STM32CubeMX

Ages ago I downloaded something called "Mbed" which is some kind of development system for STM32 processors. It seems to include STM32Cube files, or something of the sort. There are other things to confused the picture (such as CMSIS, whatever it is). What I read is that Mbed-OS is some kind of RTOS, that at one time Mbed was cloud based, something terrible and everyone hated it. I find all of this confusing, but I suppose the picture will become clearer if I dig deeper. What I do read is that STM32CubeMX is independent of Mbed, although there is overlap that can be worked out. There is also STM32CubeStudio, but I will ignore that for the time being.

STM32CubeMX

You go to the download site and find that it is offered for Windows, Mac, and Linux. I select the Linux variant, accept the license document, and am confronted with a form that wants me to log in or authenticate myself somehow. I have done this already for ST, so I dig up those credentials.

My old credentials don't work, so I try password reset. It fails and I am told to set up a new account. This works and I redo the download for STM32CubeMX. I end up getting 3 copies because their website just silently is downloading it for me and I don't think anything is happening. I end up (in my Downloads) with:

-rw-r--r-- 1 tom tom  587741830 Jan  8 22:20  en.stm32cubemx-lin-v6-10-0.zip
Yep, a 588M zip file (and 3 of them! I delete the 3 redundant copies and do this:
mv en.stm32cubemx-lin-v6-10-0.zip /u1
cd /u1
mkdir STM32cubemx
cd STM32cubemx/
unzip ../en.stm32cubemx-lin-v6-10-0.zip
cd ..
rm en.stm32cubemx-lin-v6-10-0.zip
This gives me a "jre" directory and a big ELF executable:
-rwxr-xr-x 1 tom tom 488199355 Nov 20 21:31 SetupSTM32CubeMX-6.10.0
I do this:
su
./SetupSTM32CubeMX-6.10.0
This runs their setup wizard. It first tells me:
The homepage is at: https://www.st.com/stm32cube
Install path: /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX
Uninstaller program at: /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX/Uninstaller
And the install is done! Now how do I use it?
cd /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX
-rwxr-xr-x 1 root root 176187733 Nov 20 13:23 STM32CubeMX
So, we have a 176M sized ELF file here.

Someone said to read UM1718 (section 3.2 for linux installation). Probably a good idea, but as user "tom" I do this:

cd /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX
./STM32CubeMX
This works! It launches their GUI, but I see all kinds of chatter in the terminal window about downloads and an updater plugin being busy. I may just leave this gui up overnight, then do some reading and learning tomorrow. Whatever it is doing seems to encounter lots of errors, comments about a Server being unavailable -- but many things do seem to be getting updated. It even mentions CMSIS. As long as it doesn't fill up my disk beyond capacity, I'll be happy.

It sits for 10 minutes with no more messages, so I use File -- exit to shut it down and go to bed.

UM1718

This is the user manual for STM32CubeMX. It is 451 pages. I see the word "easy" repeated several times on the first page. The full file name is:
um1718-stm32cubemx-for-stm32-configuration-and-initialization-c-code-generation-stmicroelectronics.pdf

Setup for STM32H747

I use help -- manage embeeded software packages.
I click refresh -- it gets busy doing something.
I scroll down and find STM32H7
I click the little triangle to expand the list for this. It shows me a reverse chronological list of versions for the "MCU package for STM32H7). The latest is 1.11.1 and I select that, then click "Install" at the bottom.
I have to give my login credentials for ST. It downloads a 1G zip file.

I have 3 choices to start a new project. Start from MCU, start from board, start from example. I select start from board. It downloads stuff, then gives me a board list with 193 items.
I find and select STM32H747I-DISCO ($97), then click "start project". It loads an IOC file, then shows me a "pinout view". I can switch to system view. It also warns me that the project file (in /usr/local) is read only.
I use File -- Save and it wants to save to /home/tom.
I create "CubeMX" and tell it to save to /home/tom/CubeMX
It places the file "CubeMX.ioc" in this directory.

Middleware

Aha! A new buzzword. It's precise meaning depends on context. So what does it mean in the context of STM32CubeMX? On example (never mind a definition) is FreeRTOS. These may be synonymous with "expansion packages" as described in UM2285. Other examples are USB and FATfs. Here is a tidy definition:

"Middleware components are firmware layers that lie between the STM32 hardware and the user application."

Starting it

I put a script called "cube" in /home/tom/bin to start it.

Note that "makefile" is a code generation option. Use the "Project Manager" tab, then under "Toolchain/IDE" select "makefile" rather than EWARM (whatever the heck that is). Then click on "Generate Code". You have to set a project name and a path (project location). My first code generation with a makefile is in:

/home/tom/CubeMX/FirstDefaults
I generate code several times, deleting the results and then starting over. I find two options in the Project Manager worthwhile and important:
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org