FSMC NAND flash problem with community driver
Posted: Sat Mar 25, 2017 6:08 pm
Hi!
First, big thanks to @barthess for great driver!
I'm using TE-STM32F437 board (https://www.terraelectronica.ru/catalog ... DE=1327703, sorry only russian there),
but its schematic can be found at http://king2.net/files/TE-STM32F437/TE- ... _sheet.pdf, example project at http://king2.net/files/TE-STM32F437/demo.zip.
My module uses STM32F437ZGT6 (works), MT45W8MW16BGX as PSRAM (works) and SAMSUNG K9F4G08U0E (not works).
I'm initializing NAND flash driver with following code (time parameters was taken from example project of this board and may be errorneous, but I have not enough knowledge to check this):
Additionally, example project was done with ST's library and have
that was not used in ChibiOS driver (as I understand, zeroes will be places into PCR register instead).
Then, driver sends first command to NAND, suspends thread and that's all. I have placed breakpoint to CH_IRQ_HANDLER(STM32_FSMC_HANDLER), it is not firing, just waits somewhere inside ChibiOS.
My NAND R/B pin connected to PG6 port (FSMC INT2), i have configured this pin as FSCM alternative function, and, as I understand, this should fire interrupt when NAND will be ready for next command/data, but this not happens..
Please, forgive me my newbiew question and help me to get it to work!
Thanks you in advance!
p.s. It this will be more suitable, my skype is oleg_king2, I can show debugger window by screen sharing.
p.p.s. Please forgive my not-so-good english, i'm not native speaker.
First, big thanks to @barthess for great driver!
I'm using TE-STM32F437 board (https://www.terraelectronica.ru/catalog ... DE=1327703, sorry only russian there),
but its schematic can be found at http://king2.net/files/TE-STM32F437/TE- ... _sheet.pdf, example project at http://king2.net/files/TE-STM32F437/demo.zip.
My module uses STM32F437ZGT6 (works), MT45W8MW16BGX as PSRAM (works) and SAMSUNG K9F4G08U0E (not works).
I'm initializing NAND flash driver with following code (time parameters was taken from example project of this board and may be errorneous, but I have not enough knowledge to check this):
Code: Select all
#define FSMCNAND_TIME_SET ((uint32_t) 0x04)
#define FSMCNAND_TIME_WAIT ((uint32_t) 0x12)
#define FSMCNAND_TIME_HOLD ((uint32_t) 0x08)
#define FSMCNAND_TIME_HIZ ((uint32_t) 0x04)
#define NAND_BLOCKS_COUNT 2048
#define NAND_PAGE_DATA_SIZE 2048
#define NAND_PAGE_SPARE_SIZE 64
#define NAND_PAGE_SIZE (NAND_PAGE_SPARE_SIZE + NAND_PAGE_DATA_SIZE)
#define NAND_PAGES_PER_BLOCK 64
#define NAND_ROW_WRITE_CYCLES 3
#define NAND_COL_WRITE_CYCLES 2
static const NANDConfig nandcfg = {
NAND_BLOCKS_COUNT,
NAND_PAGE_DATA_SIZE,
NAND_PAGE_SPARE_SIZE,
NAND_PAGES_PER_BLOCK,
NAND_ROW_WRITE_CYCLES,
NAND_COL_WRITE_CYCLES,
// stm32 specific fields
((FSMCNAND_TIME_HIZ << 24) | (FSMCNAND_TIME_HOLD << 16) | \
(FSMCNAND_TIME_WAIT << 8) | FSMCNAND_TIME_SET)
};
nandStart(&NANDD1, &nandcfg, NULL); // it can make errormap
Additionally, example project was done with ST's library and have
Code: Select all
FSMC_NANDInitStructure.FSMC_TCLRSetupTime = 0x3;
FSMC_NANDInitStructure.FSMC_TARSetupTime = 0x3;
that was not used in ChibiOS driver (as I understand, zeroes will be places into PCR register instead).
Then, driver sends first command to NAND, suspends thread and that's all. I have placed breakpoint to CH_IRQ_HANDLER(STM32_FSMC_HANDLER), it is not firing, just waits somewhere inside ChibiOS.
My NAND R/B pin connected to PG6 port (FSMC INT2), i have configured this pin as FSCM alternative function, and, as I understand, this should fire interrupt when NAND will be ready for next command/data, but this not happens..
Please, forgive me my newbiew question and help me to get it to work!
Thanks you in advance!
p.s. It this will be more suitable, my skype is oleg_king2, I can show debugger window by screen sharing.
p.p.s. Please forgive my not-so-good english, i'm not native speaker.