Posts by euanm

    J-Link Version info:

    Code
    SEGGER J-Link Commander V8.24 (Compiled Mar 26 2025 15:34:49)
    DLL version V8.24, compiled Mar 26 2025 15:33:55
    
    
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V11 compiled Feb 20 2025 16:24:17
    Hardware version: V11.00


    Hardware used: Raspberry Pi Pico 2 (ARM mode)

    I noticed a drastic loss of performance when debugging with J-Link that went away if I simply reset the MCU after flashing and attached to the running program.
    I eventually narrowed it down to the XIP Cache being disabled and I think the following shows the problem using just J-Link Commander.

    Given the following JLinkScript:

    Connecting to the board after powering it up, you can see this register isn't reset to the power on default after the flash program has finished:

    Here's where the SDK defines the reset value for this register:

    C: pico-sdk\src\rp2350\hardware_regs\include\hardware\regs\xip.h
    // Register    : XIP_CTRL
    // Description : Cache control register. Read-only from a Non-secure context.
    #define XIP_CTRL_OFFSET _u(0x00000000)
    #define XIP_CTRL_BITS   _u(0x00000ffb)
    #define XIP_CTRL_RESET  _u(0x00000083)

    See also section 4.4.5 of the RP2350 datasheet.

    I did notice a few other peripheral registers didn't match their power on defaults.
    Apart from the XIP Cache control register, the differences seem benign but I'm listing them for completeness.

    Peripheral Register Address Value after power on Value after download Notes
    PPB FP_CTRL 0xE0002000 0x10000080 0x10000081 Enable flag
    OTP INTR 0x40120164 0x00000000 0x00000010 Inconsistent repro
    POWMAN STATE 0x40100038 0x00000000 0x00000100 Req ignored
    POWMAN INTR 0x401000E0 0x00000000 0x00000004 Req ignored
    WATCHDOG CTRL 0x400D8000 0x07000000 0x07FFFFFF Timer value, harmless?
    XIP_CTRL CTRL 0x400C8000 0x00000083 0x00000000 See above


    These were found by running a simple "while(1);" firmware, dumping all the registers with Ozone, comparing and filtering out the non-deterministic registers.

    Please let me know if you need more information!