File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,7 @@ struct pbuf *rt_stm32_eth_rx(rt_device_t dev)
336336 rt_uint16_t l ;
337337 struct pbuf * p = RT_NULL , * q ;
338338 ETH_BufferTypeDef RxBuff ;
339+ uint32_t alignedAddr ;
339340
340341 if (HAL_ETH_GetRxDataBuffer (& EthHandle , & RxBuff ) == HAL_OK )
341342 {
@@ -345,7 +346,8 @@ struct pbuf *rt_stm32_eth_rx(rt_device_t dev)
345346 HAL_ETH_BuildRxDescriptors (& EthHandle );
346347
347348 /* Invalidate data cache for ETH Rx Buffers */
348- SCB_InvalidateDCache_by_Addr ((uint32_t * )RxBuff .buffer , framelength );
349+ alignedAddr = (uint32_t )RxBuff .buffer & ~0x1F ;
350+ SCB_InvalidateDCache_by_Addr ((uint32_t * )alignedAddr , (uint32_t )RxBuff .buffer - alignedAddr + framelength );
349351
350352 p = pbuf_alloc (PBUF_RAW , framelength , PBUF_RAM );
351353 if (p != NULL )
You can’t perform that action at this time.
0 commit comments