Skip to main content
Explorer
October 6, 2021
Solved

STM32CubeProgrammer cannot connect to STM32MP157F DK2 (Ubuntu 20.04)

  • October 6, 2021
  • 5 replies
  • 1225 views

Hi!

I am following the instructions of this wiki page:

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Let%27s_start/Populate_the_target_and_boot_the_image

I have the DK2 connected to my system using the USB OTG port.

The boards dip switches are in the correct position.

I copied the udev rules to /etc/udev/rules.d/.

Pressing "Connect" results in following error:

 16:44:36 : STM32CubeProgrammer API v2.8.0
 16:50:03 : USB speed : High Speed (480MBit/s)
 16:50:03 : Manuf. ID : STMicroelectronics
 16:50:03 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
 16:50:03 : SN : 003300293030510D32313933
 16:50:03 : FW version : 0x0110
 16:50:03 : Device ID : 0x0500
 16:50:03 : Error: CUBEPROGRAMMER_ERROR_NOT_SUPPORTED

What am I doing wrong?

Thank you in advance,

Gunther

0693W00000FBf5xQAD.png

    This topic has been closed for replies.
    Best answer by GLaure

    Hi Kevin,

    Good morning!

    The issue is rather trivial. If you change to its bin folder before starting it 2.8.0 works.

    cd ~/STM32MPU_workspace/STM32MPU-Tools/STM32CubeProgrammer-2.8.0/bin
    ./STM32CubeProgrammer &

    If it is started from another path , the app returns this error and connect fails:

    STM32MPU-Tools/STM32CubeProgrammer-2.8.0$ ./bin/STM32CubeProgrammer
    jar:file:/home/glaure/Development/SW_APP/nexio_stm/STM32MPU-Tools/STM32CubeProgrammer-2.8.0/bin/STM32CubeProgrammerLauncher!/fxml/Config.fxml
    Error occurred while parsing external Loader list
    An error occurred.
    java.io.FileNotFoundException: /home/glaure/Development/SW_APP/nexio_stm/STM32MPU-Tools/STM32CubeProgrammer-2.8.0/version (Datei oder Verzeichnis nicht gefunden)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(FileInputStream.java:195)
    	at java.io.FileInputStream.<init>(FileInputStream.java:138)
    	at java.util.Scanner.<init>(Scanner.java:611)
    	at com.st.updaterManager.Utility.getProgrammerVersion(Utility.java:178)
    	at com.st.updaterManager.Utility.setIniParameters(Utility.java:331)
    	at com.st.controllers.MainWindowController.initialize(MainWindowController.java:900)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
    	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
    	at com.st.app.Main.start(Main.java:52)
    	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:769)
    	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
    	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
    	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
    	at java.lang.Thread.run(Thread.java:748)
    1.0.0

    It was just coincidence that 2.7.0 worked on my first try. The STM32CubeProgrammer startup script is missing the prefix $DIR variable to start the jre.

    If this is fixed, it fails the same way as 2.8.0, when started from other working directories.

    Hope that helps when you try to fix this issue.

    Bye Gunther

    5 replies

    GLaureAuthor
    Explorer
    October 6, 2021

    If I additionally connect the ST-LINK USB cable, the STM32CubePorgrammer app crashes:

    libusb: error [udev_hotplug_event] ignoring udev action bind
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0x00007f440cd934bd, pid=150847, tid=0x00007f43e28f8700
    #
    # JRE version: OpenJDK Runtime Environment (8.0_265-b01) (build 1.8.0_265-b01)
    # Java VM: OpenJDK 64-Bit Server VM (25.265-b01 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # C [libCubeProgrammer_API.so+0xac4bd] USBInterface::connect(QString, unsigned char, bool)+0x17d
    #
    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    #
    # An error report file with more information is saved as:
    # /home/glaure/Development/SW_APP/nexio_stm/hs_err_pid150847.log
    #
    # If you would like to submit a bug report, please visit:
    # http://bugreport.java.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #
    ./STM32MPU-Tools/STM32CubeProgrammer-2.8.0/bin/STM32CubeProgrammer: Zeile 4: 150847 Abgebrochen (Speicherabzug geschrieben) $DIR/jre/bin/java -jar $DIR/STM32CubeProgrammerLauncher

    GLaureAuthor
    Explorer
    October 6, 2021

    I have more information:

    STM32CubeProgrammer-2.7.0 works, but STM32CubeProgrammer-2.8.0 does not.

    But 2.7.0 still crashes when ST-LINK is also connected.

    0693W00000FBfHtQAL.png

    Technical Moderator
    October 6, 2021

    Hello @GLaure​ ,

    I recently reinstalled my Ubuntu 20.04 and I encountered the same issue with exactly the same error. And it was also working with the version 2.7.0.

    To correct the error, I removed the folder and made again the installation. I had surely made a manipulation error

    rm -rf ~/STM32MPU_workspace/STM32MPU-Tools/STM32CubeProgrammer-2.8.0/

    Extract again the zip file of the STM32CubeProgrammer-2.8.0

    unzip en.stm32cubeprg-lin_v2-8-0_v2.8.0.zip

    Start the setup script:

    ./SetupSTM32CubeProgrammer-2.8.0.linux

    Run the binary:

    ./STM32CubeProgrammer &

    0693W00000FBfjUQAT.png0693W00000FBflZQAT.png 

    Please can you remove and install again your STM32CubeProgrammer-2.8.0 and tell me how it is behaving?

    We will investigate the STLink issue later if you still have this problem.

    Thanks,

    Regards,

    Kévin

    Edit: A sentence was missing

    GLaureAuthorAnswer
    Explorer
    October 7, 2021

    Hi Kevin,

    Good morning!

    The issue is rather trivial. If you change to its bin folder before starting it 2.8.0 works.

    cd ~/STM32MPU_workspace/STM32MPU-Tools/STM32CubeProgrammer-2.8.0/bin
    ./STM32CubeProgrammer &

    If it is started from another path , the app returns this error and connect fails:

    STM32MPU-Tools/STM32CubeProgrammer-2.8.0$ ./bin/STM32CubeProgrammer
    jar:file:/home/glaure/Development/SW_APP/nexio_stm/STM32MPU-Tools/STM32CubeProgrammer-2.8.0/bin/STM32CubeProgrammerLauncher!/fxml/Config.fxml
    Error occurred while parsing external Loader list
    An error occurred.
    java.io.FileNotFoundException: /home/glaure/Development/SW_APP/nexio_stm/STM32MPU-Tools/STM32CubeProgrammer-2.8.0/version (Datei oder Verzeichnis nicht gefunden)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(FileInputStream.java:195)
    	at java.io.FileInputStream.<init>(FileInputStream.java:138)
    	at java.util.Scanner.<init>(Scanner.java:611)
    	at com.st.updaterManager.Utility.getProgrammerVersion(Utility.java:178)
    	at com.st.updaterManager.Utility.setIniParameters(Utility.java:331)
    	at com.st.controllers.MainWindowController.initialize(MainWindowController.java:900)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
    	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
    	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
    	at com.st.app.Main.start(Main.java:52)
    	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:769)
    	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
    	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
    	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
    	at java.lang.Thread.run(Thread.java:748)
    1.0.0

    It was just coincidence that 2.7.0 worked on my first try. The STM32CubeProgrammer startup script is missing the prefix $DIR variable to start the jre.

    If this is fixed, it fails the same way as 2.8.0, when started from other working directories.

    Hope that helps when you try to fix this issue.

    Bye Gunther

    Technical Moderator
    October 7, 2021

    Hi @GLaure​ ,

    Thank you for your help on this issue.

    You are right, I was able to reproduce the problem on my Ubuntu. I even reproduced the crash related to ST-link if I run the STM32CubeProgrammer  from the folder just before bin, the folder STM32CubeProgrammer-2.8.0.

    I will make a ticket to our developer team to talk about this problem.

    Thanks again,

    Regards,

    Kévin