How to use a Ticker callback to sample an AnalogIn (ADC) at a given sample rate?

  • I haven’t used DMA in Mbed OS 6 yet. (Apart of this case, but that was on an LPC1768).

  • As the issue could be caused by the RTOS, I would recommend to try the Mbed OS 6 bare metal profile (Mbed OS 6 without RTOS).

  • You can also try to add a "platform.callback-nontrivial": true entry to the mbed_app.json file.
    For example:

{
    "target_overrides": {
        "*": {
            "platform.callback-nontrivial": true
        }
    }
}