Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7107

General • Proper RP2350 SWD Initialization Sequence?

$
0
0
Hello,

I Have built my own SWD flash programmer. It works for RP2040, Renesas RA4M1, STM32F, STM32H, NRF52, etc. However it acts weird when I use it for RP2350.

I know RP2350 use DapV3, so also have done these steps after reading IDCODE:
  • Ensuring that ACCESSCTRL.LOCK is zero (by reading from 0x40060000)
  • Reset ACCESSCTRL permissions via CFGRESET by writing 0xACCE0001 to 0x40060008
  • Ensuring that DSCSR.CDS is one by writing ( <value_read_from_0xE000EE08> & 0xFFFDFFFFL | 0x00010000L ) to 0xE000EE08
I can read the BOOTROM (using TAR and DRW as usual via AHB-AP 0x02000) and find the ROM functions correctly. However, I cannot execute any of them because I cannot even read or write to SRAM.

Any access to SRAM (TAR = 0x20000000) will set the STICKYERR in CTRLSTAT. Setting the TAR only is OK, but once I read/write DRW the sticky error is set. I also cannot access any oscillator and power register (the same STICKYERR). It is weird because I can read the BOOTROM just fine.

My RP2350 does not have OTP key set (confirmed using picotool), so it should not be caused by this. Writing dummy 128-bit keys to RP-AP also does not help. Setting the TAR high word and SELECT1 to zero also has no effect (well, because it is not 64-bit).

I think I might miss some initialization steps (more register needs to be set?)

Thank you and best regards,
Aloysius

Statistics: Posted by aloysiusindrayanto — Fri Nov 29, 2024 11:21 pm — Replies 1 — Views 45



Viewing all articles
Browse latest Browse all 7107

Trending Articles