sandeepmistry / arduino-nRF5

Arduino Core for Nordic Semiconductor nRF5 based boards
Other
872 stars 278 forks source link

Target-Download to Calliope mini Rev2 via OpenOCD does not work #474

Open supavisor opened 2 years ago

supavisor commented 2 years ago

Hello,

any hint is appreciated, I'm kind of desperate!

I'm using latest Arduino IDE 1.8.19 under up-to-date Win10 64-Bit and set up everything exactly as described in Readme. This is a fresh installation and I did everything straight forward. I'm also using latest Bootloader-Firmware for Calliope (https://calliope.cc/start/tipps -> Section "Bootloader"). Calliope itself also works with the internally stored demo programs. I don't use SoftDevice. USB ACM device (COM3) and USB Bulk device (WinUSB driver version 6.1.x) are visible in device manager. Sketch builds without errors, during deployment to target, the following errors occurs. I already did a lot of try&error, also tried the bootloader from segger, etc. but nothing worked. As programmer "J-Link" is set. A basic question is whats the difference of "Upload" and "Upload by programmer"? I guess the latter is the correct one or should both work prinipally ?

Upload: "C:\Users\Admin\AppData\Local\Arduino15\packages\sandeepmistry\tools\gcc-arm-none-eabi\5_2-2015q4/bin/arm-none-eabi-size" -A "C:\Users\Admin\AppData\Local\Temp\arduino_build_285784/Microbit_Probesketch.ino.elf" Sketch uses 11424 bytes (4%) of program storage space. Maximum is 262144 bytes. C:\Users\Admin\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/cmsis-dap.cfg -c transport select swd; -f target/nrf51.cfg -c program {{C:\Users\Admin\AppData\Local\Temp\arduino_build_285784/Microbit_Probesketch.ino.hex}} verify reset; shutdown; Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 2 Info : only one transport option; autoselect 'swd' Warn : Transport "swd" was already selected swd cortex_m reset_config sysresetreq adapter speed: 1000 kHz Error: unable to find CMSIS-DAP device Error: No Valid JTAG Interface Configured. Error: No Valid JTAG Interface Configured.

Upload by Programmer: Sketch uses 11424 bytes (4%) of program storage space. Maximum is 262144 bytes. C:\Users\Admin\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/jlink.cfg -c transport select swd; set WORKAREASIZE 0; -f target/nrf51.cfg -c program {{C:\Users\Admin\AppData\Local\Temp\arduino_build_285784/Microbit_Probesketch.ino.hex}} verify reset; shutdown; Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 2 0 cortex_m reset_config sysresetreq adapter speed: 1000 kHz Info : No device selected, using first device. Error: No J-Link device found. Error: No Valid JTAG Interface Configured. Error: No Valid JTAG Interface Configured.

Thanks, Rob

supavisor commented 2 years ago

Basically, the J-Link interface can be connected and controlled, but it fails anyway.

The crucial point was to use the Bootloader Firmware from Segger and not the latest Firmware from Calliope:

https://www.segger.com/downloads/jlink#CALLIOPE_mini

The USB devices look like the following:

grafik

grafik

Nevertheless, the flashing fails:

Sketch uses 11640 bytes (2%) of program storage space. Maximum is 524288 bytes. C:\Users\Admin\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/jlink.cfg -c transport select swd; set WORKAREASIZE 0; -f target/nrf52.cfg -c program {{C:\Users\Admin\AppData\Local\Temp\arduino_build_558395/Microbit_Probesketch.ino.hex}} verify reset; shutdown; Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 2 0 adapter speed: 10000 kHz cortex_m reset_config sysresetreq jaylink: Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED. Info : No device selected, using first device. Info : J-Link OB-Calliope-mini compiled Oct 5 2018 10:34:25 Info : Hardware version: 1.00 Info : VTarget = 3.300 V Info : Reduced speed from 10000 kHz to 2000 kHz (maximum). Info : Reduced speed from 10000 kHz to 2000 kHz (maximum). Info : clock speed 10000 kHz Info : SWD IDCODE 0x0bb11477 Info : nrf52.cpu: hardware has 4 breakpoints, 2 watchpoints nrf52.cpu: target state: halted target halted due to debug-request, current mode: Thread xPSR: 0xc1000000 pc: 0x00000d50 msp: 0x20004000 Programming Started auto erase enabled Warn : Unknown device (HWID 0x000000d6) Warn : not enough working area available(requested 32) Warn : no working area available, falling back to slow memory writes wrote 12288 bytes from file C:\Users\Admin\AppData\Local\Temp\arduino_build_558395/Microbit_Probesketch.ino.hex in 25.629608s (0.468 KiB/s) Programming Finished Verify Started Warn : not enough working area available(requested 52) jaylink: SWD I/O operation failed: 06. Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV. jaylink: Failed to send data to device: LIBUSB_ERROR_TIMEOUT. jaylink: Failed to send data to device: LIBUSB_ERROR_TIMEOUT. jaylink: Sending data to device timed out. jaylink: transport_write() failed: -4. Error: jaylink_swd_io() failed: JAYLINK_ERR_TIMEOUT. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_PIPE. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. Error: checksum mismatch - attempting binary compare jaylink: Last read operation left 1155 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1730 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. jaylink: Last read operation left 1729 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_swd_io() failed: JAYLINK_ERR. diff 0 address 0x00000002. Was 0x00 instead of 0x02 diff 1 address 0x00000003. Was 0x00 instead of 0x20 diff 2 address 0x00000004. Was 0x00 instead of 0xf5 diff 3 address 0x00000005. Was 0x00 instead of 0x0e diff 4 address 0x00000008. Was 0x00 instead of 0x1d diff 5 address 0x00000009. Was 0x00 instead of 0x0f diff 6 address 0x0000000c. Was 0x00 instead of 0x1f diff 7 address 0x0000000d. Was 0x00 instead of 0x0f diff 8 address 0x00000010. Was 0x00 instead of 0x21 diff 9 address 0x00000011. Was 0x00 instead of 0x0f diff 10 address 0x00000014. Was 0x00 instead of 0x23 diff 11 address 0x00000015. Was 0x00 instead of 0x0f diff 12 address 0x00000018. Was 0x00 instead of 0x25 diff 13 address 0x00000019. Was 0x00 instead of 0x0f diff 14 address 0x0000002c. Was 0x00 instead of 0x27 diff 15 address 0x0000002d. Was 0x00 instead of 0x0f diff 16 address 0x00000030. Was 0x00 instead of 0x29 diff 17 address 0x00000031. Was 0x00 instead of 0x0f diff 18 address 0x00000038. Was 0x00 instead of 0x2b diff 19 address 0x00000039. Was 0x00 instead of 0x0f diff 20 address 0x0000003c. Was 0x00 instead of 0x2d diff 21 address 0x0000003d. Was 0x00 instead of 0x0f diff 22 address 0x00000040. Was 0x00 instead of 0x2f diff 23 address 0x00000041. Was 0x00 instead of 0x0f diff 24 address 0x00000044. Was 0x00 instead of 0x2f diff 25 address 0x00000045. Was 0x00 instead of 0x0f diff 26 address 0x00000048. Was 0x00 instead of 0x51 diff 27 address 0x00000049. Was 0x00 instead of 0x14 diff 28 address 0x0000004c. Was 0x00 instead of 0x2d diff 29 address 0x0000004d. Was 0x00 instead of 0x0e diff 30 address 0x00000050. Was 0x00 instead of 0x21 diff 31 address 0x00000051. Was 0x00 instead of 0x0e diff 32 address 0x00000054. Was 0x00 instead of 0x2f diff 33 address 0x00000055. Was 0x00 instead of 0x0f diff 34 address 0x00000058. Was 0x00 instead of 0x2f diff 35 address 0x00000059. Was 0x00 instead of 0x0f diff 36 address 0x0000005c. Was 0x00 instead of 0x2f diff 37 address 0x0000005d. Was 0x00 instead of 0x0f diff 38 address 0x00000060. Was 0x00 instead of 0x2f diff 39 address 0x00000061. Was 0x00 instead of 0x0f diff 40 address 0x00000064. Was 0x00 instead of 0x2f diff 41 address 0x00000065. Was 0x00 instead of 0x0f diff 42 address 0x00000068. Was 0x00 instead of 0xc5 diff 43 address 0x00000069. Was 0x00 instead of 0x05 diff 44 address 0x0000006c. Was 0x00 instead of 0x2f diff 45 address 0x0000006d. Was 0x00 instead of 0x0f diff 46 address 0x00000070. Was 0x00 instead of 0x2f diff 47 address 0x00000071. Was 0x00 instead of 0x0f diff 48 address 0x00000074. Was 0x00 instead of 0x2f diff 49 address 0x00000075. Was 0x00 instead of 0x0f diff 50 address 0x00000078. Was 0x00 instead of 0x2f diff 51 address 0x00000079. Was 0x00 instead of 0x0f diff 52 address 0x0000007c. Was 0x00 instead of 0x2f diff 53 address 0x0000007d. Was 0x00 instead of 0x0f diff 54 address 0x00000080. Was 0x00 instead of 0x2f diff 55 address 0x00000081. Was 0x00 instead of 0x0f diff 56 address 0x00000084. Was 0x00 instead of 0x7d diff 57 address 0x00000085. Was 0x00 instead of 0x10 diff 58 address 0x00000088. Was 0x00 instead of 0x2f diff 59 address 0x00000089. Was 0x00 instead of 0x0f diff 60 address 0x0000008c. Was 0x00 instead of 0x2f diff 61 address 0x0000008d. Was 0x00 instead of 0x0f diff 62 address 0x00000090. Was 0x00 instead of 0x2f diff 63 address 0x00000091. Was 0x00 instead of 0x0f diff 64 address 0x00000094. Was 0x00 instead of 0x2f diff 65 address 0x00000095. Was 0x00 instead of 0x0f diff 66 address 0x00000098. Was 0x00 instead of 0x2f diff 67 address 0x00000099. Was 0x00 instead of 0x0f diff 68 address 0x0000009c. Was 0xc9 instead of 0x2f diff 69 address 0x0000009d. Was 0x30 instead of 0x0f diff 70 address 0x000000a0. Was 0x00 instead of 0x2f diff 71 address 0x000000a1. Was 0x00 instead of 0x0f diff 72 address 0x000000a4. Was 0x00 instead of 0x2f diff 73 address 0x000000a5. Was 0x00 instead of 0x0f diff 74 address 0x000000a8. Was 0x00 instead of 0x2f diff 75 address 0x000000a9. Was 0x00 instead of 0x0f diff 76 address 0x000000ac. Was 0xb9 instead of 0x2f diff 77 address 0x000000ad. Was 0x30 instead of 0x0f diff 78 address 0x000000b0. Was 0x00 instead of 0x2f diff 79 address 0x000000b1. Was 0x00 instead of 0x0f diff 80 address 0x000000b4. Was 0x00 instead of 0x2f diff 81 address 0x000000b5. Was 0x00 instead of 0x0f diff 82 address 0x000000c0. Was 0x00 instead of 0x2f diff 83 address 0x000000c1. Was 0x00 instead of 0x0f diff 84 address 0x000000c4. Was 0x00 instead of 0x2f diff 85 address 0x000000c5. Was 0x00 instead of 0x0f diff 86 address 0x000000c8. Was 0x00 instead of 0x2f diff 87 address 0x000000c9. Was 0x00 instead of 0x0f diff 88 address 0x000000cc. Was 0x00 instead of 0x2f diff 89 address 0x000000cd. Was 0x00 instead of 0x0f diff 90 address 0x000000d0. Was 0x00 instead of 0x2f diff 91 address 0x000000d1. Was 0x00 instead of 0x0f diff 92 address 0x000000d4. Was 0x00 instead of 0x2f diff 93 address 0x000000d5. Was 0x00 instead of 0x0f diff 94 address 0x000000d8. Was 0x00 instead of 0x2f diff 95 address 0x000000d9. Was 0x00 instead of 0x0f diff 96 address 0x000000dc. Was 0x00 instead of 0x2f diff 97 address 0x000000dd. Was 0x00 instead of 0x0f diff 98 address 0x000000e0. Was 0x00 instead of 0x2f diff 99 address 0x000000e1. Was 0x00 instead of 0x0f diff 100 address 0x000000f4. Was 0x00 instead of 0x2f diff 101 address 0x000000f5. Was 0x00 instead of 0x0f diff 102 address 0x000000fc. Was 0x00 instead of 0x2f diff 103 address 0x000000fd. Was 0x00 instead of 0x0f diff 104 address 0x00000200. Was 0x00 instead of 0x04 diff 105 address 0x00000201. Was 0x00 instead of 0x4b diff 106 address 0x00000202. Was 0x00 instead of 0x05 diff 107 address 0x00000203. Was 0x00 instead of 0x48 diff 108 address 0x00000204. Was 0x00 instead of 0x1b diff 109 address 0x00000205. Was 0x00 instead of 0x1a diff 110 address 0x00000206. Was 0x00 instead of 0x06 diff 111 address 0x00000207. Was 0x00 instead of 0x2b diff 112 address 0x00000208. Was 0x00 instead of 0x02 diff 113 address 0x00000209. Was 0x00 instead of 0xd9 diff 114 address 0x0000020a. Was 0x00 instead of 0x04 diff 115 address 0x0000020b. Was 0x00 instead of 0x4b diff 116 address 0x0000020c. Was 0x00 instead of 0x03 diff 117 address 0x0000020d. Was 0x00 instead of 0xb1 diff 118 address 0x0000020e. Was 0x00 instead of 0x18 diff 119 address 0x0000020f. Was 0x00 instead of 0x47 diff 120 address 0x00000210. Was 0x00 instead of 0x70 diff 121 address 0x00000211. Was 0x00 instead of 0x47 diff 122 address 0x00000213. Was 0x00 instead of 0xbf diff 123 address 0x00000214. Was 0x00 instead of 0xc7 diff 124 address 0x00000217. Was 0x00 instead of 0x20 diff 125 address 0x00000218. Was 0x00 instead of 0xc4 diff 126 address 0x0000021b. Was 0x00 instead of 0x20 diff 127 address 0x00000220. Was 0x00 instead of 0x05 More than 128 errors, the rest are not printed. embedded:startup.tcl:454: Error: Verify Failed in procedure 'program' in procedure 'program_error' called at file "embedded:startup.tcl", line 498 at file "embedded:startup.tcl", line 454 jaylink: Last read operation left 1141 bytes. jaylink: Failed to send data to device: LIBUSB_ERROR_IO. jaylink: transport_write() failed: -1. Error: jaylink_unregister() failed: JAYLINK_ERR. Error: jaylink_unregister() failed: JAYLINK_ERR.