I am using the latest ChibiOS 17.6.2 and I have problems getting QSPI to work.
I enabled the QSPI subsystem.
Here are the settings of mcuconf.h.
Code: Select all
/*
* QSPI driver system settings.
*/
#define STM32_QSPI_USE_QUADSPI1 TRUE
#define STM32_USE_STM32_D1_WORKAROUND FALSE
#define STM32_QSPI_QUADSPI1_PRESCALER_VALUE 8
#define STM32_QSPI_QUADSPI1_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
#define STM32_QSPI_DMA_ERROR_HOOK(qspip) osalSysHalt("DMA failure")
The board.c/h files should be correct. I used all the alternate function settings from the reference manual for the four data pins, clock and chip select.
Then, I try to send something, just a command for testing:
Code: Select all
// The QSPI configuration
static const QSPIConfig QSPI_cfg = {
NULL,
QUADSPI_DCR_FSIZE_2,
};
// The QSPI command
qspi_command_t com;
/**
* Address on single data line
*/
com.cfg = QUADSPI_CCR_ADMODE_0;
com.addr = 0xFF;
com.alt = 0;
/* Bus acquisition and SPI reprogramming.*/
qspiAcquireBus(&QSPID1);
qspiStart(&QSPID1, &QSPI_cfg);
qspiCommand(&QSPID1, &com);
/* Releasing the bus.*/
qspiReleaseBus(&QSPID1);
The problem is, when calling qspiCommand(), this call inside it breaks it:
Code: Select all
(void) osalThreadSuspendS(&qspip->thread);
meaning that the thread is suspended forever. I had the same problem when I had errors in my board configuration for simple SPI but I cannot find any errors in my board files this time. Also, nothing happens at the QSPI pins, checking with a scope.
Code: Select all
osalSysUnlock();
within qspiCommand() is never reached.
Do you have some suggestions?
Best regards,
Adrian