EmBitz
st-link selection via serial - Printable Version

+- EmBitz (https://www.embitz.org/forum)
+-- Forum: EBlink (https://www.embitz.org/forum/forum-3.html)
+--- Forum: Using EBlink (https://www.embitz.org/forum/forum-6.html)
+--- Thread: st-link selection via serial (/thread-17.html)



st-link selection via serial - resonantworks - 24-09-2020

Is it possible to choose the active debug probe which EBlink uses by serial number on the command line?
I usually have 3+ st-links connected at the same time since I work with hardware which has 3 separate stm32s which communicate with each other via uart.
Matthew.


RE: st-link selection via serial - PDonchev - 28-09-2020

Sometimes I also have to work with more than one MCU and I specify the usb address to choose the right st-link device.

Code:
device=<usb_bus>:<usb_addr> : Select probe explicit


Unfortunately, this address is not something permanent and it would be much more convenient to select the st-link device by serial number.


RE: st-link selection via serial - resonantworks - 28-09-2020

Thanks for that PDonchev Wink. Hopefully if the code is open-sourced we can take a look at adding that as a extra option - or the maintainer could hopefully add it if it's going to stay closed.


RE: st-link selection via serial - PDonchev - 06-10-2020

Smile 

Quote:Changes (5-10-2020) Release 3.3
  • Added: Windows, notify and quit when USB is removed
  • Added: Interface selection based on serial
  • Moded: Some streamlining in the flash engine



RE: st-link selection via serial - embitz - 06-10-2020

That is a coincidence, I just needed that option my self.
I wasn't here, on the forum, for a while and see right now the request.


RE: st-link selection via serial - vdaniel - 07-10-2020

"Added: Interface selection based on serial". How is it possible to use this feature?

vdaniel


RE: st-link selection via serial - embitz - 07-10-2020

Add the option to the interface switch

 -I stlink,serial=xxxxxxxxxxxx

or

 -I stlink,speed=1000,dr,serial=xxxxxxxxxxxx

etc

Add options just with a comma seperator

BTW  eblink  -h gives a help page


RE: st-link selection via serial - embitz - 08-10-2020

Let me explain this a bit further. Assume you have two boards that must communicate with each other and you want them to debug simultaneously. You could create two shell (batch) files ( Windows and Linux the same approach)  which will launch a GDB server on a dedicated tcp port for a dedicated USB interface with that serial.

Target 1 shell file:  eblink -I stlink,serial=0671FF353567A2425E231318  -G port=1001
Target 2 shell file:  eblink -I stlink,serial=024238672632A2425E231318  -G port=1002

Now you can open 2 IDE projects and hook every project on his own TCP port to debug.

This is not only for debugging but also for flashing or automated testing. E.g. if you are in a production environment and you want to flash products on multiple devices simultaneously from the same machine, just start the particular flash location by it's USB serial number.

The sky is the limit.


RE: st-link selection via serial - resonantworks - 08-11-2020

(08-10-2020, 09:02 AM)embitz Wrote: Let me explain this a bit further. Assume you have two boards that must communicate with each other and you want them to debug simultaneously. You could create two shell (batch) files ( Windows and Linux the same approach)  which will launch a GDB server on a dedicated tcp port for a dedicated USB interface with that serial.

Target 1 shell file:  eblink -I stlink,serial=0671FF353567A2425E231318  -G port=1001
Target 2 shell file:  eblink -I stlink,serial=024238672632A2425E231318  -G port=1002

Now you can open 2 IDE projects and hook every project on his own TCP port to debug.

This is not only for debugging but also for flashing or automated testing. E.g. if you are in a production environment and you want to flash products on multiple devices simultaneously from the same machine, just start the particular flash location by it's USB serial number.

The sky is the limit.

Thanks for adding this!