---

** [tickets:#377] efm32.cfg: fail to program bc "Cortex-M PARTNO 0x3 is 
unrecognized"**

**Status:** new
**Milestone:** 0.10.0
**Created:** Tue Dec 27, 2022 09:32 AM UTC by Ana Kisch
**Last Updated:** Tue Dec 27, 2022 09:32 AM UTC
**Owner:** nobody
**Attachments:**

- [seq1.png](https://sourceforge.net/p/openocd/tickets/377/attachment/seq1.png) 
(41.2 kB; image/png)
- [seq2.png](https://sourceforge.net/p/openocd/tickets/377/attachment/seq2.png) 
(54.9 kB; image/png)
- [seq3.png](https://sourceforge.net/p/openocd/tickets/377/attachment/seq3.png) 
(55.4 kB; image/png)
- [seq4.png](https://sourceforge.net/p/openocd/tickets/377/attachment/seq4.png) 
(57.3 kB; image/png)


Hi,

I'm trying to program an EFM32G200F64 - target with OpenOCD and STLINK-V2.
The complete setup is:
- Target: EFM32G200F64
- Interface: SWD 
- OS: Linux kali 6.0.0-kali6-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.12-1kali1 
(2022-12-19) x86_64 GNU/Linux
- OpenOcd: 0.12.0-rc3+dev-01000-gdfe57baa1 (2022-12-27-08:53)
- 
After unlocking the device the programmer runs into following  issue while 
connecting to target:

~~~
Open On-Chip Debugger 0.12.0-rc3+dev-01000-gdfe57baa1 (2022-12-27-08:53)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "dapdirect_swd". To 
override use 'transport select <transport>'.
cortex_m reset_config sysresetreq

Info : STLINK V2J37S0 (API v2) VID:PID 0483:3748
Info : Target voltage: 2.898996
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x2ba01477
Error: [efm32.cpu] Cortex-M PARTNO 0x3 is unrecognized

~~~

Debug-output: 
~~~
Debug: 116 744 arm_dap.c:97 dap_init_all(): Initializing all DAPs ...
Debug: 117 744 arm_dap.c:121 dap_init_all(): DAP efm32.cpu configured by 
default to use ADIv5 protocol
Info : 118 744 stlink_usb.c:4158 stlink_dap_op_connect(): 
stlink_dap_op_connect(connect)
Debug: 119 744 arm_adi_v5.c:679 dap_dp_init(): efm32.dap
Debug: 120 744 arm_adi_v5.c:711 dap_dp_init(): DAP: wait CDBGPWRUPACK
Debug: 121 744 arm_adi_v5.h:638 dap_dp_poll_register(): DAP: poll 4, mask 
0x20000000, value 0x20000000
Debug: 122 748 arm_adi_v5.c:719 dap_dp_init(): DAP: wait CSYSPWRUPACK
Debug: 123 748 arm_adi_v5.h:638 dap_dp_poll_register(): DAP: poll 4, mask 
0x80000000, value 0x80000000
Debug: 124 753 stlink_usb.c:2020 stlink_usb_idcode(): IDCODE: 0x2BA01477
Info : 125 753 stlink_usb.c:4185 stlink_dap_op_connect(): SWD DPIDR 0x2ba01477
Debug: 126 753 openocd.c:151 handle_init_command(): Examining targets...
Debug: 127 753 target.c:1843 target_call_event_callbacks(): target event 19 
(examine-start) for core efm32.cpu
Debug: 128 753 arm_adi_v5.c:1095 dap_get_ap(): refcount AP#0x0 get 1
Debug: 129 754 arm_adi_v5.c:1038 dap_find_get_ap(): Found MEM-AP AHB3 at AP 
index: 0 (IDR=0x24770011)
Debug: 130 758 arm_adi_v5.c:825 mem_ap_init(): MEM_AP Packed Transfers: disabled
Debug: 131 758 arm_adi_v5.c:836 mem_ap_init(): MEM_AP CFG: large data 0, long 
address 0, big-endian 0
Debug: 132 760 target.c:2628 target_read_u32(): address: 0xe000ed00, value: 
0x02010030
Error: 133 760 cortex_m.c:2363 cortex_m_examine(): [efm32.cpu] Cortex-M PARTNO 
0x3 is unrecognized
Debug: 134 760 target.c:1843 target_call_event_callbacks(): target event 20 
(examine-fail) for core efm32.cpu
Warn : 135 760 target.c:802 target_examine(): target efm32.cpu examination 
failed
Debug: 136 760 openocd.c:153 handle_init_command(): target examination failed
Debug: 137 760 command.c:155 script_debug(): command - flash init
Debug: 138 760 tcl.c:1375 handle_flash_init_command(): Initializing flash 
devices...
Debug: 139 760 command.c:155 script_debug(): command - nand init
Debug: 140 760 tcl.c:487 handle_nand_init_command(): Initializing NAND 
devices...
Debug: 141 760 command.c:155 script_debug(): command - pld init
Debug: 142 760 pld.c:194 handle_pld_init_command(): Initializing PLDs...
Debug: 143 760 command.c:155 script_debug(): command - tpiu init
Info : 144 760 gdb_server.c:3791 gdb_target_start(): starting gdb server for 
efm32.cpu on 3333
Info : 145 760 server.c:297 add_service(): Listening on port 3333 for gdb 
connections
Debug: 146 760 command.c:155 script_debug(): command - reset init
Debug: 147 760 target.c:1862 target_call_reset_callbacks(): target reset 3 
(init)
Debug: 148 761 command.c:155 script_debug(): command - expr [catch 
{ocd_process_reset_inner $MODE} result] == 0
Debug: 149 761 command.c:155 script_debug(): command - target names
Debug: 150 761 command.c:155 script_debug(): command - efm32.cpu invoke-event 
reset-start
Debug: 151 761 command.c:155 script_debug(): command - transport select
Debug: 152 761 command.c:155 script_debug(): command - expr  [ string first 
"jtag" $_TRANSPORT ] != -1 
Debug: 153 761 command.c:155 script_debug(): command - transport select
Debug: 154 761 command.c:155 script_debug(): command - expr  [ string first 
"jtag" $_TRANSPORT ] != -1 
Debug: 155 761 command.c:155 script_debug(): command - efm32.cpu invoke-event 
examine-start
Debug: 156 761 command.c:155 script_debug(): command - efm32.cpu arp_examine 
allow-defer
Debug: 157 765 arm_adi_v5.c:825 mem_ap_init(): MEM_AP Packed Transfers: disabled
Debug: 158 765 arm_adi_v5.c:836 mem_ap_init(): MEM_AP CFG: large data 0, long 
address 0, big-endian 0
Debug: 159 767 target.c:2628 target_read_u32(): address: 0xe000ed00, value: 
0x02010030
Error: 160 767 cortex_m.c:2363 cortex_m_examine(): [efm32.cpu] Cortex-M PARTNO 
0x3 is unrecognized
Debug: 161 767 command.c:155 script_debug(): command - efm32.cpu invoke-event 
examine-fail
Debug: 162 767 command.c:155 script_debug(): command - efm32.cpu invoke-event 
reset-assert-pre
Debug: 163 767 command.c:155 script_debug(): command - transport select
Debug: 164 767 command.c:155 script_debug(): command - expr  [ string first 
"jtag" $_TRANSPORT ] != -1 
Debug: 165 767 command.c:155 script_debug(): command - efm32.cpu arp_reset 
assert 1
Debug: 166 767 target.c:2199 target_free_all_working_areas_restore(): freeing 
all working areas
Debug: 167 767 cortex_m.c:1401 cortex_m_assert_reset(): [efm32.cpu] 
target->state: unknown, not examined
Debug: 168 773 cortex_m.c:1516 cortex_m_assert_reset(): [efm32.cpu] Using 
Cortex-M SYSRESETREQ
Debug: 169 774 arm_adi_v5.c:754 dap_dp_init_or_reconnect(): efm32.dap
Debug: 170 774 arm_adi_v5.c:679 dap_dp_init(): efm32.dap
Debug: 171 774 arm_adi_v5.c:711 dap_dp_init(): DAP: wait CDBGPWRUPACK
Debug: 172 774 arm_adi_v5.h:638 dap_dp_poll_register(): DAP: poll 4, mask 
0x20000000, value 0x20000000
Debug: 173 775 arm_adi_v5.c:719 dap_dp_init(): DAP: wait CSYSPWRUPACK
Debug: 174 775 arm_adi_v5.h:638 dap_dp_poll_register(): DAP: poll 4, mask 
0x80000000, value 0x80000000
Debug: 175 827 command.c:155 script_debug(): command - efm32.cpu invoke-event 
reset-assert-post
Debug: 176 827 command.c:155 script_debug(): command - efm32.cpu invoke-event 
reset-deassert-pre
Debug: 177 827 command.c:155 script_debug(): command - transport select
Debug: 178 827 command.c:155 script_debug(): command - expr  [ string first 
"jtag" $_TRANSPORT ] != -1 
Debug: 179 827 command.c:155 script_debug(): command - efm32.cpu arp_reset 
deassert 1
Debug: 180 827 target.c:2199 target_free_all_working_areas_restore(): freeing 
all working areas
Debug: 181 827 cortex_m.c:1569 cortex_m_deassert_reset(): [efm32.cpu] 
target->state: reset, not examined
Debug: 182 827 command.c:155 script_debug(): command - efm32.cpu invoke-event 
reset-deassert-post
Debug: 183 827 command.c:155 script_debug(): command - transport select
Debug: 184 827 command.c:155 script_debug(): command - expr  [ string first 
"jtag" $_TRANSPORT ] != -1 
Debug: 185 827 command.c:155 script_debug(): command - efm32.cpu was_examined
Debug: 186 827 command.c:155 script_debug(): command - efm32.cpu 
examine_deferred
Debug: 187 827 command.c:155 script_debug(): command - efm32.cpu invoke-event 
examine-start
Debug: 188 827 command.c:155 script_debug(): command - efm32.cpu arp_examine 
allow-defer
Debug: 189 829 arm_adi_v5.c:825 mem_ap_init(): MEM_AP Packed Transfers: disabled
Debug: 190 829 arm_adi_v5.c:836 mem_ap_init(): MEM_AP CFG: large data 0, long 
address 0, big-endian 0
Debug: 191 830 target.c:2628 target_read_u32(): address: 0xe000ed00, value: 
0x05fa0030
Error: 192 830 cortex_m.c:2363 cortex_m_examine(): [efm32.cpu] Cortex-M PARTNO 
0x3 is unrecognized
Debug: 193 830 command.c:155 script_debug(): command - efm32.cpu invoke-event 
examine-fail
Debug: 194 830 command.c:544 run_command(): Command 'reset' failed with error 
code -4
~~~

Running the LA I was able to recognize 4 sequences related to reading of the 
CPUID-value on address 0xe000ed00, see screenshots in the attachment. 

In the  first sequence at the beginning of the capture right after running 
OpenOCD target responded with "WData 0x412FC230 reg RDBUFF", which is the 
pretty correct value for Cortex-M3 r2p0 according to the RM.

In  second and third sequences target responded with "WData 0x02010030 reg 
RDBUFF", which might be the problem reported by the OpenOCD, bc "0x003" isn't a 
valid value for PARTNO.

In the last sequence target responded with "WData 0x05FA0030 reg RDBUFF", but 
I'm not sure if this request really refers to the actual problem.

However, I'm actually not really deep in the OpenOCD and trying to understand 
what is wrong with my setup and why is the target responding with at least 2 
different values after reading a RO register value.

Thank you for your help in advance.



---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to