Generation of wrong ELF file
Just to be more specific. I know that if this was stackoverflow I would get -1Meg for such a question, though there is no safe space. So I have the same cfg file for both projects which looks like that:
"# This is an EMCT_Display_V2 board with a single STM32F303VETx chip."
"# Generated by System Workbench for STM32"
source find interface/stlink-v2.cfg
set WORKAREASIZE 0x10000
transport select "hla_swd"
set CHIPNAME STM32F303VETx
source find target/stm32f3x.cfg
"# use hardware reset, connect under reset"
reset_config srst_only srst_nogate
Then for the case where the loading is not working I got the following response:
''Open On-Chip Debugger 0.10.0-dev-00302-gc211ca5-dirty (2017-07-03-10:41)
''Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
''Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 950 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 950 kHz''
Info : STLINK v2 JTAG v28 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.888232
Info : STM32F303VETx.cpu: hardware has 6 breakpoints, 4 watchpoints
can't read "ENABLE_LOW_POWER": no such variable
in procedure 'init'
in procedure 'ocd_bouncer'
Info : accepting 'gdb' connection on tcp/3333
can't read "CONNECT_UNDER_RESET": no such variable
Info : device id = 0x10036446
Info : flash size = 512kbytes
adapter speed: 950 kHz
can't read "ENABLE_LOW_POWER": no such variable
in procedure 'reset'
in procedure 'ocd_bouncer'
in procedure 'ocd_process_reset'
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 248
in procedure 'STM32F303VETx.cpu' called at file "embedded:startup.tcl", line 299
in procedure 'ocd_bouncer'
''STM32F303VETx.cpu: target state: halted
target halted due to debug-request, current mode: Thread ''
xPSR: 0x01000000 pc: 0x0801be98 msp: 0x20010000
Info : dropped 'gdb' connection
For the project where the loading is successful it's looking like that:
"Open On-Chip Debugger 0.10.0-dev-00302-gc211ca5-dirty (2017-07-03-10:41)
"Licensed under GNU GPL v2
"For bug reports, read
" http://openocd.org/doc/doxygen/bugs.html
"Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
"adapter speed: 950 kHz
"adapter_nsrst_delay: 100
"srst_only separate srst_nogate srst_open_drain connect_deassert_srst
"Info : clock speed 950 kHz
"Info : STLINK v2 JTAG v28 API v2 SWIM v0 VID 0x0483 PID 0x3748
"Info : using stlink api v2
"Info : Target voltage: 2.876878
"Info : STM32F303VETx.cpu: hardware has 6 breakpoints, 4 watchpoints
"can't read "ENABLE_LOW_POWER": no such variable
"in procedure 'init'
"in procedure 'ocd_bouncer'"
"Info : accepting 'gdb' connection on tcp/3333
"can't read "CONNECT_UNDER_RESET": no such variable
"Info : device id = 0x10036446
"Info : flash size = 512kbytes
"adapter speed: 950 kHz
"an't read "ENABLE_LOW_POWER": no such variable
"in procedure 'reset'
"in procedure 'ocd_bouncer'
"in procedure 'ocd_process_reset'
"in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 248
"in procedure 'STM32F303VETx.cpu' called at file "embedded:startup.tcl", line 299
"in procedure 'ocd_bouncer'
"STM32F303VETx.cpu: target state: halted
"target halted due to debug-request, current mode: Thread
"xPSR: 0x01000000 pc: 0x0801be98 msp: 0x20010000
"adapter speed: 950 kHz
"can't read "ENABLE_LOW_POWER": no such variable
"in procedure 'reset'
"in procedure 'ocd_bouncer'
"in procedure 'ocd_process_reset'
"in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 248
"in procedure 'STM32F303VETx.cpu' called at file "embedded:startup.tcl", line 299
"in procedure 'ocd_bouncer'
"STM32F303VETx.cpu: target state: halted
"target halted due to debug-request, current mode: Thread
"xPSR: 0x01000000 pc: 0x0801be98 msp: 0x20010000
"adapter speed: 1800 kHz
"Info : Padding image section 0 with 44 bytes
"STM32F303VETx.cpu: target state: halted
"target halted due to breakpoint, current mode: Thread
"xPSR: 0x61000000 pc: 0x2000003a msp: 0x20010000
"Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (5748). Workaround: increase "set "remotetimeout" in GDB
"adapter speed: 950 kHz
"can't read "ENABLE_LOW_POWER": no such variable
"in procedure 'reset'
"in procedure 'ocd_bouncer'
"in procedure 'ocd_process_reset'
"in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 248
"in procedure 'STM32F303VETx.cpu' called at file "embedded:startup.tcl", line 299
"in procedure 'ocd_bouncer'
"STM32F303VETx.cpu: target state: halted
"target halted due to debug-request, current mode: Thread
"xPSR: 0x01000000 pc: 0x0801be98 msp: 0x20010000"