Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


How to use multiple ST boards simultaneously

Hi,

I am developing on both a STM32F7 and a STM32F4 board simultaneously. They need to communicate with each other and I would like to debug against both.

Is there a way I can tell the debugger which project should use which board? i.e. match USB port numbers to a specific board configuration or similar.

Tx in advance,
Jack

Hello Jack,

Unfortunately today, it is not possible to select the board.

Pascale


Thank you for your response Pascale.

Tunisia

Hello Jack, Pascale,

Since SW4STM32 integrates openocd 0.9+, so this is possible by using hla_serial feature.
This is kind of tricky but possible idea

Supposing that we want to debug one STM32F429I-DISC1 (containing ST-LINK V2-1) and NUCLEO-L031K6 simultaneously.

To do that, we need to obtain the embedded ST-LINK serial of each board and specify it within your customized board configuration.

Get the serial number

Here I will force openocd to tell us the serial number by provoking an error twisted

  • copy your board config file ‘nucleo_l031k6.cfg’ (or ‘stm32f429i_disc1.cfg’) from
    ‘C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_...\resources\openocd\scripts\st_board’ to your project folder
  • modify the copied cfg to provoke the error:
    after this line (source [find interface/...cfg])
    add this line (hla_serial wrong_serial)
    ⇒ resulting cfg for nucleo_l031k6

# This is an STM32L0 nucleo board with a single STM32L031K6T6 chip.
# ### To be updated ### http://www.st.com/internet/evalboard/product/.jsp
#

# This is for using the onboard STLINK/V2-1
source [find interface/stlink-v2-1.cfg]
hla_serial wrong_serial

transport select hla_swd

# increase working area to 4KB
set WORKAREASIZE 0x1000

source [find target/stm32l0.cfg]

# use hardware reset, connect under reset
reset_config srst_only srst_nogate
  • from SW4STM32 → debug configurations, create your Ac6 STM32 debugging configuration, then from ‘Debugger’ tab select the modified cfg (select ‘Use local script’ then browse for it)
  • set openocd verbosity to maximum add ‘-d3’ to OpenOCD Command
  • @see snapshot1.png
  • connect your board and launch debug session, this will fail automatically
  • from openocd console search the string ‘Device serial number’ (use ‘Find/Replace’ from contextual menu), the matched line (for me) is:
    Debug: 252 316 libusb1_common.c:67 string_descriptor_equal(): Device serial number066EFF515456707067174639’ doesn’t match requested serial ‘wrong_serial’
  • Now we have the serial number: 066EFF515456707067174639
  • reduce openocd verbosity (remove ‘-d3’)

Once we have the serial number

return to the cfg file and modify the added line, by replacing wrong_serial by the correct one:
⇒ hla_serial 066EFF515456707067174639

Do this to your boards that you want to debug simultaneously (two or more)


Finally do not forget to select a different port number for each debug configuration (from debugger tab), for me I have used ‘4444’ for L031 and ‘3333’ for F429

I have tested this with two projects, each one is opened a different instance of SW4STM32
@see snapshot2.png

Best Regards,
TarekB

Hello tarek,

thanks for your instructions... This was really helpful. Based on this I have tried to set the things up and eventually came out with a bit different approach (easier for me) how to get the stlink id using stlink utility and also how to set project specific debug configuration directly from Eclipse so it only addresses the specific stlink.
I have documented the process and I hope it will be useful to somebody later.

https://youtu.be/UpfucYBR7mgQuestion

BTW big thanks and thumbs up to openstm32 developers and community! Great tools of commercial grade!!!

Thanks for posting how to do this.

let me add that the serial numbers are easily found using ST-Link Utility. Go to Target->Settings to select the board and see the S/N. Upon connect it’s in the log window for easy cut-and-paste. Look for this line:

15:44:52 : ST-LINK SN : 066EFF323535474B43014153


Tunisia

Jack Wrote
....
BTW ... When I use ST-LINK utility, and do a Target→Connect it prints the device serial number as part of the connect info
....

My response
Yes, you are right, only if you are under Windows
I am just proposing a solution that works for all Win/Linux/Mac users

Regards
tarekb


 

Newest Forum Posts

  1. reservation car service Seattle by Jamesprede, 10:06
  2. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs