Cache-related problem in some STM32 HAL drivers

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Cache-related problem in some STM32 HAL drivers

Post by Giovanni »

Hi,

Putting this here to keep track.

Several LLDs have DMA-accessible buffers inside the driver structure, this is a problem on those devices where cache coherency must be handled.

Required action: move all buffers outside the driver structure, replace those with a pointer to the actual buffer which should be aligned to cache lines.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Cache-related problem in some STM32 HAL drivers

Post by Giovanni »

bump
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

Re: Cache-related problem in some STM32 HAL drivers

Post by faisal »

Has this been addressed? If so, in what versions?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Cache-related problem in some STM32 HAL drivers

Post by Giovanni »

This has been addressed for SNOR, now XSNOR. I need to check sd_mmc but I think it was addressed there too.

Giovanni
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: Cache-related problem in some STM32 HAL drivers

Post by FXCoder »

Addressed the SPI dummy variables as well by allowing the entire driver structure to be located in non-cache.
Drivers now have this for allocation...

Code: Select all

/** @brief SPI1 driver identifier.*/
#if STM32_SPI_USE_SPI1 || defined(__DOXYGEN__)
SPI_SPID1_MEMORY SPIDriver SPID1;
#endif

So just define the non-cache section to be used.
Post Reply