Im currently working a on custom H743 board with a Winbond W25Q128 flash IC connected via WSPI with the following pins:
Code: Select all
#include "w25q256jv.h"
#include "hal_flash_device.h"
#include "hal_serial_nor.h"
#include "hal_mfs.h"
#define NO_CACHE __attribute__((section(".ram3")))
static NO_CACHE SNORDriver snor1;
static NO_CACHE snor_nocache_buffer_t snor1buf;
static const WSPIConfig w25q_wspicfg = {
.end_cb = NULL,
.error_cb = NULL,
.dcr = ((0 << 0) | STM32_DCR_CSHT(1) | STM32_DCR_FSIZE(24)),
};
const SNORConfig snorcfg1 = {
.busp = &WSPID1,
.buscfg = &w25q_wspicfg};
void testFlash()
{
// IO3, IO2 (normally floating; optional PU early-boot)
palSetPadMode(GPIOF, 6U, PAL_MODE_ALTERNATE(9) | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
palSetPadMode(GPIOF, 7U, PAL_MODE_ALTERNATE(9) | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
// IO0, IO1
palSetPadMode(GPIOF, 8U, PAL_MODE_ALTERNATE(10) | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
palSetPadMode(GPIOF, 9U, PAL_MODE_ALTERNATE(10) | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
// CLK
palSetPadMode(GPIOB, 2U, PAL_MODE_ALTERNATE(9) | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
// NCS (chip select) — keep pulled up
palSetPadMode(GPIOB, 6U, PAL_MODE_ALTERNATE(10) | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_FLOATING);
wspiStart(&WSPID1, &w25q_wspicfg);
snorObjectInit(&snor1, &snor1buf);
snorStart(&snor1, &snorcfg1);
}
But to no luck there is no output on CLK / IO / NCS pins (checked with a scope). All neccessary registers seem to be set correctly.
Is it an issue in the driver or related to the H7 itself, since I've saw simillar problems on the forum but there was no definitive anwser to the issue.
