Skip to content

Commit

Permalink
Update dev_serial_v2.h
Browse files Browse the repository at this point in the history
对上次提交的增补,对rt_serial_tx_fifo中的buffer成员约束32字节地址对齐;
另外修复串口DMA接收,buffer因为不是32字节地址对齐,在SCB_InvalidateDCache_by_Addr时导致rt_serial_rx_fifo结构体中的其他成员数据被Invalidate,未同步写入到memory中的初始化数据被修改,最终造成总线错误,MCU卡死
  • Loading branch information
xinliu0260 authored Dec 8, 2024
1 parent 060f9c4 commit 4601d25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/drivers/include/drivers/dev_serial_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ struct rt_serial_rx_fifo
rt_uint16_t rx_cpt_index;

/* software fifo */
rt_uint8_t buffer[];
rt_align(32) rt_uint8_t buffer[];
};

/**
Expand All @@ -271,7 +271,7 @@ struct rt_serial_tx_fifo
struct rt_completion tx_cpt;

/* software fifo */
rt_uint8_t buffer[];
rt_align(32) rt_uint8_t buffer[];
};

/**
Expand Down

0 comments on commit 4601d25

Please sign in to comment.