2024-08-20 07:39 AM
Using STMCubeMX 6.12.0
We're hoping to setup a CI pipeline using the CubeMX command line functionality and are having problems downloading and installing FW packages among other things.
I've followed the connection setup instructions and get the green check mark saying it works.
I've found that interactive mode described in the manual does not work. As suggested in this post it does in fact launch into the CubeMX application/IDE. As I understand the following command should result in a MX> prompt but does not.
& "$env:STM32CubeMX_PATH\jre\bin\java" -jar "$env:STM32CubeMX_PATH\STM32CubeMX.exe" -i
The manuals suggest using the following commands to download and install FW packages:
I've placed those commands in a script
swmgr install stm32cube_f4_1.28.0 ask
exit
and executed the scrip via PowerShell:
& "$env:STM32CubeMX_PATH\jre\bin\java" -jar "$env:STM32CubeMX_PATH\STM32CubeMX.exe" -q .\myscript
Which results in the following error:
..... [Lots of noise omitted]
swmgr install stm32cube_f4_1.28.0 ask
2024-08-20 10:19:19,160 [INFO] UserAuth:417 - Internet connection configuration mode: 1
2024-08-20 10:19:19,170 [INFO] JxBrowserEngine:152 - Initiate JxBrowser Engine with user profile folder
..... [Lots of noise omitted]
2024-08-20 10:19:21,568 [INFO] WebApp:578 - Web application path used jar:file:/C:/Program%20Files/STMicroelectronics/STM32Cube/STM32CubeMX/STM32CubeMX.exe!/db/plu
gins/mcufinder/reactClient1/index.html
This download action requires prior login. To proceed, please use the 'login' command with your my.st.com account email and password.
Run 'login <email> <password> <remember_me>' for example 'login john.smith@st.com mypassword y'.
If you do not have a my.st.com account, please visit https://st.com website to create one.
KO
exit
Bye bye
Note the error saying the login command is required. So I add the login command before the install as it requests.
login some.user@mycompany.com myPassword y [actual credentials omitted of course]
swmgr install stm32cube_f4_1.28.0 ask
exit
For which I now receive this error:
..... [Lots of noise omitted]
2024-08-20 10:24:45,580 [INFO] UserAuth:179 - activating auth plugin
login some.user@mycompany.com myPassword y [actual credentials omitted of course]
Usage:
log
log <level>
set
import
ocxtest
ocxt <opt_ide:all|iar|keil|sw4> <opt_copy_fw:NONE|LITE|FULL> <opt_usr_cubex_path: open cube example test
MultiConfig
load
load <mcu>: open mcu xml file
get
lock
reset
clearpinout
clearpinout: remove all the pin mapping
possible_value
not_a_possible_value
add
check
csv
generate
tinyload
tinyload <mcu>: load mcu for pinout only
waitclock
Wait for a delay in seconds until clock has finished its initialization
switch
unset
export
list
loadboard
loadboard <boardname> <allmodes>]|<nomode> load a board with or without modes
project
setDriver
set Ip driver
SetStructure
Set Application structure (Advanced/Basic).
SetCopyLibrary
Set Copy Library (copy all/ copy only / copy as reference).
pinout
disable2024-08-20 10:24:45,583 [INFO] UserAuth:417 - Internet connection configuration mode: 1
tooltip
clock
updateIpUI
update UI <IpName>: update the UI for a given IP
swmgr
user_analytics
user_analytics <true|false>
config
simulate
isPluginError
isPluginError <pluginName>, where pluginName can be "Clock Configuration", "Pinout & Configuration"
exit_mx
exit_mx: leave mx same way than exit menu
setprop
set a system property: setprop <property> <value>
getprop
get a system property: getprop <property>
getenv
get an environment variable: getenv <variable>
xcopy
xcopy
<sw_vendor>
<sw_version>
<example_name>
<example_path>
<ide:all|iar|keil|swb|cube> default:all
<copy_fw:NONE|LITE|FULL> default:LITE
<opt:user_example_path> default:$HOME/STM32CubEX
<opt:fw_path> default:$HOME/STM32Cube/Repository
<opt:board_name> default: empty
Description: Open cube example test
Example: xcopy "STMicroelectronics" "X-CUBE-BLE2_V3.2.0" "Beacon" "/Projects/NUCLEO-L476RG/Applications/Beacon" "all" "LITE" "" "" "NUCLEO-L476RG"
xts
example testsuite
xtest
xtest <args> : example test command
xbuild
xbuild <project_path>
Description: automatic build command
Example: xbuild "C:\Users\chaumont\STM32Cube\Example\CORTEX_MPU"
popupwrapper
xcubedl
xcubedl <packname> : X-CUBE Download
Help
help: Print Help
Exit
exit: Exit process
script
script <file>: execute all command in file
KO
swmgr install stm32cube_f4_1.28.0 ask
..... [Lots of noise omitted]
The login command appears to be unsupported because it's execution results in the help command output being displayed. Odd, that login is not supported, the previous swmgr command specifically calls it out as necessary (as I showed above) and it's also described in the manual.
Can someone help me understand what I'm actually supposed to do here to download packages? Seems the command line has issues.
2024-08-20 10:17 AM
Manually download all the Cube related install files and store them locally. Have you CI commands install from these local copies. Trying to download stuff from the web in you CI will cause you nothing but headaches.
2024-08-20 10:30 AM - edited 2024-08-20 10:31 AM
Are you suggesting roll my own un-zip routine? i.e. Is manually unzipping the file into the STM32Cube Repository all that's needed?
It seems the swmgr install command is functionally useless anyway as according to the usage I can only (deny|ask) the package license. There is no accept option?
Usage:
swmgr swmgr install <full_cmsispack_name | full_firmware_name | full_filepath> <licence_mode (deny|ask)>: install specified Cmsis packname or Cube Firmware with se
lected license accept mode.
ask - negates the entire concept of command line where you don't want to interact with a UI as it pops up the license acceptance dialog and freezes for user input.
deny - downloads the package (yes, goes through the entire download) and then tosses it out because you automatically deny the license. So net is a NOOP where you downloaded an 800Mb file. Seriously, who actually authored this API and what possible use case does this represent?
2024-08-20 01:31 PM - edited 2024-08-20 09:20 PM
Package installation essentially involves downloading a zip file and unpacking it into the appropriate CubeIDE "repository" directory (The path is configurable/specified inside the CubeIDE/eclipse options). There's no more to it than that. When CubeIDE starts up (perhaps even on-demand, not sure of exact behavior), CubeIDE looks inside the repository for the MCU package directory and picks up the XML metadata file inside it to identify what's available. That's all there is to "installation" AFAIK.
Every MCU package zip file (you have to login to download) derives from a public github repo provided by ST. I suggest you experiment with manually installing an MCU package from the github repo (*), and once you nail the details down, script that into your CI pre script. You're much better off using github as your CDN, then ST's website (it would also make sense do download a release zip from the github repo rather than needlessly cloning all the history).
(*) more specifically, I recommended first manually installing using the zip file (+patch zip) from the ST website and making sure the package manager identifies the install after restart. Once you have that install directory as a working reference, move on to recreating the same thing but using a more CI-friendly git clone/ or github zip+unpack as the download source.
Past threads about CubeMX as CLI/in CI context (aka "headless"):
https://community.st.com/t5/stm32cubemx-mcus/running-stm32cubemx-without-gui/td-p/682596
2024-08-28 04:01 AM
I thought someone from ST would comment on the command errors pointed out in the OP but that hasn't happened. Should I expect comment from an ST employee on these forums or do I need to actually submit a technical support ticket with them for situations like this?
2024-08-28 08:50 AM - edited 2024-08-28 09:16 AM
ST employees occasionally chime in, but you shouldn't expect it. If you want a response from ST support then yes, you should open a ticket on OLS.