Programming an EFM32 Zero Gecko MCU with OpenOCD

Open source ARM Debugger

Moderator: phalanx

Programming an EFM32 Zero Gecko MCU with OpenOCD

Postby pvh1987 » Mon Mar 06, 2017 8:37 am

I would like to program an EFM32 Zero Gecko MCU on the STK3200 development kit from Silicon Labs. In the manual, I found that there are some config files available that I can use as a starting point for my project. I found "/usr/share/openocd/scripts/board/efm32.cfg" and made a copy of it in my working directory with the name "openocd.cfg". The contents of this file is

Code: Select all
# Configuration for EFM32 boards with on-board SEGGER J-Link
#
# Tested with Tiny, Giant and Zero Gecko Starter Kit.
#

source [find interface/jlink.cfg]
transport select swd
adapter_khz 1000

set CHIPNAME efm32
source [find target/efm32.cfg]


It is stated that the config file have been tested with the Zero Gecko Start Kit, which I am using - so that should be fine. I have a HEX-file generated by Simplicity Studio (Eclipse based IDE from Silicon Labs), so after reading in the manual, I decided to run this command:

Code: Select all
openocd -f openocd.cfg -c "program blink3.hex verify reset exit"


It looks like it found both the board and the target, which tells me that something is working. But I get a lot of "JAYLINK_ERR_DEV_NO_MEMORY" errors and the programming procedure fails (see the output below). I can still program the device from within Simplicity Studio so I know that board still works.

Any help is apppreciated :-)

By the way - in the end, I need to invoke the program/verify functionality inside a C/C++ program. Is that possible or do I need to run OpenOCD as a separate process and parse the output afterwards?

Code: Select all
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
adapter speed: 1000 kHz
cortex_m reset_config sysresetreq
Info : No device selected, using first device.
Info : Energy Micro EFM32 compiled Apr 20 2016 12:17:23
Info : Hardware version: 1.00
Info : VTarget = 3.339 V
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x0bc11477
Info : efm32.cpu: hardware has 4 breakpoints, 2 watchpoints
target halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
auto erase enabled
Info : detected part: EFM32 Zero Gecko - Rev: 22
Info : flash size = 32kbytes
Info : flash page size = 1024bytes
Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV_NO_MEMORY.
wrote 7168 bytes from file blink3.hex in 0.649983s (10.770 KiB/s)
** Programming Finished **
** Verify Started **
Error: checksum mismatch - attempting binary compare
Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV_NO_MEMORY.
Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV_NO_MEMORY.
Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV_NO_MEMORY.
Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV_NO_MEMORY.
Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV_NO_MEMORY.
Error: jaylink_swd_io() failed: JAYLINK_ERR_DEV_NO_MEMORY.
diff 0 address 0x00000000. Was 0x88 instead of 0x00
diff 1 address 0x00000001. Was 0x43 instead of 0x10
diff 2 address 0x00000002. Was 0x79 instead of 0x00
diff 3 address 0x00000003. Was 0xa6 instead of 0x20
diff 4 address 0x00000004. Was 0x72 instead of 0x9d
diff 5 address 0x00000005. Was 0x7f instead of 0x03
diff 6 address 0x00000008. Was 0x88 instead of 0xc9
diff 7 address 0x00000009. Was 0x43 instead of 0x03
diff 8 address 0x0000000a. Was 0x79 instead of 0x00
diff 9 address 0x0000000b. Was 0xa6 instead of 0x00
diff 10 address 0x0000000c. Was 0x72 instead of 0xc9
diff 11 address 0x0000000d. Was 0x7f instead of 0x03
diff 12 address 0x00000010. Was 0x20 instead of 0xc9
diff 13 address 0x00000011. Was 0x59 instead of 0x03
diff 14 address 0x00000012. Was 0xb4 instead of 0x00
diff 15 address 0x00000014. Was 0x00 instead of 0xc9
diff 16 address 0x00000015. Was 0x00 instead of 0x03
diff 17 address 0x00000018. Was 0x20 instead of 0xc9
diff 18 address 0x00000019. Was 0x59 instead of 0x03
diff 19 address 0x0000001a. Was 0xb4 instead of 0x00
diff 20 address 0x0000001c. Was 0x00 instead of 0xc9
diff 21 address 0x0000001d. Was 0x00 instead of 0x03
diff 22 address 0x00000020. Was 0x31 instead of 0xc9
diff 23 address 0x00000021. Was 0x61 instead of 0x03
diff 24 address 0x00000022. Was 0x2e instead of 0x00
diff 25 address 0x00000023. Was 0x31 instead of 0x00
diff 26 address 0x00000024. Was 0x2f instead of 0xc9
diff 27 address 0x00000025. Was 0x75 instead of 0x03
diff 28 address 0x00000026. Was 0x73 instead of 0x00
diff 29 address 0x00000027. Was 0x62 instead of 0x00
diff 30 address 0x00000028. Was 0x34 instead of 0xc9
diff 31 address 0x00000029. Was 0x2f instead of 0x03
diff 32 address 0x0000002a. Was 0x34 instead of 0x00
diff 33 address 0x0000002b. Was 0x2d instead of 0x00
diff 34 address 0x0000002c. Was 0x31 instead of 0xc9
diff 35 address 0x0000002d. Was 0x2f instead of 0x03
diff 36 address 0x0000002e. Was 0x34 instead of 0x00
diff 37 address 0x0000002f. Was 0x2d instead of 0x00
diff 38 address 0x00000030. Was 0x40 instead of 0xc9
diff 39 address 0x00000031. Was 0x00 instead of 0x03
diff 40 address 0x00000034. Was 0x00 instead of 0xc9
diff 41 address 0x00000035. Was 0x00 instead of 0x03
diff 42 address 0x00000038. Was 0x40 instead of 0xc9
diff 43 address 0x00000039. Was 0x00 instead of 0x03
diff 44 address 0x0000003c. Was 0x00 instead of 0x0d
diff 45 address 0x0000003d. Was 0x00 instead of 0x10
diff 46 address 0x00000040. Was 0x40 instead of 0xc9
diff 47 address 0x00000041. Was 0x3d instead of 0x03
diff 48 address 0x00000042. Was 0xb4 instead of 0x00
diff 49 address 0x00000044. Was 0x00 instead of 0xc9
diff 50 address 0x00000045. Was 0x00 instead of 0x03
diff 51 address 0x00000048. Was 0x00 instead of 0xc9
diff 52 address 0x00000049. Was 0x00 instead of 0x03
diff 53 address 0x0000004c. Was 0x00 instead of 0xc9
diff 54 address 0x0000004d. Was 0x00 instead of 0x03
diff 55 address 0x00000050. Was 0x80 instead of 0xc9
diff 56 address 0x00000051. Was 0x7c instead of 0x03
diff 57 address 0x00000052. Was 0xb0 instead of 0x00
diff 58 address 0x00000054. Was 0x00 instead of 0xc9
diff 59 address 0x00000055. Was 0x00 instead of 0x03
diff 60 address 0x00000058. Was 0x50 instead of 0xc9
diff 61 address 0x00000059. Was 0x3d instead of 0x03
diff 62 address 0x0000005a. Was 0xb4 instead of 0x00
diff 63 address 0x0000005c. Was 0x00 instead of 0xc9
diff 64 address 0x0000005d. Was 0x00 instead of 0x03
diff 65 address 0x00000060. Was 0x00 instead of 0xc9
diff 66 address 0x00000061. Was 0x00 instead of 0x03
diff 67 address 0x00000064. Was 0x00 instead of 0xc9
diff 68 address 0x00000065. Was 0x00 instead of 0x03
diff 69 address 0x00000068. Was 0x00 instead of 0xc9
diff 70 address 0x00000069. Was 0x00 instead of 0x03
diff 71 address 0x0000006c. Was 0x00 instead of 0xc9
diff 72 address 0x0000006d. Was 0x00 instead of 0x03
diff 73 address 0x00000070. Was 0x00 instead of 0xc9
diff 74 address 0x00000071. Was 0x00 instead of 0x03
diff 75 address 0x00000074. Was 0x00 instead of 0xc9
diff 76 address 0x00000075. Was 0x00 instead of 0x03
diff 77 address 0x00000078. Was 0xc1 instead of 0xc9
diff 78 address 0x00000079. Was 0x6e instead of 0x03
diff 79 address 0x0000007c. Was 0x00 instead of 0xc9
diff 80 address 0x0000007d. Was 0x00 instead of 0x03
diff 81 address 0x00000080. Was 0x70 instead of 0xc9
diff 82 address 0x00000081. Was 0x84 instead of 0x03
diff 83 address 0x00000082. Was 0xb1 instead of 0x00
diff 84 address 0x00000084. Was 0x00 instead of 0xc9
diff 85 address 0x00000085. Was 0x00 instead of 0x03
diff 86 address 0x00000088. Was 0xf0 instead of 0xc9
diff 87 address 0x00000089. Was 0x1b instead of 0x03
diff 88 address 0x0000008a. Was 0xb6 instead of 0x00
diff 89 address 0x0000008c. Was 0x00 instead of 0x10
diff 90 address 0x0000008d. Was 0x00 instead of 0xb5
diff 91 address 0x0000008e. Was 0x00 instead of 0x06
diff 92 address 0x0000008f. Was 0x00 instead of 0x4c
diff 93 address 0x00000090. Was 0x00 instead of 0x23
diff 94 address 0x00000091. Was 0x00 instead of 0x78
diff 95 address 0x00000093. Was 0x00 instead of 0x2b
diff 96 address 0x00000094. Was 0x00 instead of 0x07
diff 97 address 0x00000095. Was 0x00 instead of 0xd1
diff 98 address 0x00000096. Was 0x00 instead of 0x05
diff 99 address 0x00000097. Was 0x00 instead of 0x4b
diff 100 address 0x00000099. Was 0x00 instead of 0x2b
diff 101 address 0x0000009a. Was 0x00 instead of 0x02
diff 102 address 0x0000009b. Was 0x00 instead of 0xd0
diff 103 address 0x0000009c. Was 0x00 instead of 0x04
diff 104 address 0x0000009d. Was 0x00 instead of 0x48
diff 105 address 0x0000009f. Was 0x00 instead of 0xe0
diff 106 address 0x000000a1. Was 0x00 instead of 0xbf
diff 107 address 0x000000a2. Was 0x00 instead of 0x01
diff 108 address 0x000000a3. Was 0x00 instead of 0x23
diff 109 address 0x000000a4. Was 0x00 instead of 0x23
diff 110 address 0x000000a5. Was 0x00 instead of 0x70
diff 111 address 0x000000a6. Was 0x00 instead of 0x10
diff 112 address 0x000000a7. Was 0x00 instead of 0xbd
diff 113 address 0x000000a8. Was 0x00 instead of 0x74
diff 114 address 0x000000ab. Was 0x00 instead of 0x20
diff 115 address 0x000000b0. Was 0x19 instead of 0x04
diff 116 address 0x000000b1. Was 0x00 instead of 0x1a
diff 117 address 0x000000b4. Was 0x00 instead of 0x08
diff 118 address 0x000000b5. Was 0x00 instead of 0xb5
diff 119 address 0x000000b6. Was 0x00 instead of 0x08
diff 120 address 0x000000b7. Was 0x00 instead of 0x4b
diff 121 address 0x000000b9. Was 0x00 instead of 0x2b
diff 122 address 0x000000ba. Was 0x00 instead of 0x03
diff 123 address 0x000000bb. Was 0x00 instead of 0xd0
diff 124 address 0x000000bc. Was 0x00 instead of 0x07
diff 125 address 0x000000bd. Was 0x00 instead of 0x48
diff 126 address 0x000000be. Was 0x00 instead of 0x08
diff 127 address 0x000000bf. Was 0x00 instead of 0x49
More than 128 errors, the rest are not printed.
** Verify Failed **
shutdown command invoked

pvh1987
 
Posts: 2
Joined: Mon Mar 06, 2017 8:19 am

Re: Programming an EFM32 Zero Gecko MCU with OpenOCD

Postby pvh1987 » Thu Mar 09, 2017 1:58 pm

I have not solved this problem yet. Help is still very appreciated. Thanks in advance :-)
pvh1987
 
Posts: 2
Joined: Mon Mar 06, 2017 8:19 am


Return to OpenOCD

Who is online

Users browsing this forum: No registered users and 2 guests