Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
typec/stm32: guard hard reset RX re-arm against uninitialized buffer
  • Loading branch information
michaelajax committed Apr 24, 2026
commit b5e63ca44c846813ece9ad9df684cae0d1d5b542
6 changes: 4 additions & 2 deletions src/portable/st/typec/typec_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ void tcd_int_handler(uint8_t rhport) {
// flag will remain set and re-enter the ISR immediately
if (sr & UCPD_SR_RXHRSTDET) {
TU_LOG3("Hard Reset received\r\n");
dma_stop(rhport, true);
tcd_msg_receive(rhport, _rx_buf, _rx_buf_len);
if (_rx_buf != NULL && _rx_buf_len > 0) {
dma_stop(rhport, true);
tcd_msg_receive(rhport, _rx_buf, _rx_buf_len);
}
UCPD1->ICR = UCPD_ICR_RXHRSTDETCF;
}

Expand Down
Loading