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


Debug Issues in Mac OS X

I have had a bootcamp Windows OS on this Macbook Pro operating OS X (10.11) to serve the singular purpose of embedded development. I was so exicited to find SystemWorkbench for Mac!!! I have been able to create a project, build it, and ran into issues when I try and launch the debugger:

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

Error message from debugger back end:
localhost:3333: Connection refused.
localhost:3333: Connection refused.

I found that if I launch the st-util program from the command line, which starts the debugger listening, then all is successful... Is there a way to add command line arguments to the launch of the debugger?

It is not a huge deal as having a terminal open to just input the simple ./st-util command each time I want to launch into debugging/loading isn’t that bad. I just feel as thoug this cannot be that difficult to fix as it works well when I manually start the st link utility, just cannot figure out how to automate this / fix the issue shown above...

Anyone else on Mac have this issue, and know how to resolve it?

hi, i am running this on osx 10.11.6 without this problem, try to find console output from openocd or gdb which one fails. What are your sw versions? Which board you are trying to debug? Is programming without debug working?

I am running 10.11.6 as well, this is a custom board with an STM32F030K6T6 target. I used their create new board wizard to set up the board for my project. It does not work in either just loading or loading and debugging. The console output when trying to load is:

Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-29-16:35)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
User : 13 2 command.c:546 command_print(): debug_level: 3
Debug: 14 2 configuration.c:44 add_script_search_dir(): adding /Users/kyleprice/Google Drive/ARM Development/STM/STM32/SystemWorkbenchSTM32/otherTest
Debug: 15 2 configuration.c:44 add_script_search_dir(): adding /Applications/Ac6/SystemWorkbench.app/Contents/Eclipse/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts
Debug: 16 2 options.c:98 add_default_dirs(): bindir=/usr/bin
Debug: 17 2 options.c:99 add_default_dirs(): pkgdatadir=/usr/share/openocd
Debug: 18 2 options.c:100 add_default_dirs(): run_prefix=
Debug: 19 2 configuration.c:44 add_script_search_dir(): adding /usr/share/openocd/site
Debug: 20 2 configuration.c:44 add_script_search_dir(): adding /usr/share/openocd/scripts
Debug: 21 2 configuration.c:84 find_file(): found KyleBareF030K6T6.cfg
Debug: 22 3 configuration.c:84 find_file(): found /Applications/Ac6/SystemWorkbench.app/Contents/Eclipse/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/interface/stlink-v2.cfg
Debug: 23 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_interface hla
Debug: 24 3 command.c:145 script_debug(): command - interface ocd_interface hla
Debug: 26 3 command.c:366 register_command_handler(): registering ‘ocd_hla_device_desc’...
Debug: 27 3 command.c:366 register_command_handler(): registering ‘ocd_hla_serial’...
Debug: 28 3 command.c:366 register_command_handler(): registering ‘ocd_hla_layout’...
Debug: 29 3 command.c:366 register_command_handler(): registering ‘ocd_hla_vid_pid’...
Debug: 30 3 command.c:366 register_command_handler(): registering ‘ocd_hla_command’...
Debug: 31 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_hla_layout stlink
Debug: 32 3 command.c:145 script_debug(): command - hla_layout ocd_hla_layout stlink
Debug: 34 3 hla_interface.c:241 hl_interface_handle_layout_command(): hl_interface_handle_layout_command
Debug: 35 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_hla_device_desc ST-LINK/V2
Debug: 36 3 command.c:145 script_debug(): command - hla_device_desc ocd_hla_device_desc ST-LINK/V2
Debug: 38 3 hla_interface.c:215 hl_interface_handle_device_desc_command(): hl_interface_handle_device_desc_command
Debug: 39 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_hla_vid_pid 0x0483 0x3748
Debug: 40 3 command.c:145 script_debug(): command - hla_vid_pid ocd_hla_vid_pid 0x0483 0x3748
Debug: 42 3 hla_interface.c:269 hl_interface_handle_vid_pid_command(): hl_interface_handle_vid_pid_command
Debug: 43 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select hla_swd
Debug: 44 3 command.c:145 script_debug(): command - ocd_transport ocd_transport select hla_swd
Debug: 45 3 hla_transport.c:193 hl_transport_select(): hl_transport_select
Debug: 46 3 command.c:366 register_command_handler(): registering ‘ocd_hla’...
Debug: 47 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 48 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 49 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 50 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 51 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 52 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 53 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 54 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 55 3 command.c:366 register_command_handler(): registering ‘ocd_jtag’...
Debug: 56 3 command.c:366 register_command_handler(): registering ‘ocd_jtag_ntrst_delay’...
Debug: 57 3 configuration.c:84 find_file(): found /Applications/Ac6/SystemWorkbench.app/Contents/Eclipse/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/target/stm32f0x_stlink.cfg
Debug: 58 3 configuration.c:84 find_file(): found /Applications/Ac6/SystemWorkbench.app/Contents/Eclipse/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/target/stm32f0x.cfg
Debug: 59 3 configuration.c:84 find_file(): found /Applications/Ac6/SystemWorkbench.app/Contents/Eclipse/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/target/swj-dp.tcl
Debug: 60 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 61 3 command.c:145 script_debug(): command - ocd_transport ocd_transport select
Debug: 62 3 configuration.c:84 find_file(): found /Applications/Ac6/SystemWorkbench.app/Contents/Eclipse/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/mem_helper.tcl
Debug: 63 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_add_usage_text mrw address
Debug: 64 3 command.c:145 script_debug(): command - add_usage_text ocd_add_usage_text mrw address
Debug: 66 3 command.c:1100 help_add_command(): added ‘mrw’ help text
Debug: 67 3 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_add_help_text mrw Returns value of word in memory.
Debug: 68 3 command.c:145 script_debug(): command - add_help_text ocd_add_help_text mrw Returns value of word in memory.
Debug: 70 3 command.c:1113 help_add_command(): added ‘mrw’ help text
Debug: 71 4 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_add_usage_text mmw address setbits clearbits
Debug: 72 4 command.c:145 script_debug(): command - add_usage_text ocd_add_usage_text mmw address setbits clearbits
Debug: 74 4 command.c:1100 help_add_command(): added ‘mmw’ help text
Debug: 75 4 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_add_help_text mmw Modify word in memory. new_val = (old_val & ~clearbits) | setbits;
Debug: 76 4 command.c:145 script_debug(): command - add_help_text ocd_add_help_text mmw Modify word in memory. new_val = (old_val & ~clearbits) | setbits;
Debug: 78 4 command.c:1113 help_add_command(): added ‘mmw’ help text
Debug: 79 4 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 80 4 command.c:145 script_debug(): command - ocd_transport ocd_transport select
Debug: 81 4 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 82 4 command.c:145 script_debug(): command - ocd_transport ocd_transport select
Debug: 83 4 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 84 4 command.c:145 script_debug(): command - ocd_transport ocd_transport select
Debug: 85 4 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_hla newtap stm32f0x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x0bb11477
Debug: 86 4 command.c:145 script_debug(): command - ocd_hla ocd_hla newtap stm32f0x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x0bb11477
Debug: 87 4 hla_tcl.c:118 jim_hl_newtap_cmd(): Creating New Tap, Chip: stm32f0x, Tap: cpu, Dotted: stm32f0x.cpu, 8 params
Debug: 88 4 hla_tcl.c:128 jim_hl_newtap_cmd(): Processing option: -irlen
Debug: 89 4 hla_tcl.c:128 jim_hl_newtap_cmd(): Processing option: -ircapture
Debug: 90 4 hla_tcl.c:128 jim_hl_newtap_cmd(): Processing option: -irmask
Debug: 91 4 hla_tcl.c:128 jim_hl_newtap_cmd(): Processing option: -expected-id
Debug: 92 4 core.c:1306 jtag_tap_init(): Created Tap: stm32f0x.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 93 4 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target create stm32f0x.cpu cortex_m -endian little -chain-position stm32f0x.cpu
Debug: 94 4 command.c:145 script_debug(): command - ocd_target ocd_target create stm32f0x.cpu cortex_m -endian little -chain-position stm32f0x.cpu
Info : 95 4 target.c:5223 target_create(): The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Debug: 96 4 target.c:1883 target_free_all_working_areas_restore(): freeing all working areas
Debug: 97 4 command.c:366 register_command_handler(): registering ‘ocd_arm’...
Debug: 98 4 command.c:366 register_command_handler(): registering ‘ocd_arm’...
Debug: 99 4 command.c:366 register_command_handler(): registering ‘ocd_arm’...
Debug: 100 4 command.c:366 register_command_handler(): registering ‘ocd_arm’...
Debug: 101 4 command.c:366 register_command_handler(): registering ‘ocd_arm’...
Debug: 102 4 command.c:366 register_command_handler(): registering ‘ocd_arm’...
Debug: 103 4 command.c:366 register_command_handler(): registering ‘ocd_tpiu’...
Debug: 104 4 command.c:366 register_command_handler(): registering ‘ocd_itm’...
Debug: 105 4 command.c:366 register_command_handler(): registering ‘ocd_itm’...
Debug: 106 4 hla_target.c:353 adapter_target_create(): adapter_target_create
Debug: 107 4 hla_target.c:324 adapter_init_arch_info(): adapter_init_arch_info
Debug: 108 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 109 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 110 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 111 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 112 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 113 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 114 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 115 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 116 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 117 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 118 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 119 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 120 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 121 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 122 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 123 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 124 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 125 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 126 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 127 4 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 128 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 129 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 130 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 131 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 132 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 133 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 134 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 135 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 136 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 137 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 138 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f0x.cpu’...
Debug: 139 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu configure -work-area-phys 0x20000000 -work-area-size 0x1000 -work-area-backup 0
Debug: 140 5 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu configure -work-area-phys 0x20000000 -work-area-size 0x1000 -work-area-backup 0
Debug: 141 5 target.c:1883 target_free_all_working_areas_restore(): freeing all working areas
Debug: 142 5 target.c:1883 target_free_all_working_areas_restore(): freeing all working areas
Debug: 143 5 target.c:1883 target_free_all_working_areas_restore(): freeing all working areas
Debug: 144 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_flash bank stm32f0x.flash stm32f1x 0x08000000 0 0 0 stm32f0x.cpu
Debug: 145 5 command.c:145 script_debug(): command - ocd_flash ocd_flash bank stm32f0x.flash stm32f1x 0x08000000 0 0 0 stm32f0x.cpu
Debug: 147 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f1x’...
Debug: 148 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f1x’...
Debug: 149 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f1x’...
Debug: 150 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f1x’...
Debug: 151 5 command.c:366 register_command_handler(): registering ‘ocd_stm32f1x’...
Debug: 152 5 tcl.c:1031 handle_flash_bank_command(): ‘stm32f1x’ driver usage field missing
Debug: 153 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 1000
Debug: 154 5 command.c:145 script_debug(): command - adapter_khz ocd_adapter_khz 1000
Debug: 156 5 core.c:1633 jtag_config_khz(): handle jtag khz
Debug: 157 5 core.c:1600 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 158 5 core.c:1600 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 159 5 command.c:546 command_print(): adapter speed: 1000 kHz
Debug: 160 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_adapter_nsrst_delay 100
Debug: 161 5 command.c:145 script_debug(): command - adapter_nsrst_delay ocd_adapter_nsrst_delay 100
User : 163 5 command.c:546 command_print(): adapter_nsrst_delay: 100
Debug: 164 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only srst_nogate connect_assert_srst
Debug: 165 5 command.c:145 script_debug(): command - reset_config ocd_reset_config srst_only srst_nogate connect_assert_srst
User : 167 5 command.c:546 command_print(): srst_only separate srst_nogate srst_open_drain connect_assert_srst
Debug: 168 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 169 5 command.c:145 script_debug(): command - ocd_transport ocd_transport select
Debug: 170 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu configure -event gdb-attach
# Needed to be able to use the connect_assert_srst in reset_config
# otherwise, can’t read device id
reset init

Debug: 171 5 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu configure -event gdb-attach
# Needed to be able to use the connect_assert_srst in reset_config
# otherwise, can’t read device id
reset init

Debug: 172 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu configure -event examine-end stm32f0x_default_examine_end
Debug: 173 5 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu configure -event examine-end stm32f0x_default_examine_end
Debug: 174 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu configure -event reset-start stm32f0x_default_reset_start
Debug: 175 5 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu configure -event reset-start stm32f0x_default_reset_start
Debug: 176 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu configure -event reset-init stm32f0x_default_reset_init
Debug: 177 5 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu configure -event reset-init stm32f0x_default_reset_init
Debug: 178 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only srst_nogate
Debug: 179 6 command.c:145 script_debug(): command - reset_config ocd_reset_config srst_only srst_nogate
User : 181 6 command.c:546 command_print(): srst_only separate srst_nogate srst_open_drain connect_assert_srst
Debug: 182 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 183 6 command.c:145 script_debug(): command - init ocd_init
Debug: 185 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 186 6 command.c:145 script_debug(): command - ocd_target ocd_target init
Debug: 188 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 189 6 command.c:145 script_debug(): command - ocd_target ocd_target names
Debug: 190 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -event gdb-flash-erase-start
Debug: 191 6 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -event gdb-flash-erase-start
Debug: 192 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu configure -event gdb-flash-erase-start reset init
Debug: 193 6 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu configure -event gdb-flash-erase-start reset init
Debug: 194 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu cget -event gdb-flash-write-end
Debug: 195 6 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu cget -event gdb-flash-write-end
Debug: 196 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_stm32f0x.cpu configure -event gdb-flash-write-end reset halt
Debug: 197 6 command.c:145 script_debug(): command - ocd_stm32f0x.cpu ocd_stm32f0x.cpu configure -event gdb-flash-write-end reset halt
Debug: 198 6 target.c:1308 handle_target_init_command(): Initializing targets...
Debug: 199 6 hla_target.c:343 adapter_init_target(): adapter_init_target
Debug: 200 6 command.c:366 register_command_handler(): registering ‘ocd_target_request’...
Debug: 201 6 command.c:366 register_command_handler(): registering ‘ocd_trace’...
Debug: 202 6 command.c:366 register_command_handler(): registering ‘ocd_trace’...
Debug: 203 6 command.c:366 register_command_handler(): registering ‘ocd_fast_load_image’...
Debug: 204 6 command.c:366 register_command_handler(): registering ‘ocd_fast_load’...
Debug: 205 6 command.c:366 register_command_handler(): registering ‘ocd_profile’...
Debug: 206 6 command.c:366 register_command_handler(): registering ‘ocd_virt2phys’...
Debug: 207 6 command.c:366 register_command_handler(): registering ‘ocd_reg’...
Debug: 208 6 command.c:366 register_command_handler(): registering ‘ocd_poll’...
Debug: 209 6 command.c:366 register_command_handler(): registering ‘ocd_wait_halt’...
Debug: 210 6 command.c:366 register_command_handler(): registering ‘ocd_halt’...
Debug: 211 6 command.c:366 register_command_handler(): registering ‘ocd_resume’...
Debug: 212 6 command.c:366 register_command_handler(): registering ‘ocd_reset’...
Debug: 213 6 command.c:366 register_command_handler(): registering ‘ocd_soft_reset_halt’...
Debug: 214 6 command.c:366 register_command_handler(): registering ‘ocd_step’...
Debug: 215 6 command.c:366 register_command_handler(): registering ‘ocd_mdw’...
Debug: 216 6 command.c:366 register_command_handler(): registering ‘ocd_mdh’...
Debug: 217 6 command.c:366 register_command_handler(): registering ‘ocd_mdb’...
Debug: 218 6 command.c:366 register_command_handler(): registering ‘ocd_mww’...
Debug: 219 6 command.c:366 register_command_handler(): registering ‘ocd_mwh’...
Debug: 220 6 command.c:366 register_command_handler(): registering ‘ocd_mwb’...
Debug: 221 6 command.c:366 register_command_handler(): registering ‘ocd_bp’...
Debug: 222 6 command.c:366 register_command_handler(): registering ‘ocd_rbp’...
Debug: 223 6 command.c:366 register_command_handler(): registering ‘ocd_wp’...
Debug: 224 6 command.c:366 register_command_handler(): registering ‘ocd_rwp’...
Debug: 225 6 command.c:366 register_command_handler(): registering ‘ocd_load_image’...
Debug: 226 6 command.c:366 register_command_handler(): registering ‘ocd_dump_image’...
Debug: 227 6 command.c:366 register_command_handler(): registering ‘ocd_verify_image’...
Debug: 228 6 command.c:366 register_command_handler(): registering ‘ocd_test_image’...
Debug: 229 6 command.c:366 register_command_handler(): registering ‘ocd_reset_nag’...
Debug: 230 6 command.c:366 register_command_handler(): registering ‘ocd_ps’...
Debug: 231 6 command.c:366 register_command_handler(): registering ‘ocd_test_mem_access’...
Debug: 232 6 hla_interface.c:111 hl_interface_init(): hl_interface_init
Debug: 233 6 hla_layout.c:85 hl_layout_init(): hl_layout_init
Debug: 234 6 core.c:1600 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 235 6 core.c:1603 adapter_khz_to_speed(): have interface set up
Info : 236 6 stlink_usb.c:1663 stlink_speed(): Unable to match requested speed 1000 kHz, using 950 kHz
Debug: 237 6 core.c:1600 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 238 6 core.c:1603 adapter_khz_to_speed(): have interface set up
Info : 239 6 stlink_usb.c:1663 stlink_speed(): Unable to match requested speed 1000 kHz, using 950 kHz
Info : 240 6 core.c:1388 adapter_init(): clock speed 950 kHz
Debug: 241 6 openocd.c:137 handle_init_command(): Debug Adapter init complete
Debug: 242 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 243 6 command.c:145 script_debug(): command - ocd_transport ocd_transport init
Debug: 245 6 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 246 7 hla_transport.c:154 hl_transport_init(): hl_transport_init
Debug: 247 7 hla_transport.c:171 hl_transport_init(): current transport hla_swd
Debug: 248 7 hla_interface.c:44 hl_interface_open(): hl_interface_open
Debug: 249 7 hla_layout.c:42 hl_layout_open(): hl_layout_open
Debug: 250 7 stlink_usb.c:1697 stlink_usb_open(): stlink_usb_open
Debug: 251 7 stlink_usb.c:1714 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial:
Error: 252 46 stlink_usb.c:1727 stlink_usb_open(): open failed
Debug: 253 46 hla_layout.c:49 hl_layout_open(): failed
Debug: 254 46 command.c:628 run_command(): Command failed with error code -4
User : 255 46 command.c:689 command_run_line(): in procedure ‘program’
in procedure ‘init’ called at file “embedded:startup.tcl”, line 473
in procedure ‘ocd_bouncer’
Debug: 256 46 command.c:628 run_command(): Command failed with error code -4
Debug: 257 46 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_echo ** OpenOCD init failed **
Debug: 258 46 command.c:145 script_debug(): command - echo ocd_echo ** OpenOCD init failed **
User : 260 46 command.c:764 jim_echo(): ** OpenOCD init failed **
Debug: 261 46 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_shutdown error
Debug: 262 46 command.c:145 script_debug(): command - shutdown ocd_shutdown error
User : 264 46 server.c:611 handle_shutdown_command(): shutdown command invoked
Debug: 265 46 command.c:628 run_command(): Command failed with error code -4
User : 266 46 command.c:689 command_run_line():
Debug: 267 46 hla_interface.c:119 hl_interface_quit(): hl_interface_quit



The output is the same for the openOcd console when trying to debug and GDB shows:

GNU gdb (GNU Tools for ARM Embedded Processors) 7.10.1.20151217-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “host=x86_64-apple-darwin10 target=arm-none-eabi”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.


It appears as though openOcd is choking.... I am pretty well tied up during the days this week so I won’t be able to look deeper into this until tonight...

Thanks for the help!!


openocd can not open your stlink adapter, see:
Debug: 251 7 stlink_usb.c:1714 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial:
Error: 252 46 stlink_usb.c:1727 stlink_usb_open(): open failed
check if your pid/vid is ok refferring to stlink v1 vs v2

That was it!! Thank you for that!!

Just as an FYI, my cheap ST LINK V2 USB dongle shot craps and I was using the ST Link from a Nucleo board which had a pid that matched a different config file (STLINK-V2-1). Updated the project cfg file to point to this config and it works like a charm!!!


I’m having a similar issue when attempting to Debug or Run my build of System Workbench on my Macbook Pro running OS 10.12 Sierra. I’m using a stm32f4 Discovery Board. When I try to run the default for loop program, my console prints the following:

Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-29-16:35)
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 ‘program’
in procedure ‘init’ called at file “embedded:startup.tcl”, line 473
in procedure ‘ocd_bouncer’

    • OpenOCD init failed **

shutdown command invoked



When I try to launch into debug mode, a “Problem Occured” prompt window appears and the details show the following:

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

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


Really have no clue what could be the problem, my only guess is an issue with openocd. Also, should openocd be a command recognized in terminal? It isn’t recognized as of right now.

Thanks for any leads

Hello,

Which version of SW4STM32 plugins do you use ?

Can you check if updates are available ?
Menu Help => Check for Updates
Latest version is V1.10.0 (July 2016).
In this version, openocd should be able to select automatically an STLink V2 or V2-1 board connected.

Check that you haven’t an openocd task already running.

Check that you have only one STLink board connected on usb ports.

Then, maybe STLink usb drivers are not well installed ?

Rgds,
Laurent


Hi Laurent,

Appreciate the response,
I initially attempted to run SW4STM32 for Mac OS/x using the installer found on this pageQuestion, which claims to be the latest and greatest version. After downloading and installing, I opened the SW4STM32 application and created a basic Ac6 STM32Discovery Board project, and configured my Debug and Run configurations by double clicking “Ac6 STM32 Debugging”, followed by clicking “Run”. I then get the print statements posted above in my console log.

I checked for updates, and there were some, so i updated all of them. Tried again, and still no luck. I’ve checked my Activity Monitor for an existing openocd task that could possibly be running, but I do not see any.

I do only have only one STLink board connected at the moment.

As far as drivers for STLink, I’m not too sure where to find an appropriate driver for Mac OSx 10.12. I’ve attempted to install stlink using homebrew, and tried to run my configuration again after, yet still the same results.

After these attempts, I uninstalled SW4STM32 and tried to setup the workbench through eclipse instead. After installing eclipse, downloading the SW4STM32 plugins through its installer and running my configuration, I still get the same results in my console log.

I’m thinking it could be a driver issue that isn’t allowing openocd to connect to my board, although I really have no clue.

Thanks again for your help

Some version specs:

OpenOCD for MacOS 64 bits 1.10.0.201607261134

GNU Tools ARM Embedded for MacOS 64 bits 1.6.0.201601291255

External Tools for MacOS (64 bits) 1.9.0.20165241446

Ac6 Linker Script Editor 1.7.0.201602121829

Ac6 C/C++ Embedded Development Tools for MCU 1.10.0.201607251855

Ac6 C/C++ Debugging Tools for MCU 1.10.0.201607251855

Hello,

OK, v1.10 is the latest, you’re fine on this side.

STLink need to have libusb to work.
I don’t know if you have it on your system or if it is not enabled.
When you installed the SW4STM32 software with the installer, did it goes well on stlink part ? No errors ?
Can you relaunch the installer and check if you have errors on this part of installation.
There was a similar issue on Linux fedora for someone, look this thread:
http://www.openstm32.org/tiki-view_forum_thread.php?forumId=7&comments_parentId=841Question


Can you try to add -d in the openocd options in debug config, launch again debug and look on the openocd console the log error.
To add the openocd option, go to “Debugger” tab in debug config, you’ll see an edit field “OpenOCD Options :”.

Rgds,
Laurent


Hi,

Yes I have libusb installed. I installed using homebrew, along with stlink. As far as enabling libusb, I have not done anything manually since installing libusb, or know how to or if I even have to.

I’ve reinstalled SW4STM32 and checked for any errors containing stlink or rules, but did not find anything in particular. The install seems to have ran fine.

I’ve taken a look at the post you linked, and I can’t manage to find the ‘install_stlink_udev.sh’ file the user said he updated, but I also wasn’t getting a udev rules error in my install, assuming that I should be looking at the log that prints out in the installer window when installing SW4STM32.

I added the “-d” option and I’ve attached a .txt file with the results in the console log.

Now I attempted to create an External Tools Configuration that points to my st-util bin installed via homebrew, and have adjusted my Openocd Port number in my Debug configuration to listen on port 4242, and that seems to have worked. I am able to load a program and Debug, although I do get this error after stopping a debug session:

2016-10-07T16:58:09 ERROR /tmp/stlink-20161001-4407-8f1gha/stlink-1.2.0/gdbserver/gdb-server.c: cannot send: -2

Not exactly sure what that means. Kind of hacky, but this works. I would still like to get to the bottom of why Openocd fails to run.

Thanks for the leads

It’s normal that you don’t find the UDEV things on Mac os, they are only for Linux os.

I don’t know if homebrew has installed enough stuff for stlink for SW4STM32.
Does it declare Stlink V2 and V2-1 ? They don’t have the same USB PID.

Did you create your project with the project wizard selecting the F407 disco board (which embeds an STlink V2) ?
Or you have created a custom board (selecting STLink V2 or V2-1) ?
If you have a project selecting an STlink V2-1 but an STlink V2 on your board, in v1.10.0, it should work anyway.
But it will work only if the 2 USB PIDs of the 2 STLink versions are declared.

I don’t know if there is a change in Mac os Sierra for USB drivers ?
The previous users on this thread were on Mac OS 10.11, not 10.12.

Rgds,
Laurent

stlink does declare stlink v2 which is what my stm32discovery board is using.

I did create my own project with the project wizard selecting stm32f4discovery board, which I believe should embed sn STLink V2, although i’m not sure how to verify which version of stlink is embedded in my project.

also, how can i verify that my usb PIDs of my stlink version matches with my device?

Thanks!

Nevermind my last question, seems I have figured it out.

Solution was to change my stm32f4discovery.cfg file to use stlink-v2-1.cfg instead of stlink-v2.cfg.

Figured this out after finding my PID in the system report window within the About This Mac preference, and seeing that it did not match with the current PID configuration.

Thanks for your time and all the help Laurent!

Hi Daniel,

Glad to hear it works fine finally.

In fact, you have the newer F407 disco and the name is different with the Stlink V2-1, it should be written STM32F407-DISC1 on the board.
Old F407 Discovery named STM32F4-discovery has a STLink V2.

So you have chosen the wrong board in SW4STM32.

I thought it would work specifying Stlink V2 or V2-1 in v1.10.0 version. I will check that again.

I re-read your post, you modified the cfg file but it’s not the right solution, because if you get an old F4-discovery, it would not work.
So, the solution is to change your board to STM32F407-DISC1 which has the cfg with STLink V2-1.

Rgds,
Laurent

Yup you were right. Thought I might have been using the wrong board configuration. Ok so I changed the stm32f4discovery.cfg back to how it was, and created a new project with stm32f407-disc1 and it still works.

Awesome!
Thank you


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  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. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs