Open galak opened 5 years ago
Was also seeing this when flashing:
[galak@localhost zephyr]$ pyocd flash zephyr.bin
Secure
[====================] 100%
Secure
0006128:CRITICAL:__main__:uncaught exception:
Traceback (most recent call last):
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/__main__.py", line 338, in run
self._COMMANDS[self._args.cmd](self)
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/__main__.py", line 475, in do_flash
file_format=self._args.format)
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/flash/loader.py", line 160, in program
self._loader.commit()
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/flash/loader.py", line 504, in commit
keep_unwritten=self._keep_unwritten)
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/flash/flash_builder.py", line 472, in program
self.flash.target.reset_and_halt()
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/core/coresight_target.py", line 333, in reset_and_halt
return self.selected_core.reset_and_halt(reset_type)
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/target/builtin/target_LPC55S69JBD100.py", line 295, in reset_and_halt
xpsr = self.read_core_register('xpsr')
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/coresight/cortex_m.py", line 987, in read_core_register
regValue = self.read_core_register_raw(regIndex)
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/coresight/cortex_m.py", line 1001, in read_core_register_raw
vals = self.read_core_registers_raw([reg])
File "/home/galak/.local/lib/python3.7/site-packages/pyocd/coresight/cortex_m.py", line 1061, in read_core_registers_raw
assert dhcsr_val & CortexM.S_REGRDY
AssertionError
Here's the image I'm trying to flash that causes the failure:
Here's also the info w/regards to DAPLINK version.
# DAPLink Firmware - see https://mbed.com/daplink
Unique ID: 02360b000786a36600000000000000000000000097969905
HIC ID: 97969905
Auto Reset: 1
Automation allowed: 1
Overflow detection: 1
Daplink Mode: Interface
Interface Version: 0254
Bootloader Version: 0244
Git SHA: f499eb6ec4a847a2b78831fe1acc856fd8eb2f28
Local Mods: 0
USB Interfaces: MSD, CDC, HID, WebUSB
Bootloader CRC: 0xb2e0084d
Interface CRC: 0x4087b29f
Remount count: 0
URL: https://os.mbed.com/platforms/LPCXpresso55S69/
I'm able to reproduce this.
I'm able to reproduce this.
Now the question is can you fix it? :)
Well, the comment couple of lines earlier about polling S_REGDRY looks like a big warning sign:
# Technically, we need to poll S_REGRDY in DHCSR here before reading DCRDR. But
# we're running so slow compared to the target that it's not necessary.
# Read it and assert that S_REGRDY is set
dhcsr_cb = self.read_memory(CortexM.DHCSR, now=False)
reg_cb = self.read_memory(CortexM.DCRDR, now=False)
dhcsr_cb_list.append(dhcsr_cb)
reg_cb_list.append(reg_cb)
# Read all results
reg_vals = []
for reg, reg_cb, dhcsr_cb in zip(reg_list, reg_cb_list, dhcsr_cb_list):
dhcsr_val = dhcsr_cb()
assert dhcsr_val & CortexM.S_REGRDY
val = reg_cb()
I've somehow 'bricked' a board and than try and re-flash, I get: