Page 1 of 1

trouble trying to use the Macronix flash driver

Posted: Tue Apr 28, 2020 1:20 am
by geoffrey.brown
I'm trying to use the macronix driver on an stm32 iot discovery board. I've configured something wrong because when I try to build I get a ton of errors for things that should be defined in hal_wspi.h

For example:

Compiling hal_serial_nor.c
In file included from /home/geobrown/Software/ChibiOS/os/hal/lib/complex/serial_nor/hal_serial_nor.h:205:0,
from /home/geobrown/Software/ChibiOS/os/hal/lib/complex/serial_nor/hal_serial_nor.c:27:
/home/geobrown/Software/ChibiOS/os/hal/lib/complex/serial_nor/hal_serial_nor.c: In function 'bus_cmd':
/home/geobrown/Software/ChibiOS/os/hal/lib/complex/serial_nor/devices/macronix_mx25/hal_flash_device.h:189:42: error: 'WSPI_CFG_CMD_SIZE_16' undeclared (first use in this function); did you mean 'WSPI_CFG_CMD_SIZE_8'?
#define MX25_CFG_C16_8DTR (WSPI_CFG_CMD_SIZE_16 | \

I've defined

HAL_USE_WSPI TRUE in halconf.h

and

STM32_WSPI_USE_QUADSPI1 TRUE in mcuconf.h

Any thoughts ?

Geoffrey

Re: trouble trying to use the Macronix flash driver

Posted: Tue Apr 28, 2020 6:32 am
by Giovanni
Which version? which platform?

I tried the STM32-WSPI-MFS demo and it compiles without errors.

Giovanni

Re: trouble trying to use the Macronix flash driver

Posted: Tue Apr 28, 2020 12:21 pm
by geoffrey.brown
Thanks, yes I should have mentioned that I did that too. Of course it's a different processor, but I don't know how that would affect the configuration.

Geoffrey

Re: trouble trying to use the Macronix flash driver

Posted: Tue Apr 28, 2020 2:13 pm
by geoffrey.brown
It doesn't look like the macronix driver has been used with a quad spi device -- just the octo spi device. Changing the include in the

ChibiOS/testhal/STM32/multi/WSPI-MFS/make/stm32l476_discovery.make

file to the macronix driver instead of the micron one breaks the build and causes the same cascade of errors. I don't understand the complex driver model sufficiently to diagnose this.
Geoffrey

Re: trouble trying to use the Macronix flash driver

Posted: Tue Apr 28, 2020 2:29 pm
by Giovanni
Hi,

There are two problems:

1) STM32 QSPI does not support 16 bits commands, this is why the definition is missing.
2) The Macronix driver that you are trying to use is for an OctoSPI device, it would not work with your device anyway which is a QuadSPI one.

You need a driver for your QSPI device.

Giovanni

Re: trouble trying to use the Macronix flash driver

Posted: Tue Apr 28, 2020 4:27 pm
by geoffrey.brown
Thank you for clearing that up ! At least I know not to pursue that driver route .
Geoffrey