trouble trying to use the Macronix flash driver

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
geoffrey.brown
Posts: 122
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 18 times

trouble trying to use the Macronix flash driver

Post 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
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: trouble trying to use the Macronix flash driver

Post by Giovanni »

Which version? which platform?

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

Giovanni
geoffrey.brown
Posts: 122
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 18 times

Re: trouble trying to use the Macronix flash driver

Post 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
geoffrey.brown
Posts: 122
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 18 times

Re: trouble trying to use the Macronix flash driver

Post 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
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: trouble trying to use the Macronix flash driver

Post 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
geoffrey.brown
Posts: 122
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 18 times

Re: trouble trying to use the Macronix flash driver

Post by geoffrey.brown »

Thank you for clearing that up ! At least I know not to pursue that driver route .
Geoffrey
Post Reply