Core0 simply responds by SWD WAIT to any MEM-AP operation. Bus is stalled, most 
probably by a broken QSPI XIP access. I see no problem at OpenOCD side.


---

**[tickets:#416] RP2040 QSPI Flash reset (no more XIP) causes debug and Flash 
to fail.**

**Status:** new
**Milestone:** 0.10.0
**Created:** Sat Sep 23, 2023 04:08 PM UTC by JustAnother1
**Last Updated:** Sat Sep 23, 2023 06:43 PM UTC
**Owner:** nobody
**Attachments:**

- 
[report.txt](https://sourceforge.net/p/openocd/tickets/416/attachment/report.txt)
 (34.1 kB; text/plain)


I use 

Open On-Chip Debugger 0.11.0-g4f2ae61-dirty (2022-10-07-22:36) 

(xpack running in Linux Mint) used with picoprobe 1.0.3 debugging a firmware 
and ran into this error:

Error: 233 92 arm_adi_v5.c:548 mem_ap_read(): Failed to read memory and, 
additionally, failed to find out where

Let me explain:
I write a firmware that should use part of the QSPI flash as file storage. I 
therefore copied all the firmware from QSPI flash into RAM and run it there. I 
then do a Reset on the QSPI interface like this:

    // reset QSPI
    RESETS->RESET = RESETS->RESET | (1 << RESETS_RESET_IO_QSPI_OFFSET) | (1 << 
RESETS_RESET_PADS_QSPI_OFFSET);
    PSM->FRCE_OFF =  PSM->FRCE_OFF | (1 << PSM_FRCE_OFF_XIP_OFFSET);

    // power on QSPI
    PSM->FRCE_OFF =  PSM->FRCE_OFF & ~(uint32_t)(1 << PSM_FRCE_OFF_XIP_OFFSET);
    PSM->FRCE_ON =  PSM->FRCE_ON | (1 << PSM_FRCE_ON_XIP_OFFSET);
    RESETS->RESET = RESETS->RESET &~(uint32_t)( (1 << 
RESETS_RESET_IO_QSPI_OFFSET) | (1 << RESETS_RESET_PADS_QSPI_OFFSET));

and these lines cause the issue. With them removed debugging and flashing works 
again, but with them in neither debugging nor flashing works.

By holding down the boot button on the pico, and therefore forcing the chip 
into the hard wired raspberry pi boot loader, I can then flash a new firmware 
again.

I therefore assume that the memory read fail is in the Flash area, as reading 
that area is not possible anymore with my change.

I have attached the log showing the error.



---

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