So, I tried already with the 3.3V of STlinkV2 and without it, external power supply, with the same results.
If I do this:
monitor reset halt
target halted due to debug-request, pc: 0x00008000
monitor load_image main.bin
223 bytes written at address 0x00000000
downloaded 223 bytes in 0.012157s (17.913 KiB/s)
Seems it flashed, but we can see at wrong address and in fact the code running is the old version, not the one I tried to flash.
If I put the 0x8000 address, the the output is this:
monitor reset halt
target halted due to debug-request, pc: 0x00008000
monitor mdb 0x00505F
0x0000505f: 40
monitor load_image main.bin 0x8000
Polling target stm8.cpu failed, trying to reexamine
trying to reconnect
Seems that for OpenOCD, only the command load_image is failing. I verified the sources of the version of OpenOCD for STM8 that it sends the commands to unlock the MASS of STM8 but as you could see, I tried before to send anyway but with the same results :-(
The flash of firmware always works with stm8flash!! I also saw the source code and they also send the commands to unlock the MASS.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from main.elf...done.
(gdb) tar ext :3333
Remote debugging using :3333
0x00008000 in ?? ()
(gdb) mon reset halt
target halted due to debug-request, pc: 0x00008000
(gdb) start
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Temporary breakpoint 1 at 0x80b2
Starting program: /home/cas/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/main.elf
Already connected to a remote target. Disconnect? (y or n) y
Remote debugging using localhost:3333
Remote communication error. Target disconnected.: Connection reset by peer.
(gdb)
Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from main.elf...done.
(gdb) set remote interrupt-on-connect
(gdb) start
Temporary breakpoint 1 at 0x80b2
Starting program: /home/cas/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/main.elf
Remote debugging using localhost:3333
0x00008000 in ?? ()
Loading section SSEG, size 0x3 lma 0x1
Loading section HOME, size 0x83 lma 0x8000
Loading section GSINIT, size 0x1e lma 0x8083
Load failed
I have to get my hands on one of those small flash stm8. All development was made on a stm8s105 so no testing was ever done on either stm8l or any small flash devices.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have no clue why its not working. I dont know if is read out protection causing all this trouble or if stm8flash utility is programming the ROP or if it is a problem with the stlink interface.
Did you try stm8flash -u ?
Last edit: akre 2017-05-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did this the very first time, to unlock (found this info online):
echo "00 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > factory_defaults.bin
stm8flash -c stlinkv2 -p stm8s103f3 -s opt -w factory_defaults.bin
I already verified the code of stm8flash, they send the same bytes to unlock the MASS, just like OpenOCD.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone.
I am looking to flash and debug STM8 using OpenOCD and Eclipse, on Linux. Maybe I am the only one that can't do it... if you could help me, would be great. I will share my documentation with everyone here, when it is finished: https://opensource-ebike-firmware.github.io/Development_tools--Debug_OpenOCD_and_Eclipse.html
So, I tried already with the 3.3V of STlinkV2 and without it, external power supply, with the same results.
If I do this:
monitor reset halt
target halted due to debug-request, pc: 0x00008000
monitor load_image main.bin
223 bytes written at address 0x00000000
downloaded 223 bytes in 0.012157s (17.913 KiB/s)
Seems it flashed, but we can see at wrong address and in fact the code running is the old version, not the one I tried to flash.
If I put the 0x8000 address, the the output is this:
monitor reset halt
target halted due to debug-request, pc: 0x00008000
monitor mdb 0x00505F
0x0000505f: 40
monitor load_image main.bin 0x8000
Polling target stm8.cpu failed, trying to reexamine
trying to reconnect
Seems that for OpenOCD, only the command load_image is failing. I verified the sources of the version of OpenOCD for STM8 that it sends the commands to unlock the MASS of STM8 but as you could see, I tried before to send anyway but with the same results :-(
The flash of firmware always works with stm8flash!! I also saw the source code and they also send the commands to unlock the MASS.
So, I don't know what more I can try.
The very simple code I am using is here, including the makefile and Eclipse project files: https://github.com/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/tree/LED_blink
Using the same the instructions on https://stm8-binutils-gdb.sourceforge.io/
What board are you using?
Could you make a dump of the elf header e.g stm8-objdump -h main.elf
cas@cas-sp4:~/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware$ stm8-objdump -h main.elf
main.elf: file format elf32-stm8
Sections:
Idx Name Size VMA LMA File off Algn
0 SSEG 00000003 00000001 00000001 00000034 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 HOME 00000083 00008000 00008000 00000037 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 GSINIT 0000001e 00008083 00008083 000000ba 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 GSFINAL 00000003 000080a1 000080a1 000000d8 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 CODE 0000003b 000080a4 000080a4 000000db 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .debug_line 000000e8 00000000 00000000 00000116 20
CONTENTS, READONLY, DEBUGGING
6 .debug_loc 00000014 00000000 00000000 000001fe 20
CONTENTS, READONLY, DEBUGGING
7 .debug_abbrev 00000038 00000000 00000000 00000212 20
CONTENTS, READONLY, DEBUGGING
8 .debug_info 0000005b 00000000 00000000 0000024a 20
CONTENTS, READONLY, DEBUGGING
9 .debug_pubnames 0000001b 00000000 00000000 000002a5 20
CONTENTS, READONLY, DEBUGGING
10 .debug_frame 00000012 00000000 00000000 000002c0 2**0
CONTENTS, READONLY, DEBUGGING
The board is a cheap one, as refered here: http://www.electroschematics.com/11194/stm-mini-development-board-unboxed/
Elf file looks ok.
Make sure your target is not running when downloading the code.
Try:
gdb --tui main.elf
set remote interrupt-on-connect
start
or:
gdb --tui main.elf
tar ext :3333
mon reset halt
start
If that does not work you would have to take a look att openocd debug log with openocd "-d3" option enabled.
OPTION 1
GDB
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from main.elf...done.
(gdb) tar ext :3333
Remote debugging using :3333
0x00008000 in ?? ()
(gdb) mon reset halt
target halted due to debug-request, pc: 0x00008000
(gdb) start
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Temporary breakpoint 1 at 0x80b2
Starting program: /home/cas/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/main.elf
Already connected to a remote target. Disconnect? (y or n) y
Remote debugging using localhost:3333
Remote communication error. Target disconnected.: Connection reset by peer.
(gdb)
OpenOCD
/home/cas/software/stm8-binutils/bin/openocd -d3 -f tools/openocd-v0.10.0-scripts/stlink-v2.cfg -f tools/openocd-v0.10.0-scripts/stm8.cfg -c "init" -c "reset halt"
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
User : 13 2 command.c:544 command_print(): debug_level: 3
Debug: 14 2 options.c:181 add_default_dirs(): bindir=/home/cas/software/stm8-binutils/bin
Debug: 15 2 options.c:182 add_default_dirs(): pkgdatadir=/home/cas/software/stm8-binutils/share/openocd
Debug: 16 2 options.c:183 add_default_dirs(): exepath=/home/cas/software/stm8-binutils/bin
Debug: 17 2 options.c:184 add_default_dirs(): bin2data=../share/openocd
Debug: 18 2 configuration.c:42 add_script_search_dir(): adding /home/cas/.openocd
Debug: 19 2 configuration.c:42 add_script_search_dir(): adding /home/cas/software/stm8-binutils/bin/../share/openocd/site
Debug: 20 2 configuration.c:42 add_script_search_dir(): adding /home/cas/software/stm8-binutils/bin/../share/openocd/scripts
Debug: 21 2 configuration.c:82 find_file(): found tools/openocd-v0.10.0-scripts/stlink-v2.cfg
Debug: 22 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface hla
Debug: 23 2 command.c:143 script_debug(): command - interface ocd_interface hla
Debug: 25 2 command.c:364 register_command_handler(): registering 'ocd_hla_device_desc'...
Debug: 26 2 command.c:364 register_command_handler(): registering 'ocd_hla_serial'...
Debug: 27 2 command.c:364 register_command_handler(): registering 'ocd_hla_layout'...
Debug: 28 2 command.c:364 register_command_handler(): registering 'ocd_hla_vid_pid'...
Debug: 29 2 command.c:364 register_command_handler(): registering 'ocd_hla_command'...
Debug: 30 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_layout stlink
Debug: 31 2 command.c:143 script_debug(): command - hla_layout ocd_hla_layout stlink
Debug: 33 2 hla_interface.c:239 hl_interface_handle_layout_command(): hl_interface_handle_layout_command
Debug: 34 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_device_desc ST-LINK/V2
Debug: 35 2 command.c:143 script_debug(): command - hla_device_desc ocd_hla_device_desc ST-LINK/V2
Debug: 37 2 hla_interface.c:213 hl_interface_handle_device_desc_command(): hl_interface_handle_device_desc_command
Debug: 38 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_vid_pid 0x0483 0x3748
Debug: 39 3 command.c:143 script_debug(): command - hla_vid_pid ocd_hla_vid_pid 0x0483 0x3748
Debug: 41 3 hla_interface.c:267 hl_interface_handle_vid_pid_command(): hl_interface_handle_vid_pid_command
Debug: 42 3 configuration.c:82 find_file(): found tools/openocd-v0.10.0-scripts/stm8.cfg
Debug: 43 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select stlink_swim
Debug: 44 3 command.c:143 script_debug(): command - ocd_transport ocd_transport select stlink_swim
Debug: 45 3 hla_transport.c:191 hl_transport_select(): hl_transport_select
Debug: 46 3 command.c:364 register_command_handler(): registering 'ocd_hla'...
Debug: 47 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 48 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 49 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 50 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 51 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 52 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 53 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 54 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 55 3 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 56 3 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 57 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla newtap stm8 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0
Debug: 58 3 command.c:143 script_debug(): command - ocd_hla ocd_hla newtap stm8 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0
Debug: 59 4 hla_tcl.c:116 jim_hl_newtap_cmd(): Creating New Tap, Chip: stm8, Tap: cpu, Dotted: stm8.cpu, 8 params
Debug: 60 4 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -irlen
Debug: 61 4 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -ircapture
Debug: 62 4 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -irmask
Debug: 63 4 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -expected-id
Debug: 64 4 core.c:1304 jtag_tap_init(): Created Tap: stm8.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 65 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create stm8.cpu stm8 -chain-position stm8.cpu
Debug: 66 4 command.c:143 script_debug(): command - ocd_target ocd_target create stm8.cpu stm8 -chain-position stm8.cpu
Debug: 67 4 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 68 4 command.c:364 register_command_handler(): registering 'ocd_stm8'...
Debug: 69 4 stm8.c:1082 stm8_target_create(): stm8_target_create
Debug: 70 4 stm8.c:429 stm8_configure_break_unit(): hw breakpoints: numinst 2 numdata 2
Debug: 71 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 72 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 73 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 74 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 75 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 76 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 77 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 78 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 79 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 80 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 81 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 82 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 83 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 84 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 85 4 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 86 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 87 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 88 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 89 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 90 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 91 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 92 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 93 5 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 94 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -work-area-phys 0x0 -work-area-size 0x400 -work-area-backup 1
Debug: 95 5 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -work-area-phys 0x0 -work-area-size 0x400 -work-area-backup 1
Debug: 96 5 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 97 5 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 98 5 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 99 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -flashstart 0x8000 -flashend 0xffff -eepromstart 0x4000 -eepromend 0x43ff -optionstart 0x4800 -optionend 0x43ff -blocksize 0x80
Debug: 100 5 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -flashstart 0x8000 -flashend 0xffff -eepromstart 0x4000 -eepromend 0x43ff -optionstart 0x4800 -optionend 0x43ff -blocksize 0x80
Debug: 101 5 stm8.c:1909 stm8_jim_configure(): stm8_jim_configure flashstart=00008000
Debug: 102 5 stm8.c:1928 stm8_jim_configure(): stm8_jim_configure flashend=0000ffff
Debug: 103 5 stm8.c:1947 stm8_jim_configure(): stm8_jim_configure eepromstart=00004000
Debug: 104 5 stm8.c:1966 stm8_jim_configure(): stm8_jim_configure eepromend=000043ff
Debug: 105 5 stm8.c:1985 stm8_jim_configure(): stm8_jim_configure optionstart=00004800
Debug: 106 5 stm8.c:2004 stm8_jim_configure(): stm8_jim_configure optionend=000043ff
Debug: 107 5 stm8.c:1890 stm8_jim_configure(): stm8_jim_configure blocksize=00000080
Debug: 108 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 0
Debug: 109 5 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 0
Debug: 111 6 core.c:1631 jtag_config_khz(): handle jtag khz
Debug: 112 6 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 113 6 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 114 6 command.c:544 command_print(): adapter speed: RCLK - adaptive
Debug: 115 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only
Debug: 116 6 command.c:143 script_debug(): command - reset_config ocd_reset_config srst_only
User : 118 6 command.c:544 command_print(): srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Debug: 119 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 120 6 command.c:143 script_debug(): command - init ocd_init
Debug: 122 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 123 6 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 125 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 126 6 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 127 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu cget -event gdb-flash-erase-start
Debug: 128 6 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu cget -event gdb-flash-erase-start
Debug: 129 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -event gdb-flash-erase-start reset init
Debug: 130 6 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -event gdb-flash-erase-start reset init
Debug: 131 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu cget -event gdb-flash-write-end
Debug: 132 6 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu cget -event gdb-flash-write-end
Debug: 133 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -event gdb-flash-write-end reset halt
Debug: 134 6 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -event gdb-flash-write-end reset halt
Debug: 135 7 target.c:1326 handle_target_init_command(): Initializing targets...
Debug: 136 7 stm8.c:796 stm8_init(): stm8_init
Debug: 137 7 command.c:364 register_command_handler(): registering 'ocd_target_request'...
Debug: 138 7 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 139 7 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 140 7 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
Debug: 141 7 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
Debug: 142 7 command.c:364 register_command_handler(): registering 'ocd_profile'...
Debug: 143 7 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
Debug: 144 7 command.c:364 register_command_handler(): registering 'ocd_reg'...
Debug: 145 7 command.c:364 register_command_handler(): registering 'ocd_poll'...
Debug: 146 7 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
Debug: 147 7 command.c:364 register_command_handler(): registering 'ocd_halt'...
Debug: 148 7 command.c:364 register_command_handler(): registering 'ocd_resume'...
Debug: 149 7 command.c:364 register_command_handler(): registering 'ocd_reset'...
Debug: 150 7 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
Debug: 151 7 command.c:364 register_command_handler(): registering 'ocd_step'...
Debug: 152 7 command.c:364 register_command_handler(): registering 'ocd_mdw'...
Debug: 153 7 command.c:364 register_command_handler(): registering 'ocd_mdh'...
Debug: 154 7 command.c:364 register_command_handler(): registering 'ocd_mdb'...
Debug: 155 7 command.c:364 register_command_handler(): registering 'ocd_mww'...
Debug: 156 7 command.c:364 register_command_handler(): registering 'ocd_mwh'...
Debug: 157 7 command.c:364 register_command_handler(): registering 'ocd_mwb'...
Debug: 158 7 command.c:364 register_command_handler(): registering 'ocd_bp'...
Debug: 159 7 command.c:364 register_command_handler(): registering 'ocd_rbp'...
Debug: 160 7 command.c:364 register_command_handler(): registering 'ocd_wp'...
Debug: 161 7 command.c:364 register_command_handler(): registering 'ocd_rwp'...
Debug: 162 7 command.c:364 register_command_handler(): registering 'ocd_load_image'...
Debug: 163 7 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
Debug: 164 7 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
Debug: 165 7 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
Debug: 166 7 command.c:364 register_command_handler(): registering 'ocd_test_image'...
Debug: 167 7 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
Debug: 168 7 command.c:364 register_command_handler(): registering 'ocd_ps'...
Debug: 169 7 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
Debug: 170 7 hla_interface.c:109 hl_interface_init(): hl_interface_init
Debug: 171 7 hla_layout.c:83 hl_layout_init(): hl_layout_init
Debug: 172 7 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 173 7 core.c:1601 adapter_khz_to_speed(): have interface set up
Info : 174 7 stlink_usb.c:1932 stlink_speed(): Unable to match requested speed 0 kHz, using 5 kHz
Debug: 175 7 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 176 7 core.c:1601 adapter_khz_to_speed(): have interface set up
Info : 177 7 stlink_usb.c:1932 stlink_speed(): Unable to match requested speed 0 kHz, using 5 kHz
Info : 178 7 core.c:1384 adapter_init(): RCLK (adaptive clock speed) not supported - fallback to 5 kHz
Debug: 179 7 openocd.c:140 handle_init_command(): Debug Adapter init complete
Debug: 180 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 181 7 command.c:143 script_debug(): command - ocd_transport ocd_transport init
Debug: 183 7 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 184 7 hla_transport.c:152 hl_transport_init(): hl_transport_init
Debug: 185 7 hla_transport.c:169 hl_transport_init(): current transport stlink_swim
Debug: 186 7 hla_interface.c:42 hl_interface_open(): hl_interface_open
Debug: 187 7 hla_layout.c:40 hl_layout_open(): hl_layout_open
Debug: 188 7 stlink_usb.c:1966 stlink_usb_open(): stlink_usb_open
Debug: 189 7 stlink_usb.c:1983 stlink_usb_open(): transport: 3 vid: 0x0483 pid: 0x3748 serial:
Info : 190 10 stlink_usb.c:658 stlink_usb_version(): STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : 191 10 stlink_usb.c:2094 stlink_usb_open(): using stlink api v2
Debug: 192 10 stlink_usb.c:859 stlink_usb_init_mode(): MODE: 0x03
Info : 193 10 stlink_usb.c:690 stlink_usb_check_voltage(): Target voltage: 3.268526
Debug: 194 10 stlink_usb.c:914 stlink_usb_init_mode(): MODE: 0x01
Debug: 195 11 stlink_usb.c:940 stlink_usb_init_mode(): MODE: 0x03
Debug: 196 21 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 197 21 core.c:729 jtag_add_reset(): SRST line released
Debug: 198 21 core.c:753 jtag_add_reset(): TRST line released
Debug: 199 21 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 200 21 hla_interface.c:67 hl_interface_init_target(): hl_interface_init_target
Debug: 201 21 openocd.c:153 handle_init_command(): Examining targets...
Debug: 202 21 target.c:1519 target_call_event_callbacks(): target event 21 (examine-start)
Debug: 203 21 stm8.c:1612 stm8_examine(): stm8_examine
Debug: 204 21 stm8.c:1617 stm8_examine(): writing A0 to SWIM_CSR
Debug: 205 22 stm8.c:1622 stm8_examine(): writing B0 to SWIM_CSR
Debug: 206 24 target.c:1519 target_call_event_callbacks(): target event 22 (examine-end)
Debug: 207 25 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash init
Debug: 208 26 command.c:143 script_debug(): command - ocd_flash ocd_flash init
Debug: 209 28 stm8.c:825 stm8_poll(): DM_CSR2_STALL already set during server startup.
Debug: 210 31 stm8.c:1108 stm8_read_core_reg(): read core reg 0 value 0x8000
Debug: 211 31 stm8.c:1108 stm8_read_core_reg(): read core reg 1 value 0x0
Debug: 212 31 stm8.c:1108 stm8_read_core_reg(): read core reg 2 value 0x0
Debug: 213 31 stm8.c:1108 stm8_read_core_reg(): read core reg 3 value 0x0
Debug: 214 32 stm8.c:1108 stm8_read_core_reg(): read core reg 4 value 0x3ff
Debug: 215 32 stm8.c:1108 stm8_read_core_reg(): read core reg 5 value 0x28
Debug: 216 36 stm8.c:442 stm8_examine_debug_reason(): stm8_examine_debug_reason csr1 = 0x10 csr2 = 0x08
Debug: 217 36 stm8.c:482 stm8_debug_entry(): entered debug state at PC 0x8000, target->state: halted
Debug: 218 36 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 219 36 target.c:1519 target_call_event_callbacks(): target event 1 (halted)
Debug: 221 36 tcl.c:1099 handle_flash_init_command(): Initializing flash devices...
Debug: 222 36 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_mflash init
Debug: 223 36 command.c:143 script_debug(): command - ocd_mflash ocd_mflash init
Debug: 225 38 mflash.c:1377 handle_mflash_init_command(): Initializing mflash devices...
Debug: 226 38 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nand init
Debug: 227 38 command.c:143 script_debug(): command - ocd_nand ocd_nand init
Debug: 229 40 tcl.c:497 handle_nand_init_command(): Initializing NAND devices...
Debug: 230 40 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_pld init
Debug: 231 40 command.c:143 script_debug(): command - ocd_pld ocd_pld init
Debug: 233 42 pld.c:205 handle_pld_init_command(): Initializing PLDs...
Debug: 234 42 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_reset halt
Debug: 235 42 command.c:143 script_debug(): command - reset ocd_reset halt
Debug: 237 44 target.c:1537 target_call_reset_callbacks(): target reset 2 (halt)
Debug: 238 44 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 239 44 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 240 44 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-start
Debug: 241 44 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-start
Debug: 242 44 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 243 44 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 244 44 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 245 44 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 246 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event examine-start
Debug: 247 45 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event examine-start
Debug: 248 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_examine allow-defer
Debug: 249 45 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_examine allow-defer
Debug: 250 45 stm8.c:1612 stm8_examine(): stm8_examine
Debug: 251 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event examine-end
Debug: 252 45 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event examine-end
Debug: 253 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-assert-pre
Debug: 254 45 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-assert-pre
Debug: 255 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 256 45 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 257 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_reset assert 1
Debug: 258 45 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_reset assert 1
Debug: 259 45 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 260 45 stm8.c:893 stm8_reset_assert(): stm8_reset_assert
Debug: 261 45 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 262 45 core.c:725 jtag_add_reset(): SRST line asserted
Debug: 263 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-assert-post
Debug: 264 46 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-assert-post
Debug: 265 46 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-deassert-pre
Debug: 266 46 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-deassert-pre
Debug: 267 46 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 268 46 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 269 46 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_reset deassert 1
Debug: 270 46 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_reset deassert 1
Debug: 271 46 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 272 46 stm8.c:945 stm8_reset_deassert(): stm8_reset_deassert
Debug: 273 46 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 274 46 core.c:729 jtag_add_reset(): SRST line released
Debug: 275 46 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-deassert-post
Debug: 276 46 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-deassert-post
Debug: 277 46 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 278 46 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 279 46 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu was_examined
Debug: 280 46 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu was_examined
Debug: 281 46 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_waitstate halted 1000
Debug: 282 47 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_waitstate halted 1000
Debug: 283 49 stm8.c:1108 stm8_read_core_reg(): read core reg 0 value 0x8000
Debug: 284 49 stm8.c:1108 stm8_read_core_reg(): read core reg 1 value 0x0
Debug: 285 49 stm8.c:1108 stm8_read_core_reg(): read core reg 2 value 0x0
Debug: 286 49 stm8.c:1108 stm8_read_core_reg(): read core reg 3 value 0x0
Debug: 287 49 stm8.c:1108 stm8_read_core_reg(): read core reg 4 value 0x3ff
Debug: 288 49 stm8.c:1108 stm8_read_core_reg(): read core reg 5 value 0x28
Debug: 289 53 stm8.c:442 stm8_examine_debug_reason(): stm8_examine_debug_reason csr1 = 0x10 csr2 = 0x08
Debug: 290 53 stm8.c:482 stm8_debug_entry(): entered debug state at PC 0x8000, target->state: halted
Debug: 291 54 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 292 54 target.c:1519 target_call_event_callbacks(): target event 1 (halted)
User : 293 54 stm8.c:1225 stm8_arch_state(): target halted due to debug-request, pc: 0x00008000
Debug: 294 54 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu curstate
Debug: 295 54 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu curstate
Debug: 296 54 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-end
Debug: 297 54 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-end
Debug: 298 55 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 299 55 command.c:143 script_debug(): command - init ocd_init
Info : 301 14739 server.c:96 add_connection(): accepting 'gdb' connection on tcp/3333
Debug: 302 14739 breakpoints.c:357 breakpoint_clear_target_internal(): Delete all breakpoints for target: stm8.cpu
Debug: 303 14739 breakpoints.c:497 watchpoint_clear_target(): Delete all watchpoints for target: stm8.cpu
Debug: 304 14739 target.c:1519 target_call_event_callbacks(): target event 23 (gdb-attach)
Debug: 305 14739 gdb_server.c:996 gdb_new_connection(): New GDB Connection: 1, Target stm8.cpu, state: halted
Debug: 306 14739 gdb_server.c:2812 gdb_input_inner(): received packet: 'qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+'
Debug: 307 14739 stm8.c:1138 stm8_get_gdb_reg_list(): stm8_get_gdb_reg_list
Debug: 308 14739 gdb_server.c:2812 gdb_input_inner(): received packet: 'vMustReplyEmpty'
Debug: 309 14739 gdb_server.c:2812 gdb_input_inner(): received packet: 'QStartNoAckMode'
Debug: 310 14739 gdb_server.c:632 gdb_get_packet_inner(): Received first acknowledgment after entering noack mode. Ignoring it.
Debug: 311 14739 gdb_server.c:2812 gdb_input_inner(): received packet: '!'
Debug: 312 14739 gdb_server.c:2812 gdb_input_inner(): received packet: 'Hg0'
Debug: 313 14739 gdb_server.c:2812 gdb_input_inner(): received packet: 'qXfer:features:read:target.xml:0,fff'
Debug: 314 14739 stm8.c:1138 stm8_get_gdb_reg_list(): stm8_get_gdb_reg_list
Debug: 315 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'qTStatus'
Debug: 316 14740 gdb_server.c:2812 gdb_input_inner(): received packet: '?'
Debug: 317 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'qXfer:threads:read::0,fff'
Debug: 318 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'Hc-1'
Debug: 319 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'qC'
Debug: 320 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'qAttached'
Debug: 321 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'qOffsets'
Debug: 322 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'g'
Debug: 323 14740 stm8.c:1138 stm8_get_gdb_reg_list(): stm8_get_gdb_reg_list
Debug: 324 14740 gdb_server.c:2812 gdb_input_inner(): received packet: 'qXfer:threads:read::0,fff'
Debug: 325 14741 gdb_server.c:2812 gdb_input_inner(): received packet: 'qSymbol::'
Debug: 326 23189 gdb_server.c:2812 gdb_input_inner(): received packet: 'qRcmd,72657365742068616c74'
Debug: 327 23190 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_reset halt
Debug: 328 23190 command.c:143 script_debug(): command - reset ocd_reset halt
Debug: 330 23191 target.c:1537 target_call_reset_callbacks(): target reset 2 (halt)
Debug: 331 23191 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 332 23191 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 333 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-start
Debug: 334 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-start
Debug: 335 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 336 23192 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 337 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 338 23192 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 339 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event examine-start
Debug: 340 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event examine-start
Debug: 341 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_examine allow-defer
Debug: 342 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_examine allow-defer
Debug: 343 23192 stm8.c:1612 stm8_examine(): stm8_examine
Debug: 344 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event examine-end
Debug: 345 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event examine-end
Debug: 346 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-assert-pre
Debug: 347 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-assert-pre
Debug: 348 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 349 23192 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 350 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_reset assert 1
Debug: 351 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_reset assert 1
Debug: 352 23192 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 353 23192 stm8.c:893 stm8_reset_assert(): stm8_reset_assert
Debug: 354 23192 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 355 23192 core.c:725 jtag_add_reset(): SRST line asserted
Debug: 356 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-assert-post
Debug: 357 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-assert-post
Debug: 358 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-deassert-pre
Debug: 359 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-deassert-pre
Debug: 360 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 361 23192 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 362 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_reset deassert 1
Debug: 363 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_reset deassert 1
Debug: 364 23192 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 365 23192 stm8.c:945 stm8_reset_deassert(): stm8_reset_deassert
Debug: 366 23192 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 367 23192 core.c:729 jtag_add_reset(): SRST line released
Debug: 368 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-deassert-post
Debug: 369 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-deassert-post
Debug: 370 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 371 23192 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 372 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu was_examined
Debug: 373 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu was_examined
Debug: 374 23192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_waitstate halted 1000
Debug: 375 23192 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_waitstate halted 1000
Debug: 376 23195 stm8.c:1108 stm8_read_core_reg(): read core reg 0 value 0x8000
Debug: 377 23195 stm8.c:1108 stm8_read_core_reg(): read core reg 1 value 0x0
Debug: 378 23195 stm8.c:1108 stm8_read_core_reg(): read core reg 2 value 0x0
Debug: 379 23195 stm8.c:1108 stm8_read_core_reg(): read core reg 3 value 0x0
Debug: 380 23195 stm8.c:1108 stm8_read_core_reg(): read core reg 4 value 0x3ff
Debug: 381 23195 stm8.c:1108 stm8_read_core_reg(): read core reg 5 value 0x28
Debug: 382 23199 stm8.c:442 stm8_examine_debug_reason(): stm8_examine_debug_reason csr1 = 0x10 csr2 = 0x08
Debug: 383 23199 stm8.c:482 stm8_debug_entry(): entered debug state at PC 0x8000, target->state: halted
Debug: 384 23199 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 385 23199 target.c:1519 target_call_event_callbacks(): target event 1 (halted)
User : 386 23199 stm8.c:1225 stm8_arch_state(): target halted due to debug-request, pc: 0x00008000
Debug: 387 23199 target.c:1519 target_call_event_callbacks(): target event 6 (gdb-end)
Debug: 388 23199 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu curstate
Debug: 389 23199 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu curstate
Debug: 390 23199 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-end
Debug: 391 23199 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-end
Debug: 392 35728 gdb_server.c:2812 gdb_input_inner(): received packet: 'vKill;a410'
Debug: 393 35729 gdb_server.c:2812 gdb_input_inner(): received packet: 'k'
Debug: 394 35729 gdb_server.c:2812 gdb_input_inner(): received packet: '?'
Debug: 395 35729 gdb_server.c:2812 gdb_input_inner(): received packet: 'Hg0'
Info : 396 39109 server.c:482 server_loop(): rejected 'gdb' connection, no more connections allowed
Debug: 397 39109 gdb_server.c:1022 gdb_connection_closed(): GDB Close, Target: stm8.cpu, state: halted, gdb_actual_connections=0
Debug: 398 39109 target.c:1519 target_call_event_callbacks(): target event 6 (gdb-end)
Debug: 399 39109 target.c:1519 target_call_event_callbacks(): target event 24 (gdb-detach)
Info : 400 39109 server.c:503 server_loop(): dropped 'gdb' connection
OPTION 2
GDB
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from main.elf...done.
(gdb) set remote interrupt-on-connect
(gdb) start
Temporary breakpoint 1 at 0x80b2
Starting program: /home/cas/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/main.elf
Remote debugging using localhost:3333
0x00008000 in ?? ()
Loading section SSEG, size 0x3 lma 0x1
Loading section HOME, size 0x83 lma 0x8000
Loading section GSINIT, size 0x1e lma 0x8083
Load failed
OpenOCD
/home/cas/software/stm8-binutils/bin/openocd -d3 -f tools/openocd-v0.10.0-scripts/stlink-v2.cfg -f tools/openocd-v0.10.0-scripts/stm8.cfg -c "init" -c "reset halt"
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
User : 13 1 command.c:544 command_print(): debug_level: 3
Debug: 14 1 options.c:181 add_default_dirs(): bindir=/home/cas/software/stm8-binutils/bin
Debug: 15 1 options.c:182 add_default_dirs(): pkgdatadir=/home/cas/software/stm8-binutils/share/openocd
Debug: 16 1 options.c:183 add_default_dirs(): exepath=/home/cas/software/stm8-binutils/bin
Debug: 17 1 options.c:184 add_default_dirs(): bin2data=../share/openocd
Debug: 18 1 configuration.c:42 add_script_search_dir(): adding /home/cas/.openocd
Debug: 19 1 configuration.c:42 add_script_search_dir(): adding /home/cas/software/stm8-binutils/bin/../share/openocd/site
Debug: 20 1 configuration.c:42 add_script_search_dir(): adding /home/cas/software/stm8-binutils/bin/../share/openocd/scripts
Debug: 21 1 configuration.c:82 find_file(): found tools/openocd-v0.10.0-scripts/stlink-v2.cfg
Debug: 22 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface hla
Debug: 23 2 command.c:143 script_debug(): command - interface ocd_interface hla
Debug: 25 2 command.c:364 register_command_handler(): registering 'ocd_hla_device_desc'...
Debug: 26 2 command.c:364 register_command_handler(): registering 'ocd_hla_serial'...
Debug: 27 2 command.c:364 register_command_handler(): registering 'ocd_hla_layout'...
Debug: 28 2 command.c:364 register_command_handler(): registering 'ocd_hla_vid_pid'...
Debug: 29 2 command.c:364 register_command_handler(): registering 'ocd_hla_command'...
Debug: 30 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_layout stlink
Debug: 31 2 command.c:143 script_debug(): command - hla_layout ocd_hla_layout stlink
Debug: 33 2 hla_interface.c:239 hl_interface_handle_layout_command(): hl_interface_handle_layout_command
Debug: 34 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_device_desc ST-LINK/V2
Debug: 35 2 command.c:143 script_debug(): command - hla_device_desc ocd_hla_device_desc ST-LINK/V2
Debug: 37 2 hla_interface.c:213 hl_interface_handle_device_desc_command(): hl_interface_handle_device_desc_command
Debug: 38 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_vid_pid 0x0483 0x3748
Debug: 39 2 command.c:143 script_debug(): command - hla_vid_pid ocd_hla_vid_pid 0x0483 0x3748
Debug: 41 2 hla_interface.c:267 hl_interface_handle_vid_pid_command(): hl_interface_handle_vid_pid_command
Debug: 42 2 configuration.c:82 find_file(): found tools/openocd-v0.10.0-scripts/stm8.cfg
Debug: 43 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select stlink_swim
Debug: 44 2 command.c:143 script_debug(): command - ocd_transport ocd_transport select stlink_swim
Debug: 45 2 hla_transport.c:191 hl_transport_select(): hl_transport_select
Debug: 46 2 command.c:364 register_command_handler(): registering 'ocd_hla'...
Debug: 47 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 48 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 49 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 50 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 51 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 52 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 53 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 54 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 55 2 command.c:364 register_command_handler(): registering 'ocd_jtag'...
Debug: 56 2 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
Debug: 57 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla newtap stm8 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0
Debug: 58 2 command.c:143 script_debug(): command - ocd_hla ocd_hla newtap stm8 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0
Debug: 59 2 hla_tcl.c:116 jim_hl_newtap_cmd(): Creating New Tap, Chip: stm8, Tap: cpu, Dotted: stm8.cpu, 8 params
Debug: 60 2 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -irlen
Debug: 61 2 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -ircapture
Debug: 62 2 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -irmask
Debug: 63 2 hla_tcl.c:126 jim_hl_newtap_cmd(): Processing option: -expected-id
Debug: 64 2 core.c:1304 jtag_tap_init(): Created Tap: stm8.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 65 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create stm8.cpu stm8 -chain-position stm8.cpu
Debug: 66 2 command.c:143 script_debug(): command - ocd_target ocd_target create stm8.cpu stm8 -chain-position stm8.cpu
Debug: 67 2 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 68 2 command.c:364 register_command_handler(): registering 'ocd_stm8'...
Debug: 69 2 stm8.c:1082 stm8_target_create(): stm8_target_create
Debug: 70 2 stm8.c:429 stm8_configure_break_unit(): hw breakpoints: numinst 2 numdata 2
Debug: 71 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 72 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 73 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 74 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 75 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 76 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 77 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 78 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 79 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 80 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 81 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 82 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 83 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 84 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 85 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 86 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 87 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 88 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 89 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 90 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 91 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 92 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 93 2 command.c:364 register_command_handler(): registering 'ocd_stm8.cpu'...
Debug: 94 2 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -work-area-phys 0x0 -work-area-size 0x400 -work-area-backup 1
Debug: 95 2 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -work-area-phys 0x0 -work-area-size 0x400 -work-area-backup 1
Debug: 96 2 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 97 2 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 98 3 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 99 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -flashstart 0x8000 -flashend 0xffff -eepromstart 0x4000 -eepromend 0x43ff -optionstart 0x4800 -optionend 0x43ff -blocksize 0x80
Debug: 100 3 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -flashstart 0x8000 -flashend 0xffff -eepromstart 0x4000 -eepromend 0x43ff -optionstart 0x4800 -optionend 0x43ff -blocksize 0x80
Debug: 101 3 stm8.c:1909 stm8_jim_configure(): stm8_jim_configure flashstart=00008000
Debug: 102 3 stm8.c:1928 stm8_jim_configure(): stm8_jim_configure flashend=0000ffff
Debug: 103 3 stm8.c:1947 stm8_jim_configure(): stm8_jim_configure eepromstart=00004000
Debug: 104 3 stm8.c:1966 stm8_jim_configure(): stm8_jim_configure eepromend=000043ff
Debug: 105 3 stm8.c:1985 stm8_jim_configure(): stm8_jim_configure optionstart=00004800
Debug: 106 3 stm8.c:2004 stm8_jim_configure(): stm8_jim_configure optionend=000043ff
Debug: 107 3 stm8.c:1890 stm8_jim_configure(): stm8_jim_configure blocksize=00000080
Debug: 108 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 0
Debug: 109 3 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 0
Debug: 111 3 core.c:1631 jtag_config_khz(): handle jtag khz
Debug: 112 3 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 113 3 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 114 3 command.c:544 command_print(): adapter speed: RCLK - adaptive
Debug: 115 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only
Debug: 116 3 command.c:143 script_debug(): command - reset_config ocd_reset_config srst_only
User : 118 3 command.c:544 command_print(): srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
Debug: 119 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 120 3 command.c:143 script_debug(): command - init ocd_init
Debug: 122 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 123 3 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 125 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 126 3 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 127 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu cget -event gdb-flash-erase-start
Debug: 128 3 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu cget -event gdb-flash-erase-start
Debug: 129 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -event gdb-flash-erase-start reset init
Debug: 130 3 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -event gdb-flash-erase-start reset init
Debug: 131 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu cget -event gdb-flash-write-end
Debug: 132 3 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu cget -event gdb-flash-write-end
Debug: 133 3 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu configure -event gdb-flash-write-end reset halt
Debug: 134 3 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu configure -event gdb-flash-write-end reset halt
Debug: 135 3 target.c:1326 handle_target_init_command(): Initializing targets...
Debug: 136 3 stm8.c:796 stm8_init(): stm8_init
Debug: 137 3 command.c:364 register_command_handler(): registering 'ocd_target_request'...
Debug: 138 3 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 139 3 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 140 3 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
Debug: 141 3 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
Debug: 142 3 command.c:364 register_command_handler(): registering 'ocd_profile'...
Debug: 143 3 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
Debug: 144 3 command.c:364 register_command_handler(): registering 'ocd_reg'...
Debug: 145 3 command.c:364 register_command_handler(): registering 'ocd_poll'...
Debug: 146 3 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
Debug: 147 3 command.c:364 register_command_handler(): registering 'ocd_halt'...
Debug: 148 3 command.c:364 register_command_handler(): registering 'ocd_resume'...
Debug: 149 3 command.c:364 register_command_handler(): registering 'ocd_reset'...
Debug: 150 3 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
Debug: 151 3 command.c:364 register_command_handler(): registering 'ocd_step'...
Debug: 152 3 command.c:364 register_command_handler(): registering 'ocd_mdw'...
Debug: 153 3 command.c:364 register_command_handler(): registering 'ocd_mdh'...
Debug: 154 3 command.c:364 register_command_handler(): registering 'ocd_mdb'...
Debug: 155 3 command.c:364 register_command_handler(): registering 'ocd_mww'...
Debug: 156 3 command.c:364 register_command_handler(): registering 'ocd_mwh'...
Debug: 157 3 command.c:364 register_command_handler(): registering 'ocd_mwb'...
Debug: 158 3 command.c:364 register_command_handler(): registering 'ocd_bp'...
Debug: 159 3 command.c:364 register_command_handler(): registering 'ocd_rbp'...
Debug: 160 3 command.c:364 register_command_handler(): registering 'ocd_wp'...
Debug: 161 3 command.c:364 register_command_handler(): registering 'ocd_rwp'...
Debug: 162 3 command.c:364 register_command_handler(): registering 'ocd_load_image'...
Debug: 163 3 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
Debug: 164 3 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
Debug: 165 3 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
Debug: 166 4 command.c:364 register_command_handler(): registering 'ocd_test_image'...
Debug: 167 4 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
Debug: 168 4 command.c:364 register_command_handler(): registering 'ocd_ps'...
Debug: 169 4 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
Debug: 170 4 hla_interface.c:109 hl_interface_init(): hl_interface_init
Debug: 171 4 hla_layout.c:83 hl_layout_init(): hl_layout_init
Debug: 172 4 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 173 4 core.c:1601 adapter_khz_to_speed(): have interface set up
Info : 174 4 stlink_usb.c:1932 stlink_speed(): Unable to match requested speed 0 kHz, using 5 kHz
Debug: 175 4 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 176 4 core.c:1601 adapter_khz_to_speed(): have interface set up
Info : 177 4 stlink_usb.c:1932 stlink_speed(): Unable to match requested speed 0 kHz, using 5 kHz
Info : 178 4 core.c:1384 adapter_init(): RCLK (adaptive clock speed) not supported - fallback to 5 kHz
Debug: 179 4 openocd.c:140 handle_init_command(): Debug Adapter init complete
Debug: 180 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 181 4 command.c:143 script_debug(): command - ocd_transport ocd_transport init
Debug: 183 4 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 184 4 hla_transport.c:152 hl_transport_init(): hl_transport_init
Debug: 185 4 hla_transport.c:169 hl_transport_init(): current transport stlink_swim
Debug: 186 4 hla_interface.c:42 hl_interface_open(): hl_interface_open
Debug: 187 4 hla_layout.c:40 hl_layout_open(): hl_layout_open
Debug: 188 4 stlink_usb.c:1966 stlink_usb_open(): stlink_usb_open
Debug: 189 4 stlink_usb.c:1983 stlink_usb_open(): transport: 3 vid: 0x0483 pid: 0x3748 serial:
Info : 190 6 stlink_usb.c:658 stlink_usb_version(): STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : 191 6 stlink_usb.c:2094 stlink_usb_open(): using stlink api v2
Debug: 192 6 stlink_usb.c:859 stlink_usb_init_mode(): MODE: 0x03
Info : 193 7 stlink_usb.c:690 stlink_usb_check_voltage(): Target voltage: 3.266932
Debug: 194 7 stlink_usb.c:914 stlink_usb_init_mode(): MODE: 0x01
Debug: 195 7 stlink_usb.c:940 stlink_usb_init_mode(): MODE: 0x03
Debug: 196 17 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 197 17 core.c:729 jtag_add_reset(): SRST line released
Debug: 198 17 core.c:753 jtag_add_reset(): TRST line released
Debug: 199 17 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 200 18 hla_interface.c:67 hl_interface_init_target(): hl_interface_init_target
Debug: 201 18 openocd.c:153 handle_init_command(): Examining targets...
Debug: 202 18 target.c:1519 target_call_event_callbacks(): target event 21 (examine-start)
Debug: 203 18 stm8.c:1612 stm8_examine(): stm8_examine
Debug: 204 18 stm8.c:1617 stm8_examine(): writing A0 to SWIM_CSR
Debug: 205 19 stm8.c:1622 stm8_examine(): writing B0 to SWIM_CSR
Debug: 206 21 target.c:1519 target_call_event_callbacks(): target event 22 (examine-end)
Debug: 207 21 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash init
Debug: 208 21 command.c:143 script_debug(): command - ocd_flash ocd_flash init
Debug: 209 22 stm8.c:825 stm8_poll(): DM_CSR2_STALL already set during server startup.
Debug: 210 24 stm8.c:1108 stm8_read_core_reg(): read core reg 0 value 0x8000
Debug: 211 24 stm8.c:1108 stm8_read_core_reg(): read core reg 1 value 0x0
Debug: 212 24 stm8.c:1108 stm8_read_core_reg(): read core reg 2 value 0x0
Debug: 213 24 stm8.c:1108 stm8_read_core_reg(): read core reg 3 value 0x0
Debug: 214 24 stm8.c:1108 stm8_read_core_reg(): read core reg 4 value 0x3ff
Debug: 215 24 stm8.c:1108 stm8_read_core_reg(): read core reg 5 value 0x28
Debug: 216 28 stm8.c:442 stm8_examine_debug_reason(): stm8_examine_debug_reason csr1 = 0x10 csr2 = 0x08
Debug: 217 28 stm8.c:482 stm8_debug_entry(): entered debug state at PC 0x8000, target->state: halted
Debug: 218 28 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 219 28 target.c:1519 target_call_event_callbacks(): target event 1 (halted)
Debug: 221 28 tcl.c:1099 handle_flash_init_command(): Initializing flash devices...
Debug: 222 28 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_mflash init
Debug: 223 28 command.c:143 script_debug(): command - ocd_mflash ocd_mflash init
Debug: 225 29 mflash.c:1377 handle_mflash_init_command(): Initializing mflash devices...
Debug: 226 29 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nand init
Debug: 227 29 command.c:143 script_debug(): command - ocd_nand ocd_nand init
Debug: 229 31 tcl.c:497 handle_nand_init_command(): Initializing NAND devices...
Debug: 230 31 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_pld init
Debug: 231 31 command.c:143 script_debug(): command - ocd_pld ocd_pld init
Debug: 233 32 pld.c:205 handle_pld_init_command(): Initializing PLDs...
Debug: 234 32 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_reset halt
Debug: 235 32 command.c:143 script_debug(): command - reset ocd_reset halt
Debug: 237 34 target.c:1537 target_call_reset_callbacks(): target reset 2 (halt)
Debug: 238 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 239 34 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 240 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-start
Debug: 241 34 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-start
Debug: 242 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 243 34 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 244 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 245 34 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 246 34 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event examine-start
Debug: 247 34 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event examine-start
Debug: 248 35 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_examine allow-defer
Debug: 249 35 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_examine allow-defer
Debug: 250 35 stm8.c:1612 stm8_examine(): stm8_examine
Debug: 251 35 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event examine-end
Debug: 252 35 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event examine-end
Debug: 253 35 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-assert-pre
Debug: 254 35 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-assert-pre
Debug: 255 35 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 256 35 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 257 35 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_reset assert 1
Debug: 258 35 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_reset assert 1
Debug: 259 35 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 260 35 stm8.c:893 stm8_reset_assert(): stm8_reset_assert
Debug: 261 35 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 262 35 core.c:725 jtag_add_reset(): SRST line asserted
Debug: 263 36 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-assert-post
Debug: 264 36 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-assert-post
Debug: 265 36 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-deassert-pre
Debug: 266 36 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-deassert-pre
Debug: 267 36 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 268 36 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 269 36 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_reset deassert 1
Debug: 270 36 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_reset deassert 1
Debug: 271 36 target.c:1901 target_free_all_working_areas_restore(): freeing all working areas
Debug: 272 36 stm8.c:945 stm8_reset_deassert(): stm8_reset_deassert
Debug: 273 36 hla_interface.c:127 hl_interface_execute_queue(): hl_interface_execute_queue: ignored
Debug: 274 36 core.c:729 jtag_add_reset(): SRST line released
Debug: 275 37 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-deassert-post
Debug: 276 37 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-deassert-post
Debug: 277 37 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 278 37 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 279 37 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu was_examined
Debug: 280 37 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu was_examined
Debug: 281 37 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_waitstate halted 1000
Debug: 282 37 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_waitstate halted 1000
Debug: 283 40 stm8.c:1108 stm8_read_core_reg(): read core reg 0 value 0x8000
Debug: 284 40 stm8.c:1108 stm8_read_core_reg(): read core reg 1 value 0x0
Debug: 285 40 stm8.c:1108 stm8_read_core_reg(): read core reg 2 value 0x0
Debug: 286 40 stm8.c:1108 stm8_read_core_reg(): read core reg 3 value 0x0
Debug: 287 40 stm8.c:1108 stm8_read_core_reg(): read core reg 4 value 0x3ff
Debug: 288 40 stm8.c:1108 stm8_read_core_reg(): read core reg 5 value 0x28
Debug: 289 44 stm8.c:442 stm8_examine_debug_reason(): stm8_examine_debug_reason csr1 = 0x10 csr2 = 0x08
Debug: 290 44 stm8.c:482 stm8_debug_entry(): entered debug state at PC 0x8000, target->state: halted
Debug: 291 44 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 292 44 target.c:1519 target_call_event_callbacks(): target event 1 (halted)
User : 293 45 stm8.c:1225 stm8_arch_state(): target halted due to debug-request, pc: 0x00008000
Debug: 294 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu curstate
Debug: 295 45 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu curstate
Debug: 296 45 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-end
Debug: 297 45 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-end
Debug: 298 47 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 299 47 command.c:143 script_debug(): command - init ocd_init
Info : 301 10009 server.c:96 add_connection(): accepting 'gdb' connection on tcp/3333
Debug: 302 10009 breakpoints.c:357 breakpoint_clear_target_internal(): Delete all breakpoints for target: stm8.cpu
Debug: 303 10009 breakpoints.c:497 watchpoint_clear_target(): Delete all watchpoints for target: stm8.cpu
Debug: 304 10009 target.c:1519 target_call_event_callbacks(): target event 23 (gdb-attach)
Debug: 305 10009 gdb_server.c:996 gdb_new_connection(): New GDB Connection: 1, Target stm8.cpu, state: halted
Debug: 306 10009 gdb_server.c:2812 gdb_input_inner(): received packet: ''
Info : 307 10009 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 308 10009 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 309 10009 gdb_server.c:2812 gdb_input_inner(): received packet: 'qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+'
Debug: 310 10009 stm8.c:1138 stm8_get_gdb_reg_list(): stm8_get_gdb_reg_list
Info : 311 10009 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 312 10009 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 313 10009 gdb_server.c:2812 gdb_input_inner(): received packet: 'vMustReplyEmpty'
Info : 314 10009 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 315 10009 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 316 10009 gdb_server.c:2812 gdb_input_inner(): received packet: 'QStartNoAckMode'
Info : 317 10009 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 318 10009 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 319 10009 gdb_server.c:632 gdb_get_packet_inner(): Received first acknowledgment after entering noack mode. Ignoring it.
Debug: 320 10009 gdb_server.c:2812 gdb_input_inner(): received packet: '!'
Info : 321 10009 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 322 10009 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 323 10009 gdb_server.c:2812 gdb_input_inner(): received packet: 'Hg0'
Info : 324 10009 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 325 10009 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 326 10009 gdb_server.c:2812 gdb_input_inner(): received packet: 'qXfer:features:read:target.xml:0,fff'
Debug: 327 10009 stm8.c:1138 stm8_get_gdb_reg_list(): stm8_get_gdb_reg_list
Info : 328 10009 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 329 10009 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 330 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'qTStatus'
Info : 331 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 332 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 333 10010 gdb_server.c:2812 gdb_input_inner(): received packet: '?'
Info : 334 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 335 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 336 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'qXfer:threads:read::0,fff'
Info : 337 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 338 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 339 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'Hc-1'
Info : 340 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 341 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 342 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'qC'
Info : 343 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 344 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 345 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'qAttached'
Info : 346 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 347 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 348 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'qOffsets'
Info : 349 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 350 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 351 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'g'
Debug: 352 10010 stm8.c:1138 stm8_get_gdb_reg_list(): stm8_get_gdb_reg_list
Info : 353 10010 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 354 10010 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 355 10010 gdb_server.c:2812 gdb_input_inner(): received packet: 'm8080,40'
Debug: 356 10011 gdb_server.c:1386 gdb_read_memory_packet(): addr: 0x00008080, len: 0x00000040
Debug: 357 10011 target.c:2093 target_read_buffer(): reading buffer of 64 byte at 0x00008080
Info : 358 10013 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 359 10013 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 360 10013 gdb_server.c:2812 gdb_input_inner(): received packet: 'm80b2,1'
Debug: 361 10013 gdb_server.c:1386 gdb_read_memory_packet(): addr: 0x000080b2, len: 0x00000001
Debug: 362 10013 target.c:2093 target_read_buffer(): reading buffer of 1 byte at 0x000080b2
Info : 363 10015 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 364 10015 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 365 10015 gdb_server.c:2812 gdb_input_inner(): received packet: 'qXfer:threads:read::0,fff'
Info : 366 10015 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 367 10015 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 368 10015 gdb_server.c:2812 gdb_input_inner(): received packet: 'qSymbol::'
Info : 369 10015 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 370 10015 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 371 10015 gdb_server.c:2810 gdb_input_inner(): received packet: 'X1,0:<binary-data>'
Info : 372 10015 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 373 10015 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 374 10015 gdb_server.c:2810 gdb_input_inner(): received packet: 'X1,3:<binary-data>'
Debug: 375 10015 gdb_server.c:1526 gdb_write_memory_binary_packet(): addr: 0x00000001, len: 0x00000003
Debug: 376 10015 target.c:2032 target_write_buffer(): writing buffer of 3 byte at 0x00000001
Info : 377 10018 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 378 10018 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 379 10018 gdb_server.c:2810 gdb_input_inner(): received packet: 'X8000,83:<binary-data>'
Debug: 380 10018 gdb_server.c:1526 gdb_write_memory_binary_packet(): addr: 0x00008000, len: 0x00000083
Debug: 381 10018 target.c:2032 target_write_buffer(): writing buffer of 131 byte at 0x00008000
Info : 382 10030 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 383 10030 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 384 10030 gdb_server.c:2810 gdb_input_inner(): received packet: 'X8083,1e:<binary-data>'
Debug: 385 10030 gdb_server.c:1343 gdb_error(): Reporting -4 to GDB as generic error
Debug: 386 10030 gdb_server.c:1526 gdb_write_memory_binary_packet(): addr: 0x00008083, len: 0x0000001e
Debug: 387 10030 target.c:2032 target_write_buffer(): writing buffer of 30 byte at 0x00008083
Info : 388 10041 gdb_server.c:3006 gdb_input_inner(): The target is not running when halt was requested, stopping GDB.
Debug: 389 10041 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 390 10143 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
User : 391 10143 target.c:2595 handle_target(): Polling target stm8.cpu failed, trying to reexamine
Debug: 392 10143 target.c:1519 target_call_event_callbacks(): target event 21 (examine-start)
Debug: 393 10143 stm8.c:1612 stm8_examine(): stm8_examine
Info : 394 10143 stm8.c:1630 stm8_examine(): trying to reconnect
Debug: 395 10145 target.c:1519 target_call_event_callbacks(): target event 22 (examine-end)
I can't find any obvious problems with the log.
However I suggest you upgrade the stlink dongle to latest version. The one you have is outdated. Current swim is v6... see excerpt from my dongle:
Info : 190 312 stlink_usb.c:658 stlink_usb_version(): STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Thanks. I will try. I will report if I get it working!!
I just upgrade and stlinkv2 to the latest firmware, SWIM v7:
STLINK v2 JTAG v28 API v2 SWIM v7 VID 0x0483 PID 0x3748
But the same issue. I bought a board with STM8S105 and I will try with that one when it arrives - will give feedback.
Thanks!!
I thought you were already using stm8s105? right? because I know the STM8L has some problems with readout protection.
Actually now that I see it's a small flash device you should change the blocksize in scripts/target/stm8.cfg to 0x40
Changed that to 0x40, but still the same :-(
if { [info exists BLOCKSIZE] } {
set _BLOCKSIZE $BLOCKSIZE
} else {
set _BLOCKSIZE 0x40
}
The guys using Arduino with STM8, would be great if they could also debug!! No debug on AVR...
I have to get my hands on one of those small flash stm8. All development was made on a stm8s105 so no testing was ever done on either stm8l or any small flash devices.
So I should get one with STM8S105 and then I will try. Also the EBike controllers I want to develop firmware for, also use STM8S105 :-)
Could you dump the OPT0 (ROP) and OPT1 (UBC) bytes?
mon mdb 0x4800
and
mon mdb 0x4801
cas@cas-sp4:~$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
Did you looked at stm8flash sources?? because it flash it perfectly.
I have no clue why its not working. I dont know if is read out protection causing all this trouble or if stm8flash utility is programming the ROP or if it is a problem with the stlink interface.
Did you try stm8flash -u ?
Last edit: akre 2017-05-11
stm8flash -c stlinkv2 -p stm8s003f3 -u
Determine OPT area
No unlocking mode defined for this device. You may need to edit the file stm8.c
stm8.c:
{
.name = "stm8s003?3",
.ram_start = 0x0000,
.ram_size = 11024,
.eeprom_start = 0x4000,
.eeprom_size = 128,
.flash_start = 0x8000,
.flash_size = 81024,
.flash_block_size = 64,
.option_bytes_size =0,
.read_out_protection_mode = ROP_UNKNOWN,
REGS_STM8S
},
I did this the very first time, to unlock (found this info online):
echo "00 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > factory_defaults.bin
stm8flash -c stlinkv2 -p stm8s103f3 -s opt -w factory_defaults.bin
I already verified the code of stm8flash, they send the same bytes to unlock the MASS, just like OpenOCD.
echo "00 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > factory_defaults.bin
stm8flash -c stlinkv2 -p stm8s103f3 -s opt -w factory_defaults.bin
Altough I did -p stm8s103f3, the same bytes apply to STM8S003 and should unlock it -- verified now on the datasheet.
Ok, let's wait for the STM8S105 that should arrive on next 2 or 4 days.
What happens if you just write a byte to 0x8000?
mon reset halt
mon mwb 0x8000 0x11
mon mdb 0x8000
if that works test write 4 bytes
mon reset halt
mon mwb 0x8000 0x22 4
mon mdb 0x8000 4
if that works test write 64 bytes
mon reset halt
mon mwb 0x8000 0x33 64
mon mdb 0x8000 64
Works!!
cas@cas-sp4:~$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
And now what??...
Last edit: casainho 2017-05-12
Obviously its not a problem with flashing...
Did you try flashing with load command?
file test.elf
tar ext :3333
mon reset halt
load
Still fails, the same output:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
Polling target stm8.cpu failed, trying to reexamine
trying to reconnect
Debug: 359 28195 configuration.c:82 find_file(): found main.bin
Debug: 360 28196 target.c:2032 target_write_buffer(): writing buffer of 223 byte at 0x00008000
Debug: 361 28208 command.c:626 run_command(): Command failed with error code -305
Debug: 338 16397 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu arp_waitstate halted 1000
Debug: 339 16397 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu arp_waitstate halted 1000
Debug: 340 16401 stm8.c:1108 stm8_read_core_reg(): read core reg 0 value 0x8000
Debug: 341 16401 stm8.c:1108 stm8_read_core_reg(): read core reg 1 value 0x0
Debug: 342 16401 stm8.c:1108 stm8_read_core_reg(): read core reg 2 value 0x0
Debug: 343 16401 stm8.c:1108 stm8_read_core_reg(): read core reg 3 value 0x0
Debug: 344 16401 stm8.c:1108 stm8_read_core_reg(): read core reg 4 value 0x3ff
Debug: 345 16401 stm8.c:1108 stm8_read_core_reg(): read core reg 5 value 0x28
Debug: 346 16406 stm8.c:442 stm8_examine_debug_reason(): stm8_examine_debug_reason csr1 = 0x10 csr2 = 0x08
Debug: 347 16406 stm8.c:482 stm8_debug_entry(): entered debug state at PC 0x8000, target->state: halted
Debug: 348 16406 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
Debug: 349 16406 target.c:1519 target_call_event_callbacks(): target event 1 (halted)
User : 350 16406 stm8.c:1225 stm8_arch_state(): target halted due to debug-request, pc: 0x00008000
Debug: 351 16406 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu curstate
Debug: 352 16406 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu curstate
Debug: 353 16406 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_stm8.cpu invoke-event reset-end
Debug: 354 16407 command.c:143 script_debug(): command - ocd_stm8.cpu ocd_stm8.cpu invoke-event reset-end
Debug: 355 28192 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_load_image main.bin 0x8000
Debug: 356 28192 command.c:143 script_debug(): command - load_image ocd_load_image main.bin 0x8000
Debug: 358 28195 configuration.c:82 find_file(): found main.bin
Debug: 359 28195 configuration.c:82 find_file(): found main.bin
Debug: 360 28196 target.c:2032 target_write_buffer(): writing buffer of 223 byte at 0x00008000
Debug: 361 28208 command.c:626 run_command(): Command failed with error code -305
User : 362 28208 command.c:687 command_run_line():
Debug: 363 28310 target.c:1519 target_call_event_callbacks(): target event 0 (gdb-halt)
User : 364 28310 target.c:2595 handle_target(): Polling target stm8.cpu failed, trying to reexamine
Debug: 365 28311 target.c:1519 target_call_event_callbacks(): target event 21 (examine-start)
Debug: 366 28311 stm8.c:1612 stm8_examine(): stm8_examine
Info : 367 28311 stm8.c:1630 stm8_examine(): trying to reconnect
Debug: 368 28313 target.c:1519 target_call_event_callbacks(): target event 22 (examine-end)
Debug: 369 77553 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_load_image main.bin 0x0
Debug: 370 77553 command.c:143 script_debug(): command - load_image ocd_load_image main.bin 0x0
Debug: 372 77555 configuration.c:82 find_file(): found main.bin
Debug: 373 77555 configuration.c:82 find_file(): found main.bin
Debug: 374 77555 target.c:2032 target_write_buffer(): writing buffer of 223 byte at 0x00000000
User : 375 77568 command.c:544 command_print(): 223 bytes written at address 0x00000000
User : 376 77568 command.c:544 command_print(): downloaded 223 bytes in 0.013074s (16.657 KiB/s)
No, I asked what happens with "load" not "load_image"
file "main.elf"
tar ext: 3333
mon reset halt
load