Table of contents
- Flashing the firmware with STM32CubeProgrammer
- Install STM32CubeProgrammer on MacOS (by Andrew Davie)
- Install STM32CubeProgrammer on Linux (by Bruce-Robert Pocock)
- Additional Install Information for Linux (by Stephen Illingworth)
Flashing the firmware with STM32CubeProgrammer
For flashing of the firmware there is no ST-Link or other hardware necessary, only a micro USB cable and the STM32CubeProgrammer is required. Downloading the STM32CubeProgrammer is free of charge (which is quit clear, because you have bought 1 of their chips), but you may have to register at the STM website.
For connecting with the STM32CubePorgrammer the boot0 jumper has to be removed (and boot1 has to be short!), sometimes the reset button beside the USB connector has to be pressed for 5 seconds, to establish the connection.
After connecting the STM32F407VGT6 breakout board, you can flash with the STM32CubeProgrammer like this:
- Switch to the "Erasing & Programming" tab
- Scan the USB Ports for your device
- Connect your Device
- Select the downloaded PlusCart.elf file
- Push the "Start Programming" button
- After the "File download complete" message press the "Disconnect" button ( see 3. )
- Disconnect the USB cable and short boot0 again
STM32CubeProgrammer screenshot
Install STM32CubeProgrammer on MacOS (by Andrew Davie)
- Install homebrew - this is a package management tool for MacOS
- Via homebrew, Install jenv - this allows you to manage multiple java versions on MacOS.
From the terminal (% prompt from now on - type what's after the %)...
% brew install jenv
- Install Oracle Java8
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
You will need to regiser with Oracle to be able to download
jdk-8u261-macosx-x64.dmg Once you install the DMG file via double-click, you need to "register" the Java version with jenv...
% jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
Of course change that java version name if it's different from what's shown above.
Now, to see the versions of Java available through jenv...
% jenv versions
* system
oracle64-1.8.0.261
The "*" indicates which version is currently active.
To switch globally to the oracle version (which you need to do)...
% jenv global oracle64-1.8.0261
... or whatever it's called in the versions list above
Check to see which version jenv has set for global use...
% jenv versions
system
* oracle64-1.8.0.261 (set by /Users/boo/.jenv/version)
OK, so it's now using oracle java we downloaded. To test...
% java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
OK, once that's done, you can proceed with installation of the STM32CubeProgrammer
This is the correct way to do that....
Change to the directory wherever you extracted the zip file...
% cd ~/Downloads/en.stm32cubeprog_v2-5-0
Then issue the following command to start the installation...
% sudo java -jar SetupSTM32CubeProgrammer-2.5.0.exe
Of course, be sensible about version numbers - use the correct name for the file you downloaded.
This will now (after a short delay) start running the STM GUI installer
And it should all be hunky dory from then on.
Install STM32CubeProgrammer on Linux (by Bruce-Robert Pocock)
For the record, the download site provides a Linux® flasher as well.
I found I had to find the device and give permission to write to it — I just gave it to everyone, but there are smarter ways to do that.
% lsusb
…
Bus 003 Device 072: ID 0483:df11 STMicroelectronics STM Device in DFU Mode
…
% sudo chmod a+rw /dev/bus/usb/003/072
Only launch the STM32 programmer after changing modes, then follow the directions as per Windows.
I did, as mentioned, also remove the jumper and hold the reset button for some time.
And — it worked!
Additional Install Information for Linux (by Stephen Illingworth)
The instructions for changing the permissions of the PlusCart on Linux are great but fiddly to do every time the device is plugged in. According to Stephen Illingworth (AtariAge user JetSetIlly) there's a better way that will work every time once the initial setup is complete.
1) Check that you have a normal PlusCart with 'lsusb':
There should be a line in the output that looks like this (the Bus and Device values may be different)
Bus 003 Device 072: ID 0483:df11 STMicroelectronics STM Device in DFU Mode
It is the ID which we're interested in. For a normal PlusCart the Vendor ID is 0483 and the Product ID is df11.
Note: The PlusCart may need to be reset for it to be visible in the list. Press and hold the button near the USB socket for a few seconds.
2) Create a udev rule to automatically set the correct permissions:
Create a new text file in /etc/udev/rules.d named 99-pluscart.rules. This direcrtory is root only so you need to create the file with sudo. If you don't know how to use sudo then pause here and learn about it.
sudo vim /etc/udev/rules.d/99-pluscart.rules
Or if you don't like vim, another text editor like nano
sudo nano /etc/udev/rules.d/99-pluscart.rules
Add the following to the file
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0483", ATTR{idProduct}=="df11", MODE="0660", GROUP="users"
3) Restart udev:
sudo udevadm control --reload-rules
sudo udevadm trigger
The PlusCart will now have the correct permissions whenever it is plugged in. Remember that the PlusCart may need to be reset with the button near the USB port for it to be correctly inserted.