Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xinliu0260 patch 1 #9755

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
Next Next commit
Update drv_usart_v2.c
修复stm32h7开启DCache之后,串口dma发送数据不同步的bug
  • Loading branch information
xinliu0260 authored Dec 8, 2024
commit 060f9c40a2563f3c1f0958ab252f69667ec85913
4 changes: 4 additions & 0 deletions bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ static rt_ssize_t stm32_transmit(struct rt_serial_device *serial,

if (uart->uart_dma_flag & RT_DEVICE_FLAG_DMA_TX)
{
#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
struct rt_serial_tx_fifo *tx_fifo = (struct rt_serial_tx_fifo *) serial->serial_tx;
SCB_CleanDCache_by_Addr((uint32_t *)tx_fifo->rb.buffer_ptr, tx_fifo->rb.buffer_size);
#endif
HAL_UART_Transmit_DMA(&uart->handle, buf, size);
return size;
}
Expand Down