jonas-schievink / rubble

(going to be a) BLE stack for embedded Rust
BSD Zero Clause License
397 stars 56 forks source link

tx_payload_buf problem #67

Closed thalesfragoso closed 4 years ago

thalesfragoso commented 5 years ago

Shouldn't this method check for ongoing transactions before handing out the buffer ? Also, shouldn't the radio driver for the nrf-52 have some compiler-fences for the DMA ?

jonas-schievink commented 5 years ago

Thanks for the report! This does indeed look unsound.

Shouldn't this method check for ongoing transactions before handing out the buffer ?

Yes, it should. I believe we used to block until the end of transmission in transmit_data, so this wasn't able to cause problems before.

Also, shouldn't the radio driver for the nrf-52 have some compiler-fences for the DMA ?

Probably, yeah. The nRF52 HAL has this setup around DMA transfers, so we should probably try to copy that.

Feel free to send a fix if you want to.