cancel
Showing results for 
Search instead for 
Did you mean: 

There is a path bug in STM32CubeProgrammer v2.2.1 causing "Error: unknown or unsupported device (DevID = 0x0000)"

AGarf.1
Associate II

The command line STM32_Programmer_CLI looks for a database file using a relative path "../Data_Base/STM32_Prog_DB.xml". This causes the "Error: unknown or unsupported device (DevID = 0x0000)" and a segfault.

The command line tool should look for this "STM32_Prog_DB.xml" relative to the executables path rather than the current working directory.

To demonstrate this issue I have created the following example:

Here I am calling the command directly from the $PATH and you see the error

(Alans-MacBook-Pro)-(alan)-(~/projects/test)
(! 783)-> STM32_Programmer_CLI -c port=swd
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.2.1
      -------------------------------------------------------------------
 
ST-LINK SN  : 36FF72064D59303629401543
ST-LINK FW  : V2J33S7
Voltage     : 3.21V
SWD freq    : 4000 KHz
Connect mode: Normal
Reset mode  : Software reset
Cannot identify the device
Error: unknown or unsupported device (DevID = 0x0000)
Segmentation fault: 11

Now I move into the application directory and run the command in it's installed location:

Alans-MacBook-Pro)-(alan)-(~/projects/test)
(! 785)-> cd /Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin/
 
(Alans-MacBook-Pro)-(alan)-(/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin)
(! 786)-> ./STM32_Programmer_CLI -c port=swd
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.2.1
      -------------------------------------------------------------------
 
ST-LINK SN  : 36FF72064D59303629401543
ST-LINK FW  : V2J33S7
Voltage     : 3.21V
SWD freq    : 4000 KHz
Connect mode: Normal
Reset mode  : Software reset
Device ID   : 0x468
Device name : STM32G43x/G44x
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M4

It works as expected and no segfault.

Now I will add a symlink to the "STM32_Prog_DB.xml" relative to my test folder and show it works as expected indicating a bug:

(Alans-MacBook-Pro)-(alan)-(~/projects/test)
(! 790)-> ln -s /Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/Data_Base/ ../.
.././Data_Base -> /Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/Data_Base/
 
(Alans-MacBook-Pro)-(alan)-(~/projects/test)
(! 794)-> STM32_Programmer_CLI -c port=swd
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.2.1
      -------------------------------------------------------------------
 
ST-LINK SN  : 36FF72064D59303629401543
ST-LINK FW  : V2J33S7
Voltage     : 3.21V
SWD freq    : 4000 KHz
Connect mode: Normal
Reset mode  : Software reset
Device ID   : 0x468
Device name : STM32G43x/G44x
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M4

And it works just fine. Could someone at ST please look at fixing this bug, as it's nasty to have relative paths hardcoded into the util.

Thanks,

-A.

2 REPLIES 2
weswes
Associate

Hi AGarf,

This issue appears only on MacOs with this cubeProgrammer version.

the error message "Error: unknown or unsupported device (DevID = 0x0000)" being displayed if the device is not yet supported or the tool cannot parse the local data base.

the issue was fixed, try to use the newest version.

Thanks for your feedback

MPIPA.1
Associate II

Hi

We are also facing the same issue in V2.4.0 Windows 64 bit. with STM32L4 Series microcontroller.

Regards,

Mukund