[SOLVED] Embedded Studio RP2040 Support

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Embedded Studio RP2040 Support

    I'm attempting to put together a template solution file for the RP2040 that will at a minimum, compile cleanly and load onto the device. I've gone through the process within Embedded Studio to create a new solution and selected the RP2040 as the target processor and then Embedded Studio has generated a shell program. The shell program does compile cleanly but it fails when I attempt to load the binary onto the device.

    This is the output when I connect my J-Link EDU Mini:

    Source Code

    1. Connecting ‘J-Link’ using ‘USB’
    2. Connecting to target using SWD
    3. Loaded C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.40c/bin/JLink_x64.dll
    4. Firmware Version: J-Link EDU Mini V1 compiled Feb 18 2021 11:25:23
    5. DLL Version: 6.98b
    6. Hardware Version: V1.00
    7. Target Voltage: 3.296
    8. Device "RP2040_M0_0" selected.
    9. ConfigTargetSettings() start
    10. J-Link script: ConfigTargetSettings()
    11. ConfigTargetSettings() end
    12. InitTarget() start
    13. InitTarget() end
    14. Found SW-DP with ID 0x0BC12477
    15. SWD speed too high. Reduced from 4000 kHz to 2700 kHz for stability
    16. DPIDR: 0x0BC12477
    17. Scanning AP map to find all available APs
    18. AP[1]: Stopped AP scan as end of AP map has been reached
    19. AP[0]: AHB-AP (IDR: 0x04770031)
    20. Iterating through AP map to find AHB-AP to use
    21. AP[0]: Core found
    22. AP[0]: AHB-AP ROM base: 0xE00FF000
    23. CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    24. Found Cortex-M0 r0p1, Little endian.
    25. FPUnit: 4 code (BP) slots and 0 literal slots
    26. CoreSight components:
    27. ROMTbl[0] @ E00FF000
    28. ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    29. ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    30. ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    Display All
    To me, all looks good at this point. But here is the additional output when I attempt to download the binary to the target device:

    Source Code

    1. Preparing target for download
    2. Executing Reset script TargetInterface.resetAndStop()
    3. Reset: Halt core after reset via DEMCR.VC_CORERESET.
    4. Reset: Reset device via AIRCR.SYSRESETREQ.
    5. Downloading ‘Executable_1.elf’ to J-Link
    6. Programming 1.9 KB of addresses 10000000 — 1000079d
    7. J-Link: Flash download: Bank 0 @ 0x10000000: 1 range affected (65536 bytes)
    8. J-Link: Flash download: Total: 0.216s (Prepare: 0.068s, Compare: 0.044s, Erase: 0.011s, Program & Verify: 0.087s, Restore: 0.003s)
    9. J-Link: Flash download: Program & Verify speed: 735 KB/s
    10. Programming failed @ address 0x10000000 (block verification error)
    11. Failed to restore target. RAMCode never stops
    12. Download successful
    13. Cannot read register 20 (CFBP) while CPU is running
    14. CPU is not halted
    Display All
    So, am I missing something or am I doing something wrong? Any help will be appreciated.

    Jim...

    P.S. I'm using the Sparkfun MicroMod ATP Carrier board with the MicroMod RP2040 module for my development. I'm not sure if this has anything to do with why the flash is not being programmed so I'm comparing this setup with the Pico module to see if there's any explainable difference.

    The post was edited 1 time, last by JimInCA ().

  • Until you solve it, you can debug in Ozone. Pick RP2040 in the new project wizard, debugging is working very well with the .elf made by Studio.
    If upload is not reliable in Ozone, just upload the .hex with JFlash Lite, then "attach to running program" in Ozone. If subsequent connection fails, disconnect-reconnect the Jlink usb. (it's a known problem, check the subsequent... topic)

    I tried it with this demo program: pico-ses
    github.com/majbthrd/pico-demos

    Hope for a RP2040 package in the Package Manager.

    The post was edited 1 time, last by vorosj ().

  • Hello,

    Thank you for your inquiry.
    For RAM debug samples in ES and Ozone see here:
    wiki.segger.com/Raspberry_Pi_Pico#Example_Projects

    Flash samples are not availalbe yet. But flash downloading is supported. So it is rather a matter of project/boot setup on the RP2040 so the application you Flash to the external Flash boots automatically.
    Regarding connection issues. There are some known limitations on the RP2040 if you try to reconnect to the same core or switch connection to the second core. Then connection will fail. The only workaround for the moment is to power cycle the RP2040.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Studio v5.42
    It has RP2040 package. The "RTT Hello world" compiled without error message, but debugging is not working at all.
    The above mentioned pico-ses is working.

    Debug/Go (F5): Flash upload is working, but the debugger fails.

    Workaround:
    - upload to the flash with Debug/Go (F5)
    - disconnect the J-link usb and reconnect
    - Target/Connect J-link
    - Target/Attach Debugger
    and it's working.

    The post was edited 1 time, last by vorosj ().

  • Hello,

    FYI
    we just released the new CPU Support Pacakge for RP2040 and the BSP for the Pico board.
    You can find them in the ES Package Manager.

    The CPU Support package can be used for generic RAM samples.

    The BSP is for the Pico Board which links against the pico-sdk and comes with an out of the box blinky sample and runs out of the box from the QSPI Flash.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.