SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By tatery
#191493
Hi,

I'd like to program SAM4E8C but so far with no success. I use raspberry pi3 as SWD as described here: https://learn.adafruit.com/programming- ... i/overview and all is fine till command: sudo openocd
Code: Select all
sudo openocd
Open On-Chip Debugger 0.10.0-dev-00371-g81631e4 (2016-08-29-12:46)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
BCM2835 GPIO nums: swclk = 25, swdio = 24
BCM2835 GPIO config: srst = 18
srst_only separate srst_gates_jtag srst_push_pull connect_deassert_srst
adapter speed: 100 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
srst_only separate srst_nogate srst_push_pull connect_deassert_srst
adapter_nsrst_delay: 100
adapter_nsrst_assert_width: 100
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : SWD only mode enabled (specify tck, tms, tdi and tdo gpios to add JTAG mode)
Info : clock speed 100 kHz
in procedure 'init' called at file "openocd.cfg", line 14
in procedure 'ocd_bouncer'
openocd output debug log (sudo openocd):
Code: Select all
Debug: 17 16 options.c:96 add_default_dirs(): bindir=/usr/local/bin
Debug: 18 16 options.c:97 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
Debug: 19 16 options.c:98 add_default_dirs(): run_prefix=
Debug: 20 16 configuration.c:42 add_script_search_dir(): adding /root/.openocd
Debug: 21 16 configuration.c:42 add_script_search_dir(): adding /usr/local/share/openocd/site
Debug: 22 16 configuration.c:42 add_script_search_dir(): adding /usr/local/share/openocd/scripts
Debug: 23 16 configuration.c:82 find_file(): found openocd.cfg
Debug: 24 17 configuration.c:82 find_file(): found /usr/local/share/openocd/scripts/interface/raspberrypi2-native.cfg
Debug: 25 17 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface bcm2835gpio
Debug: 26 17 command.c:143 script_debug(): command - interface ocd_interface bcm2835gpio
Debug: 28 17 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_jtag_nums'...
Debug: 29 17 command.c:323 command_new(): BUG: command 'bcm2835gpio_tck_num' does not have the '.usage' field filled out
Debug: 30 17 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_tck_num'...
Debug: 31 17 command.c:323 command_new(): BUG: command 'bcm2835gpio_tms_num' does not have the '.usage' field filled out
Debug: 32 17 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_tms_num'...
Debug: 33 17 command.c:323 command_new(): BUG: command 'bcm2835gpio_tdo_num' does not have the '.usage' field filled out
Debug: 34 17 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_tdo_num'...
Debug: 35 18 command.c:323 command_new(): BUG: command 'bcm2835gpio_tdi_num' does not have the '.usage' field filled out
Debug: 36 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_tdi_num'...
Debug: 37 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_swd_nums'...
Debug: 38 18 command.c:323 command_new(): BUG: command 'bcm2835gpio_swclk_num' does not have the '.usage' field filled out
Debug: 39 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_swclk_num'...
Debug: 40 18 command.c:323 command_new(): BUG: command 'bcm2835gpio_swdio_num' does not have the '.usage' field filled out
Debug: 41 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_swdio_num'...
Debug: 42 18 command.c:323 command_new(): BUG: command 'bcm2835gpio_srst_num' does not have the '.usage' field filled out
Debug: 43 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_srst_num'...
Debug: 44 18 command.c:323 command_new(): BUG: command 'bcm2835gpio_trst_num' does not have the '.usage' field filled out
Debug: 45 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_trst_num'...
Debug: 46 18 command.c:323 command_new(): BUG: command 'bcm2835gpio_speed_coeffs' does not have the '.usage' field filled out
Debug: 47 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_speed_coeffs'...
Debug: 48 18 command.c:323 command_new(): BUG: command 'bcm2835gpio_peripheral_base' does not have the '.usage' field filled out
Debug: 49 18 command.c:364 register_command_handler(): registering 'ocd_bcm2835gpio_peripheral_base'...
Debug: 50 18 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_bcm2835gpio_peripheral_base 0x3F000000
Debug: 51 19 command.c:143 script_debug(): command - bcm2835gpio_peripheral_base ocd_bcm2835gpio_peripheral_base 0x3F000000
Debug: 53 19 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_bcm2835gpio_speed_coeffs 146203 36
Debug: 54 19 command.c:143 script_debug(): command - bcm2835gpio_speed_coeffs ocd_bcm2835gpio_speed_coeffs 146203 36
Debug: 56 19 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_bcm2835gpio_swd_nums 25 24
Debug: 57 19 command.c:143 script_debug(): command - bcm2835gpio_swd_nums ocd_bcm2835gpio_swd_nums 25 24
User : 59 19 command.c:544 command_print(): BCM2835 GPIO nums: swclk = 25, swdio = 24
Debug: 60 19 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_bcm2835gpio_srst_num 18
Debug: 61 20 command.c:143 script_debug(): command - bcm2835gpio_srst_num ocd_bcm2835gpio_srst_num 18
User : 63 20 command.c:544 command_print(): BCM2835 GPIO config: srst = 18
Debug: 64 20 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only srst_push_pull
Debug: 65 20 command.c:143 script_debug(): command - reset_config ocd_reset_config srst_only srst_push_pull
User : 67 20 command.c:544 command_print(): srst_only separate srst_gates_jtag srst_push_pull connect_deassert_srst
Debug: 68 20 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select swd
Debug: 69 20 command.c:143 script_debug(): command - ocd_transport ocd_transport select swd
Debug: 70 20 command.c:323 command_new(): BUG: command 'swd' does not have the '.usage' field filled out
Debug: 71 20 command.c:364 register_command_handler(): registering 'ocd_swd'...
Debug: 72 20 bitbang.c:353 bitbang_swd_init(): bitbang_swd_init
Debug: 73 20 configuration.c:82 find_file(): found /usr/local/share/openocd/scripts/target/at91sam4XXX.cfg
Debug: 74 21 configuration.c:82 find_file(): found /usr/local/share/openocd/scripts/target/swj-dp.tcl
Debug: 75 21 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 76 21 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 77 22 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 78 22 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 79 22 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 80 22 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 81 22 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 82 22 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 83 23 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_swd newdap ATSAM4E8C cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x4ba00477
Debug: 84 23 command.c:143 script_debug(): command - ocd_swd ocd_swd newdap ATSAM4E8C cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x4ba00477
Debug: 85 23 tcl.c:549 jim_newtap_cmd(): Creating New Tap, Chip: ATSAM4E8C, Tap: cpu, Dotted: ATSAM4E8C.cpu, 8 params
Debug: 86 23 core.c:1304 jtag_tap_init(): Created Tap: ATSAM4E8C.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
Debug: 87 23 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create ATSAM4E8C.cpu cortex_m -endian little -chain-position ATSAM4E8C.cpu
Debug: 88 23 command.c:143 script_debug(): command - ocd_target ocd_target create ATSAM4E8C.cpu cortex_m -endian little -chain-position ATSAM4E8C.cpu
Debug: 89 24 target.c:1892 target_free_all_working_areas_restore(): freeing all working areas
Debug: 90 24 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 91 24 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 92 24 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 93 24 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 94 24 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 95 24 command.c:364 register_command_handler(): registering 'ocd_arm'...
Debug: 96 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 97 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 98 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 99 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 100 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 101 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 102 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 103 24 command.c:364 register_command_handler(): registering 'ocd_dap'...
Debug: 104 25 command.c:364 register_command_handler(): registering 'ocd_tpiu'...
Debug: 105 25 command.c:364 register_command_handler(): registering 'ocd_itm'...
Debug: 106 25 command.c:364 register_command_handler(): registering 'ocd_itm'...
Debug: 107 25 command.c:364 register_command_handler(): registering 'ocd_cortex_m'...
Debug: 108 25 command.c:364 register_command_handler(): registering 'ocd_cortex_m'...
Debug: 109 25 command.c:364 register_command_handler(): registering 'ocd_cortex_m'...
Debug: 110 25 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 111 25 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 112 25 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 113 25 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 114 25 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 115 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 116 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 117 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 118 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 119 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 120 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 121 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 122 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 123 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 124 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 125 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 126 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 127 26 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 128 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 129 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 130 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 131 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 132 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 133 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 134 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 135 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 136 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 137 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 138 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 139 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 140 27 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 141 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 142 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 143 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 144 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 145 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 146 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 147 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 148 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 149 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 150 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 151 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 152 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 153 28 command.c:364 register_command_handler(): registering 'ocd_ATSAM4E8C.cpu'...
Debug: 154 29 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ATSAM4E8C.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
Debug: 155 29 command.c:143 script_debug(): command - ocd_ATSAM4E8C.cpu ocd_ATSAM4E8C.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
Debug: 156 29 target.c:1892 target_free_all_working_areas_restore(): freeing all working areas
Debug: 157 29 target.c:1892 target_free_all_working_areas_restore(): freeing all working areas
Debug: 158 29 target.c:1892 target_free_all_working_areas_restore(): freeing all working areas
Debug: 159 29 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 100
Debug: 160 29 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 100
Debug: 162 29 core.c:1631 jtag_config_khz(): handle jtag khz
Debug: 163 29 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 164 29 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
User : 165 29 command.c:544 command_print(): adapter speed: 100 kHz
Debug: 166 30 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_nsrst_delay 100
Debug: 167 30 command.c:143 script_debug(): command - adapter_nsrst_delay ocd_adapter_nsrst_delay 100
User : 169 30 command.c:544 command_print(): adapter_nsrst_delay: 100
Debug: 170 30 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 171 30 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 172 30 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
Debug: 173 30 command.c:143 script_debug(): command - ocd_transport ocd_transport select
Debug: 174 30 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_cortex_m reset_config sysresetreq
Debug: 175 30 command.c:143 script_debug(): command - ocd_cortex_m ocd_cortex_m reset_config sysresetreq
User : 177 31 command.c:544 command_print(): cortex_m reset_config sysresetreq
Debug: 178 31 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_nogate
Debug: 179 31 command.c:143 script_debug(): command - reset_config ocd_reset_config srst_nogate
User : 181 31 command.c:544 command_print(): srst_only separate srst_nogate srst_push_pull connect_deassert_srst
Debug: 182 31 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_nsrst_delay 100
Debug: 183 31 command.c:143 script_debug(): command - adapter_nsrst_delay ocd_adapter_nsrst_delay 100
User : 185 31 command.c:544 command_print(): adapter_nsrst_delay: 100
Debug: 186 31 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_nsrst_assert_width 100
Debug: 187 31 command.c:143 script_debug(): command - adapter_nsrst_assert_width ocd_adapter_nsrst_assert_width 100
User : 189 31 command.c:544 command_print(): adapter_nsrst_assert_width: 100
Debug: 190 32 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 191 32 command.c:143 script_debug(): command - init ocd_init
Debug: 193 32 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 194 32 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 196 32 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 197 32 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 198 32 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ATSAM4E8C.cpu cget -event gdb-flash-erase-start
Debug: 199 33 command.c:143 script_debug(): command - ocd_ATSAM4E8C.cpu ocd_ATSAM4E8C.cpu cget -event gdb-flash-erase-start
Debug: 200 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ATSAM4E8C.cpu configure -event gdb-flash-erase-start reset init
Debug: 201 33 command.c:143 script_debug(): command - ocd_ATSAM4E8C.cpu ocd_ATSAM4E8C.cpu configure -event gdb-flash-erase-start reset init
Debug: 202 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ATSAM4E8C.cpu cget -event gdb-flash-write-end
Debug: 203 33 command.c:143 script_debug(): command - ocd_ATSAM4E8C.cpu ocd_ATSAM4E8C.cpu cget -event gdb-flash-write-end
Debug: 204 33 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_ATSAM4E8C.cpu configure -event gdb-flash-write-end reset halt
Debug: 205 33 command.c:143 script_debug(): command - ocd_ATSAM4E8C.cpu ocd_ATSAM4E8C.cpu configure -event gdb-flash-write-end reset halt
Debug: 206 34 target.c:1317 handle_target_init_command(): Initializing targets...
Debug: 207 34 command.c:364 register_command_handler(): registering 'ocd_target_request'...
Debug: 208 34 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 209 34 command.c:364 register_command_handler(): registering 'ocd_trace'...
Debug: 210 34 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
Debug: 211 34 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
Debug: 212 34 command.c:364 register_command_handler(): registering 'ocd_profile'...
Debug: 213 34 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
Debug: 214 34 command.c:364 register_command_handler(): registering 'ocd_reg'...
Debug: 215 34 command.c:364 register_command_handler(): registering 'ocd_poll'...
Debug: 216 34 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
Debug: 217 34 command.c:364 register_command_handler(): registering 'ocd_halt'...
Debug: 218 34 command.c:364 register_command_handler(): registering 'ocd_resume'...
Debug: 219 35 command.c:364 register_command_handler(): registering 'ocd_reset'...
Debug: 220 35 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
Debug: 221 35 command.c:364 register_command_handler(): registering 'ocd_step'...
Debug: 222 35 command.c:364 register_command_handler(): registering 'ocd_mdw'...
Debug: 223 35 command.c:364 register_command_handler(): registering 'ocd_mdh'...
Debug: 224 35 command.c:364 register_command_handler(): registering 'ocd_mdb'...
Debug: 225 35 command.c:364 register_command_handler(): registering 'ocd_mww'...
Debug: 226 35 command.c:364 register_command_handler(): registering 'ocd_mwh'...
Debug: 227 35 command.c:364 register_command_handler(): registering 'ocd_mwb'...
Debug: 228 35 command.c:364 register_command_handler(): registering 'ocd_bp'...
Debug: 229 35 command.c:364 register_command_handler(): registering 'ocd_rbp'...
Debug: 230 35 command.c:364 register_command_handler(): registering 'ocd_wp'...
Debug: 231 36 command.c:364 register_command_handler(): registering 'ocd_rwp'...
Debug: 232 36 command.c:364 register_command_handler(): registering 'ocd_load_image'...
Debug: 233 36 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
Debug: 234 36 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
Debug: 235 36 command.c:364 register_command_handler(): registering 'ocd_test_image'...
Debug: 236 36 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
Debug: 237 36 command.c:364 register_command_handler(): registering 'ocd_ps'...
Debug: 238 36 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
Info : 239 36 bcm2835gpio.c:428 bcm2835gpio_init(): BCM2835 GPIO JTAG/SWD bitbang driver
Info : 240 36 bcm2835gpio.c:440 bcm2835gpio_init(): SWD only mode enabled (specify tck, tms, tdi and tdo gpios to add JTAG mode)
Debug: 241 36 bcm2835gpio.c:507 bcm2835gpio_init(): saved pinmux settings: tck 0 tms 0 tdi 0 tdo 0 trst 0 srst 0
Debug: 242 36 bitbang.c:408 bitbang_switch_to_swd(): bitbang_switch_to_swd
Debug: 243 36 bitbang.c:360 bitbang_exchange(): bitbang_exchange
Debug: 244 37 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 245 37 core.c:1601 adapter_khz_to_speed(): have interface set up
Debug: 246 37 core.c:1598 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 247 37 core.c:1601 adapter_khz_to_speed(): have interface set up
Info : 248 37 core.c:1386 adapter_init(): clock speed 100 kHz
Debug: 249 37 openocd.c:135 handle_init_command(): Debug Adapter init complete
Debug: 250 37 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 251 37 command.c:143 script_debug(): command - ocd_transport ocd_transport init
Debug: 253 37 transport.c:239 handle_transport_init(): handle_transport_init
Debug: 254 37 bitbang.c:383 bitbang_swd_switch_seq(): bitbang_swd_switch_seq
Debug: 255 37 bitbang.c:391 bitbang_swd_switch_seq(): JTAG-to-SWD
Debug: 256 37 bitbang.c:360 bitbang_exchange(): bitbang_exchange
Debug: 257 38 bitbang.c:420 bitbang_swd_read_reg(): bitbang_swd_read_reg
Debug: 258 38 bitbang.c:360 bitbang_exchange(): bitbang_exchange
Debug: 259 38 bitbang.c:360 bitbang_exchange(): bitbang_exchange
Debug: 260 39 bitbang.c:447 bitbang_swd_read_reg(): JUNK DP read reg 0 = ffffffff
Debug: 261 39 bitbang.c:470 bitbang_swd_read_reg(): No valid acknowledge: ack=7
Debug: 262 39 bitbang.c:479 bitbang_swd_write_reg(): bitbang_swd_write_reg
Debug: 263 39 bitbang.c:483 bitbang_swd_write_reg(): Skip bitbang_swd_write_reg because queued_retval=7
Debug: 264 39 bitbang.c:531 bitbang_swd_run_queue(): bitbang_swd_run_queue
Debug: 265 39 bitbang.c:360 bitbang_exchange(): bitbang_exchange
Debug: 266 39 bitbang.c:538 bitbang_swd_run_queue(): SWD queue return value: 07
Debug: 267 39 command.c:626 run_command(): Command failed with error code 7
User : 268 40 command.c:687 command_run_line(): in procedure 'init' called at file "openocd.cfg", line 14
in procedure 'ocd_bouncer'
Debug: 269 40 command.c:626 run_command(): Command failed with error code -4
User : 270 40 command.c:687 command_run_line(): 
Debug: 271 40 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 272 40 command.c:143 script_debug(): command - init ocd_init

My configuration file openocd.cfg content:
Code: Select all
source [find interface/raspberrypi2-native.cfg]
transport select swd
 
set CHIPNAME ATSAM4E8C
source [find target/at91sam4XXX.cfg]
 
# did not yet manage to make a working setup using srst
#reset_config srst_only
reset_config  srst_nogate
 
adapter_nsrst_delay 100
adapter_nsrst_assert_width 100
 
init
targets
reset halt
I've also tried with
Code: Select all
set CHIPNAME AT91SAM4E8C
Did anyone experience similar issue with SAM4E8C and have some solution?
I've already checked signals with an oscilloscope and all seems to be correct. I suppose this is some issue with openocd configuration for SAM4E8C. Could you please share your configuration?
By tatery
#191784
Finally I've managed it to work. There were a problems with reset configuration, SWD/JTAG frequency and voltage level converter (RPi works on 3V3, target MCU with 1V8).

My working configuration:

rpi_swd.cfg
Code: Select all
interface bcm2835gpio
bcm2835gpio_peripheral_base 0x3F000000
bcm2835gpio_speed_coeffs 146203 36
bcm2835gpio_swd_nums 25 24
bcm2835gpio_srst_num 18
reset_config srst_only srst_push_pull
openocd.cfg
Code: Select all
source [find rpi_swd.cfg]
transport select swd

set CHIPNAME AT91SAM4E8C
source [find target/at91sam4XXX.cfg]
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME at91sam4 0x00400000 0 1 1 $_TARGETNAME info
adapter_khz 250
reset_config srst_only
adapter_nsrst_delay 100
adapter_nsrst_assert_width 100

init
targets
reset halt
program test.hex verify reset
RPi pinout for SWD:
GPIO25 (PIN22) --> SWCLK
GPIO24 (PIN18) --> SWDIO
GPIO18 (PIN12) --> SRST

Voltage level converter: TXB0104

Nice tutorial on how to configure RPi to be a JTAG or SWD: https://movr0.com/2016/09/02/use-raspbe ... d-adapter/
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]