Question and comments about NAND driver
I am using STM32CubeMX version 4.26.1 - haven't upgraded to 5.0 because my customer won't agree to yet, as there is some stable code produced by the older version which they don't want to regression test right now. The device is the STM32H743IITX, library 1.3.0.
I have some questions about setting up the FMC driver for NAND flash, specifically the MX30LF1G18AC. The timing parameters given to set up don't seem to correspond to any of the timings given in the datasheet. Is there someone with knowledge of NAND who could assist me? My HCLK is 200MHz.
Also, I see my code is hanging in calls to HAL_NAND_Write_Page_8b. In the strange while loop in lines 831-841 of stm32h7xx_hal_nand.c, which looks like this:
/* Read status until NAND is ready */
while(HAL_NAND_Read_Status(hnand) != NAND_READY)
{
/* Get tick */
tickstart = HAL_GetTick();
if((HAL_GetTick() - tickstart ) > NAND_WRITE_TIMEOUT)
{
return HAL_TIMEOUT;
}
}
The placement of the call to HAL_GetTick makes me pretty certain this will never time out. However, when I stop with a breakpoint and look into HAL_NAND_Read_Status, the status at that point (and only at that point, while running it doesn't happen), becomes ready and the function exits cleanly. If I leave it running, it does not complete and does not time out.
