Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Debug the NUCLEO-L476RG in linux

The System Workbench for STM32 and CubeSTM32 declare to support the NUCLEO-L476RG I have an issue on debug.
I imported very simple code from Cube to SW, compiled and linked (no errors).
When debugging and downloading the code I get the following error:

Error message from debugger back end:
localhost:3333: Connection timed out.

Launching Eclipse from the terminal we can see the complete command string composed by eclipse to run the debugger:

OpenOCD launch command (run in /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board):
/home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.8.0.201603291120/tools/openocd/bin/openocd -f nucleo_l476rg.cfg -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts -c gdb_port 3333

adding to this string a log-file and debug options (-l mylog -d), the command will be:

/home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.8.0.201603291120/tools/openocd/bin/openocd -f nucleo_l476rg.cfg -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts -l mylog.log -d -c gdb_port 3333

We can run this command from terminal after changing the directory to
/home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board
The last lines of the log file are in my case:

Info : 248 12 core.c:1388 adapter_init(): clock speed 1800 kHz
Debug: 249 12 openocd.c:137 handle_init_command(): Debug Adapter init complete
Debug: 250 12 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 251 12 command.c:145 script_debug(): command - ocd_transport ocd_transport init
Debug: 253 12 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 254 12 hla_transport.c:154 hl_transport_init(): hl_transport_init
Debug: 255 12 hla_transport.c:171 hl_transport_init(): current transport hla_swd
Debug: 256 12 hla_interface.c:44 hl_interface_open(): hl_interface_open
Debug: 257 12 hla_layout.c:42 hl_layout_open(): hl_layout_open
Debug: 258 12 stlink_usb.c:1697 stlink_usb_open(): stlink_usb_open
Debug: 259 12 stlink_usb.c:1714 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374b serial:
Error: 260 15 stlink_usb.c:1727 stlink_usb_open(): open failed
Debug: 261 15 hla_layout.c:49 hl_layout_open(): failed
Debug: 262 15 command.c:628 run_command(): Command failed with error code -4
User : 263 15 command.c:689 command_run_line(): in procedure ‘init’
in procedure ‘ocd_bouncer’
Debug: 264 15 command.c:628 run_command(): Command failed with error code -4
User : 265 15 command.c:689 command_run_line():
Debug: 266 15 hla_interface.c:119 hl_interface_quit(): hl_interface_quit

so the problem seems to be the communication link between the ocd-server and the st-link/v2-1,
but I am not able to investigate further.

Thx.

Following the error in the source file stlink_usb.c
we can find that it is captured in the following lines

if (jtag_libusb_open(vids, pids, serial, &h->fd) != ERROR_OK) {
1632 LOG_ERROR(“open failed”);
1633 goto error_open;

following jtag_libusb_open in the source file libusb0_common.c
the error is generated by the function usb_open(dev)
Unfortunately
- the usb device is regularly enumenrated
- the permissions are normally write in the file /etc/udev/rules.d/49-stlinkv2.rules

SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0483”, ATTRS{idProduct}==”3748”, \
MODE:=”0666”, \
SYMLINK+=”stlinkv2_%n”

- the libusb-dev is installed (of course)

So I’m still searching a solution, pls help.


Sorry to be very long and dispersive.
I read the USB port with a c simple test code with the following result:

bus/device idVendor/idProduct
002/004 0483/3748

- Manufacturer : STMicroelectronics
- Product : STM32 STLink
- Serial Number: 0672FF515456707067072452

wTotalLength: 39
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: 80h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 3
bInterfaceClass: 255
bInterfaceSubClass: 255
bInterfaceProtocol: 255
iInterface: 4
bEndpointAddress: 81h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 02h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 83h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0

this means that all the permissions are right and the function usb_open(dev) works fine.
Now I really do not know what else to try.




Tunisia

Glad to here that your problem is solved.

But could you please specify the firmware version that caused the problem ?