Page 1 of 1

SNOR driver and nocache buffer

Posted: Wed Jul 09, 2025 9:35 am
by Dron_Gus
Hi,

Looking at os/hal/lib/complex/serial_nor/hal_serial_nor.c/h code it seems to me that "nocache" feature is not fully finished/implemented. At least for SPI (not WSPI) mode: local buffers are used in few places to construct tx packets.
We need SPI driver for W25Q for RusEFI project, so I done some modification to make serial_nor subsystem work on our STM32F7 based device.
Please see https://github.com/rusefi/ChibiOS/pull/ ... c7edb2ace7 .
If you have any comments - please let me know.
If you like - I can convert macronix_mx25 and micron_n25q drivers to changed API and provide set of patches.
Also I can provide patch adding W25Q support.

Andrey.

Re: SNOR driver and nocache buffer

Posted: Wed Jul 09, 2025 12:11 pm
by Giovanni
Hi,

Note that this has been "fixed" by adding a new SNOR framework called "xsnor" which addresses the problem with buffers and adds more features (multi-devices, devices detection mainly). If you are going to add new devices, perhaps, it is better to do that in "xsnor".

Patches to old serial-nor would also be nice of course.

Giovanni

Re: SNOR driver and nocache buffer

Posted: Wed Jul 09, 2025 2:16 pm
by Dron_Gus
Giovanni wrote:Hi,

Note that this has been "fixed" by adding a new SNOR framework called "xsnor" which addresses the problem with buffers and adds more features (multi-devices, devices detection mainly). If you are going to add new devices, perhaps, it is better to do that in "xsnor".

Patches to old serial-nor would also be nice of course.

Giovanni

Thanks for reply.
I did not take a look into master branch when start moving to 21.11.x branch.
xsnor look interesting. I'll think about better way and maybe return with W25Q driver for xsnor.

Re: SNOR driver and nocache buffer

Posted: Wed Jul 09, 2025 3:49 pm
by Giovanni
I just started porting the whole trunk HAL to 21.11.4, it could take some time because all differences but what you see in trunk now is what you will get in 21.11.4.

Giovanni

Re: SNOR driver and nocache buffer

Posted: Sun Jul 13, 2025 12:54 pm
by Dron_Gus
Giovanni wrote:I just started porting the whole trunk HAL to 21.11.4, it could take some time because all differences but what you see in trunk now is what you will get in 21.11.4.

Giovanni

Hi.

Thanks you for your hard work!

Currently I'm stick with strange DMA/SPI issue while trying to make W25Q work reliable. Sometimes (once for 25Kb write) one byte is missed/stuck and transferred during next Tx transfer. This totally breaks MFS driver.
If I will not be albe to find root cause I'll create separate topic with detailed issue description. But so far it's looks like SPI/DMA issue.