[SOLVED] Raspberry Pi Pico RP2040 - Cortex-M HardFault Exception

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

  • [SOLVED] Raspberry Pi Pico RP2040 - Cortex-M HardFault Exception

    Hi!

    I'm using a Segger J-Link Edu mini to debug a Raspberry Pi Pico RP2040.

    For simplicity, I am trying a blink example with Arduino.

    Ozone uploads and starts debugging, but soon reports a Cortex-M HardFault Exception. with three lines.

    Source Code

    1. CPU / Peripherals / SCB / SHCSR / SVCALLPENDED
    2. CPU / Peripherals / SCB / CCR / STKALIGN
    3. CPU / Peripherals / SCB / CCR / UNALIGN-TRP

    I had a look at the dedicated Wiki page for explanations, but can't find how to fix the issue.

    I have a similar issue when using the command line tools and arm-none-eabi-gdb.

    Shell-Script

    1. JLinkGDBServer -device RP2040_M0_0 -if swd -speed 1000
    Thank you for your help.


    Exact configuration is:
    • Arduino 1.8.13
    • Arduino mbedOS RP2040 2.0.0
    • Build with -g3 -ggdb
    • Firmware: J-Link EDU Mini V1 compiled Feb 18 2021 11:25:23
    • Hardware: V1.00
    • JLink 7.20
    • Ozone 3.22e
  • Hi,
    We are not aware of such an issue.

    You can find an example blinky project for the RP2040 here:
    wiki.segger.com/Raspberry_Pi_Pico#Example_Projects

    It should be working out of the box for Ozone / Embedded Studio.

    Could you please give that one a try?

    Best regards,
    Fabian
    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.
  • Thank you for your reply. Indeed, the example built with Embedded Studio work fine.

    The fact is, I am using Mbed OS.
    • How to configure JLinkGDBServer?
    • Is there a plug-in for Mbed OS?
    Thank you and best regards.
  • Hi,
    Sorry for the delay in response.

    I would guess that the issue is either caused by your application (simply causing a hardfault at some point)
    or a setup related / project settings issue, as everything works as expected with the sample project.

    As mentioned in my last reply, we have not received a single other report regarding this.

    There is currently no plug-in for Mbed OS available, but you can create one yourself:
    segger.com/products/debug-prob…r/thread-aware-debugging/

    Best regards,
    Fabian
    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.