cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable production mode debugging in Yocto

mjuels
Associate III

Hi,

I have an STM32MP157d-dk1 board, which I am flashing with a Yocto Kirkstone, core-image-minimal image.

I am trying to enable production mode debugging of the M4 through STM32CubeIDE, but so far without success.

I have added ssh and sftp to my local.conf file:

IMAGE_INSTALL:append = " module-init-tools openssh "
EXTRA_IMAGE_FEATURES ?= "debug-tweaks tools-debug eclipse-debug ssh-server-openssh"
CORE_IMAGE_EXTRA_INSTALL += "openssh-sftp openssh-sftp-server"

and I have loaded the USB Gadget Ethernet module on the MP1:

modprobe g_ether dev_addr=12:34:56:78:9a:bc host_addr=12:34:56:78:9a:bd
ifconfig usb0 192.168.7.1 netmask 255.255.255.0

I have configured my debugging profile to use "thru Linux Core" and set it up with the proper IP.

When trying to connect to the board from CubeIDE, it stays in yellow light, with either status "Status: Idle" or "Status: Busy", but never gets a green light.

If I start the debugger, it says "Configured inet address '192.168.7.1' not reachable"

mjuels_0-1699739248730.png

Everything works as expected if I build and flash one of the official images from openstlinux, so what am I missing in my plain yocto build to enable the debugging?

1 ACCEPTED SOLUTION

Accepted Solutions
mjuels
Associate III

I figured it out (more or less).

I followed the guide available here:

https://linuxlink.timesys.com/docs/wiki/engineering/HOWTO_Use_USB_Gadget_Ethernet

After modprobe, and ifconfig on the board side, both the board, and my host computer gets an additional 'usb0' interface.

The step I missed was that I need to manually set the IP for the host side interface, which is also mentioned in the guide above.

This is not necessary when the board runs openstlinux - I guess openstlinux includes some DHCP stuff or similar, that is not part of core-imiage-minimal, so I still have to figure this out.

After setting IP on my host PC interface, I can ping the board over the usb0 interface, and I am able to connect to it and debug in production mode via cubeIDE

View solution in original post

3 REPLIES 3
Olivier GALLIEN
ST Employee

Hi @mjuels ,

 

ST official image aka Starter Kit is an st-image-weston and not a core-image-minimal. 

Some required services maybe still missing on your image.

Did you succeed to ping or ssh the board out of CubeIDE ? 

 

Olivier 

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Olivier GALLIEN ,

Thank for your reply.

Is there a special way to ping via CubeIDE? The only suggestion I have been able to find was to open a local serial console via: "Window -> Show view -> Other -> Connections -> Connections -> Local"

From this terminal, I cannot ping the board when it is running my custom build of core-image-minimal. I cannot ping the board from a regular linux terminal either.

When the board is running the openstlinux images, I can ping the board just fine, either way.

For my core-image-minimal build, after I run:

modprobe g_ether
ifconfig usb0 192.168.7.1 netmask 255.255.255.0

the output of ifconfig looks just fine:

mjuels_0-1700169549874.png

Any suggestions?

Best regards!

 

mjuels
Associate III

I figured it out (more or less).

I followed the guide available here:

https://linuxlink.timesys.com/docs/wiki/engineering/HOWTO_Use_USB_Gadget_Ethernet

After modprobe, and ifconfig on the board side, both the board, and my host computer gets an additional 'usb0' interface.

The step I missed was that I need to manually set the IP for the host side interface, which is also mentioned in the guide above.

This is not necessary when the board runs openstlinux - I guess openstlinux includes some DHCP stuff or similar, that is not part of core-imiage-minimal, so I still have to figure this out.

After setting IP on my host PC interface, I can ping the board over the usb0 interface, and I am able to connect to it and debug in production mode via cubeIDE