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


Another debug launch and target program/erase failure......

I cannot get the debug or target-program/erase working, despite reading the many threads here on this subject.

Using a Nucleo F401 as a target (with built in ST-link), this can be accessed by the st-link util and Co-ide no problem.
Using system workbench I get.....


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.



For debug configuration I have tried the default script (lists it as nucleo_f401re.cfg), manual spec selecting ST-LinkV2 and ST-LinkV2-1 and manual script with the following:


source find interface/stlink-v2.cfg
set WORKAREASIZE 0x18000
transport select “hla_swd”
source find target/stm32f4x_stlink.cfg
reset_config none



All give the same error.

if I try a target->erase.....
I get the following error:


10:59:38 **** Erasing chip ****
“C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.openocd.win32_1.10.0.201607261143\tools\openocd\bin\openocd.exe” -f nucleo_f401re.cfg -s “C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.10.0.201607251855\resources\openocd\scripts\st_board” -s “C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.10.0.201607251855\resources\openocd\scripts” -c init -c “reset halt” -c “flash erase_sector 0 0 last” -c exit
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
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ‘.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: open failed
in procedure ‘init’
in procedure ‘ocd_bouncer’


10:59:38 Build Finished (took 291ms)...page...



I have noticed that every time I do this it creates a new debug script with a default script but the config script says “SCRIPT NOT FOUND”.

Any ideas? I am trying to migrate from Co-ide but so far this a show stopper...:(

ps. how do you block quote on this forum? It would make my post much easier to read......

EDIT: forgot to say, win7 with a clean, up to date installation as of yesterday.

Hello,

Did you update the software: menu Help => Check for update

The nucleo F401re has a Stlink V2-1, not V2.
So, use the default script that is inside the software (nucleo_f401re.cfg).

The error you get is “open failed” at the begining so i suspect a libusb issue.

Either you have another session not terminated, either the driver is not installed correctly ? admin rights ?
Or you didn’t close the STlink connection on another software ?

Rgds,
Laurent


> Did you update the software: menu Help => Check for update
Yes.So should be fully up to date.

>The nucleo F401re has a Stlink V2-1, not V2.
> So, use the default script that is inside the software (nucleo_f401re.cfg).
Thanks, but it made no difference whether I used default (nucleo_f401re.cfg) or manual Stlink V2-1.
Although I have found there are 4 copies (and two versions) of nucleo_f401re.cfg installed.
Paths are:
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.10.0.201607251855\resources\openocd\scripts\st_board
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.10.0.201607251855\resources\openocd\scripts\board
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts\st_board
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts\board
I am not sure which one it will pick up as the default?

> The error you get is “open failed” at the begining so i suspect a libusb issue.
> Either you have another session not terminated, either the driver is not installed correctly ? admin rights ?
> Or you didn’t close the STlink connection on another software ?
Would these things cause both the debug error as well as the target-erase... error?
I have checked the task manager, there are no st link apps or processes running. I am running something else at the moment but as soon as it is done I will do a reboot to double check but I doubt this is it.
I am using an admin account so again, this should not be a problem?
The stlink is shown as “StMicroelectronics STLink dongle” under “universal serial bus devices”. Driver used is “c:\windows\system32\DRIVERS\winusb.sys” version 6.1.7601.17514.
Any problems there?

Thanks for your help so far!
Toby

Ok, v1.10.0 is the latest version.

Driver is ok and since you can use STLink utility, it is ok on this side.

I said to not let an STLink connection active on another software (like Stlink utility) or another ide like co-ide because you can only have 1 STLink connection active.

Reboot the disco (and the PC) and try again.
Win 7, 64 or 32 bits ?

The error message “open failed”, you get it when no stlink board is connected.

And if i let a STLink utility connected, i have the libusb error access added on the message:

Info : clock speed 1800 kHz
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed
in procedure ‘init’
in procedure ‘ocd_bouncer’


Rgds,
Laurent


> Ok, v1.10.0 is the latest version.
great.
> Driver is ok and since you can use STLink utility, it is ok on this side.
great
> I said to not let an STLink connection active on another software (like Stlink utility) or another ide like co-ide because > > you can only have 1 STLink connection active.
> Reboot the disco (and the PC) and try again.
Rebooted and still get the same problems....... :-(

> Win 7, 64 or 32 bits ?
64bit

> The error message “open failed”, you get it when no stlink board is connected.
> And if i let a STLink utility connected, i have the libusb error access added on the message:
> Info : clock speed 1800 kHz
> Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
> Error: open failed
> in procedure ‘init’
> in procedure ‘ocd_bouncer’

I assume this is when doing a target-erase or similar, rather than debug? In which case that is similar but not the same. I get no mention of libusb_open()
I just disconnected my nucleo board (so no st link present) and get exactly the same errors as I posted above. Not sure what that tells me though....

EDIT: I just re-read your last post. So
“Error: open failed” on its own means no stlink is not connected.
and “Error: libusb_open() failed with LIBUSB_ERROR_ACCESS. Error: open failed” means stlink util is still connected?

So my errors are saying it cannot find any connected stlink? Correct?

Thanks
Toby

OK, i have also a win 7 64 bits but it should work fine on 32 bits.


These error msg are the same for Debug or Target-erase, it is openocd error when connecting to the stlink.

Yes, i have the same, only “open failed” when no stlink connected.

And if Stlink utility is used and not closed (session not disconnected), SW4STM32 start debug will show the libusb error msg before “open failed” saying the usb (stlink) is already accessed by someone else.


Maybe try another usb port.

There have been in the past some issues on usb with a renesas usb driver to update on some pc.
I don’t know if they were working fine with stlink utility like you.
Check all usb port and drivers.

It’s like the libusb is not used on your case, maybe a path issue.
I don’t know if co-ide is using libusb, could it be the issue ?


ok, thanks. I will check my usb ports/drivers etc. I might also try this on a different machine.

I am not sure if I will get his done today but I will be back if I am still having issues ;)

Toby


A quick update on this.....

I’ve removed workbench, all STm device drivers and re-installed. Still the same issue.

I have also done a clean install on a laptop with a clean install of windows 10 64 bit. (ie no ST link, coide or any other previous STM stuff). Same issue.

Any ideas gratefully received.......


hmmm.. ignore that last post. I have been an idiot......... :-(

The clean install on the laptop DOES work! It helped when I plugged the target into the laptop rather than my main pc!

So, all I need to do is getting it working on my development PC.
Both have clean installs as of today (both checked for updates).
Laptop (that works) is windows 10 x64. target appears as a “ST-Link Debug” with 3 driver files listed:
c:\WINDOWS\system32\DRIVERS\winusb.sys (v 10.0.10586.0)
c:\WINDOWS\system32\WdfCoInstaller-1009.dll (v1.9.7600.16385)
c:\WINDOWS\system32\WinUSBCoinstaller2.dll (v6.1.7600.16385)

PC (that does not work) in windows 7 x64. target appears as “STMicroelectronics STLink Dongle” with 3 driver files listed:
c:\WINDOWS\system32\DRIVERS\winusb.sys (v 6.1.7601.17514)
c:\WINDOWS\system32\WdfCoInstaller-1009.dll (v1.9.7600.16385)
c:\WINDOWS\system32\WinUSBCoinstaller2.dll (v6.1.7600.16385)

So the obvious difference is the winusb driver version but they both came from windows update and I think they are different due to the different versoins of windows. (am I correct?)


final update in case it helps anyone else. I have working (Sort of) on my main pc.

It was this comment from Laurent that gave me the clue:
> There have been in the past some issues on usb with a renesas usb driver to update on some pc.

I realised that every USB port I tried on my PC was USB3.0, all on a AsMedia XHCI 1.0 controller as far as I can tell. Despite updating my driver it still did not work. But changing to a USB2.0 port and it did start working!

I still don’t know what was going wrong, coide and stlink util worked fine on the USB3.0 ports, but at least I have something that allows me to trial system workbench properly.

Thanks for the update.
It might be useful for users with the same hw USB controller.

It was the same issue on USB3.0 ports on Renesas controller.
But the driver update solved the issue.

Stlink utility and Coide aren’t using OpenOcd so it might work with these tools and not SW4STM32.

Regards,
Laurent