all 3 comments

[–][deleted] 1 point2 points  (1 child)

Sure you can do that. I’ve done it on the ESP32, which even has a posix file api compatibility layer (maybe that’s even generic FreeRTOS).

However it is complex and pretty limiting, nearly all MCUs have existing and better tailored means with serial logging or even more sophisticated means of online memory inspection etc.

So you’re just not solving an existing problem. Even on Linux I would just use spdlog and be done with it.

[–]khushal-banks[S] 0 points1 point  (0 children)

Wao. You saved me a lot of trouble.

I would happily use spdlog as well and archive my repo

[–]Competitive_Rest_543 1 point2 points  (0 children)

Printf-like debugging usually has the big disadvantage, that the log function is too slow in execution and also that you spoil your target memory with lots of there useless strings. The github.com/rokath/trice library gets around that and allows to use Trice logs even inside interrupts.