At least in zeptoforth (full disclosure: this is my Forth which runs on, amongst other things, the RP2040 and, in the alpha releases, the RP2350) what I would recommend is recording the data to a buffer in a double-buffered arrangement from within an interrupt handler, and simultaneously writing the other buffer to an SDHC card (either in a FAT32 filesystem or directly on the card itself if FAT32 is too slow) in a task on either core, preferably which one is less realtime. (It is generally a good idea to segregate your realtime code to one core and running non- or less-realtime code on the other core.) Because the flash on the RP2040 or RP2350 board itself is not being written to, there is no need for the interrupt handler to execute out of RAM (but zeptoforth does make this possible), and furthermore flash wear does not need to be considered, because an SDHC card can practically be considered disposable, and has sufficient space to that the same space, if you are reusing space by writing to it more than once in a circular fashion, will be reused far less than the space in the far more limited flash of a typical RP2040 or RP2350 board.
Statistics: Posted by tabemann — Sat Sep 07, 2024 10:32 pm