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


Problems with OpenOCD

I just developed the product and meet the deadline, released the code to Testing.

Now I need to make some changes, but I can’t get the debugger to run on the Nucleo-32.

I keep getting “Error erasing flash with vFlashErase packet”.

The OpenOCD console reports:

in procedure ‘reset’
in procedure ‘ocd_bouncer’

Error: Target not halted
Error: failed erasing sectors 0 to 5
Error: flash_erase returned -304
Error: address + si


I ran ST-LINK and erased the code on the processor, the erase was successful, the processor (STM32L031K6) is now blank.

I’ve unplugged the Nucleo board several times and I’ve reboot the computer 3 times.

I don’t know if rebooting helps, but I don’t know anything else I can do.

Part of the frustration is that there is no information on what to do or what could be wrong, it took some digging to figure out that OpenOCD was causing problems.

We need some information on how to debug this issue - how these pieces work together.

It’s all just a mystery.

-Matt

Running OpenOCD on the command line with debug turned on yields this:

Debug: 212 420 command.c:145 script_debug(): command - ocd_ransport ocd_transport init
Debug: 214 420 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 215 420 hla_transport.c:154 hl_transport_init(): hl_transport_init
Debug: 216 420 hla_transport.c:171 hl_transport_init(): current transport hla_swd
Debug: 217 430 hla_interface.c:44 hl_interface_open(): hl_interface_open
Debug: 218 430 hla_layout.c:42 hl_layout_open(): hl_layout_open
Debug: 219 430 stlink_usb.c:1602 stlink_usb_open(): stlink_usb_open
Debug: 220 430 stlink_usb.c:1619 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial:
Error: 221 566 stlink_usb.c:1632 stlink_usb_open(): open failed
Debug: 222 566 hla_layout.c:49 hl_layout_open(): failed
Debug: 223 566 command.c:628 run_command(): Command failed with error code -4
User : 224 576 command.c:689 command_run_line(): in procedure ‘init’in procedure ‘ocd_bouncer’
Debug: 225 576 command.c:628 run_command(): Command failed with error code -4
User : 226 576 command.c:689 command_run_line():
Debug: 227 576 hla_interface.c:119 hl_interface_quit(): hl_interface_quit


That is the correct USB device, ST-LINK has no problems opening it. I am sure ST-LINK is not running when I run OpenOCD.

Don’t know why the stlink_usb_open would fail.

Another programmer here says he has had problems after running released code (which I did) because the options bits were set to protect the device.

But ST-LINK can erase the device, and ST-LINK says the device is not protected.

-Matt


Wrong 1 of the unused kit works!

Found the default OpenOCD config file for the STM32L0xx processor in the AC6 directory and changed the debug configuration from Manual ‘ST-LinkV2-1’ / ‘SWD’ to ‘Use local script’.

Now I get a different error:

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
localhost:3333: The system tried to join a drive to a directory on a joined drive.
localhost:3333: The system tried to join a drive to a directory on a joined drive.


From the OpenOCD console:

Open On-Chip Debugger 0.10.0-dev-00270-g7ec9836 (2016-05-18-14:26)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Error: Debug adapter does not support any transports? Check config file order.
Error: unable to select a session transport. Can’t continue.
shutdown command invoked


So it looks like it can’t find the transports file.


-Matt


WOW! After trying the cfg file and failing, I went back to Manual ‘ST-LinkV2-1’ / ‘SWD’

AND NOW IT WORKS!

biggrin


After lunch it no longer works again.

Also, ST-LINK also does not work. ST-LINK says “no ST-LINK device attached”. And the RED/GREEN LED stops blinking.

I suspect this is an ST problem.


I think I finally found the problem!!

Looks like there is a ground-loop via my logic analyzer.

As soon as I unplug the analyzer - everything works!

Who’da thought?