gauteh / defmt-serial

Log defmt messages over the serial port.
23 stars 6 forks source link

Soundly alias and reference the serial for defmt #10

Closed gauteh closed 4 months ago

jamesmunns commented 5 months ago

The current approach is unsound for two reasons:

Additionally, using the unsafe serial fn is UB any defmt behavior occurs while you are holding the reference.

I'm also not sure why the transmute is necessary to go from &mut dyn EraseWrite to *mut dyn EraseWrite.

gauteh commented 5 months ago

Ref, need blocking Write on rp-hal: https://github.com/rp-rs/rp-hal/issues/760 , should probably just upgrade to eh-1.

gauteh commented 4 months ago

Finally got the time to make some effort on this. Think it is getting closer now. The pi-pico example is going to fail until the blocking write trait is implemented, or we upgrade to eh-1 (#11).