10000 RP2040 modm::chrono::micro_clock::now() is imprecise when called from Core1 · Issue #907 · modm-io/modm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
RP2040 modm::chrono::micro_clock::now() is imprecise when called from Core1 #907
Closed
@cocasema

Description

@cocasema

When I was working on nrf24 code, I tried moving the rf logic to Core1, and got lots timeouts and delays. This initially got me thinking about some hw slowness due to locks etc, but luckily it narrowed down to micro_clock being very imprecise when called from Core1. While running on Core0, the delays between nrf24 write and interrupt ack would be ~350us, and on Core1 I was getting 0 and ~1ms.

RP2040 provides microsecond time via 64 bit counter.
And if I replace the code of modm::chrono::micro_clock::now() in platform/clock/systick_timer.cpp with reading the timer_hw->timel* registers, I get reliable time with a microsend resolution on both cores.

I can make a PR with the changes. Q: Should I %if the implementation based on the target and keep it in the same systick_timer.cpp
or should modm::chrono::micro_clock::now() be moved to some rp2040 related file for this case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0