Skip to content

[BUG] RP2040/RP2350 with configNUMBER_OF_CORES=1 hang in debug mode #1374

@rgrr

Description

@rgrr

Describe the bug
If one compiles a program for RP2040/RP2350 in single core mode and tries to debug with pyocd, TIMER0 (and perhaps TIMER1 on RP2350) is not running because DBGPAUSE=7 which required both cores to be active.

In my case execution hangs in timer_busy_wait_until() which is called during USB initialization.

Target

  • Development board: Pico2, RP2350
  • Instruction Set Architecture: ARM
  • IDE and version: Eclipse
  • Toolchain and version: PicoSDK 2.2.0

Host

  • Host OS: Linux
  • Version: Debian testing

To Reproduce

Expected behavior
I would expect that the target behaves the same with and without debugger. But as said, TIMER0 is not running in debug mode.

Solution

In single core mode invoke multicore_reset_core1() on startup. My actual fix:

int main(void)
{
#if configNUMBER_OF_CORES != 2
    // this is actually just for debugging the probe firmware running with just one core (good for pyocd)
    // allow to run TIMER0 even in debug pause which would otherwise be inhibited because TIMER0.DBGPAUSE=7
    multicore_reset_core1();
#endif

But I think this fix belongs into FreeRTOS and not every user application.

But honestly I'm not sure if this is an SDK issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions