2018-01-30 03:52 AM
Hi.
When configuring the HAL_NAND driver you need to set the PageSize and SpareAreaSizes values;
/* hnand1.Config */
hnand1.Config.PageSize = 2048; hnand1.Config.SpareAreaSize = 64; hnand1.Config.BlockSize = 64; hnand1.Config.BlockNbr = 1024; hnand1.Config.PlaneNbr = 1; hnand1.Config.PlaneSize = 1024; hnand1.Config.ExtraCommandEnable = ENABLE;HAL_NAND_Init(&hnand1, &ComSpaceTiming, &AttSpaceTiming);
Does anyone know if these values are for the
whole device
or just thepage
?The typedefs in the HAL NAND driver suggest these are large values as they are in kB, so suggesting these are for the whole device. For my device the SpareAreaSize for a page is 64 bytes, so you can't set 0.0625 !!
In stm32f7xx_hal_nand.h:
uint32_t ;
/*!< NAND memory page (without spare area) size measured in K. bytes */
uint32_t ;/*!< NAND memory spare area size measured in K. bytes */
Thank you!
Solved! Go to Solution.
2018-01-30 03:58 AM
Kind of found an answer, looked in the actual 'stm32f7xx_hal_nand.h' file in my project and the struct is described differently from the help documentation;
/**
* @brief NAND Memory info Structure definition */ typedef struct{ uint32_t PageSize; /*!< NAND memory page (without spare area) size measured in bytes for 8 bits adressing or words for 16 bits addressing */uint32_t SpareAreaSize; /*!< NAND memory spare area size measured in bytes
for 8 bits adressing or words for 16 bits addressing */ uint32_t BlockSize; /*!< NAND memory block size measured in number of pages */uint32_t BlockNbr; /*!< NAND memory number of total blocks */
uint32_t PlaneNbr; /*!< NAND memory number of planes */uint32_t PlaneSize; /*!< NAND memory zone size measured in number of blocks */
FunctionalState ExtraCommandEnable; /*!< NAND extra command needed for Page reading mode. This
parameter is mandatory for some NAND parts after the read command (NAND_CMD_AREA_TRUE1) and before DATA reading sequence. Example: Toshiba THTH58BYG3S0HBAI6. This parameter could be ENABLE or DISABLE Please check the Read Mode sequnece in the NAND device datasheet */}NAND_DeviceConfigTypeDef;2018-01-30 03:58 AM
Kind of found an answer, looked in the actual 'stm32f7xx_hal_nand.h' file in my project and the struct is described differently from the help documentation;
/**
* @brief NAND Memory info Structure definition */ typedef struct{ uint32_t PageSize; /*!< NAND memory page (without spare area) size measured in bytes for 8 bits adressing or words for 16 bits addressing */uint32_t SpareAreaSize; /*!< NAND memory spare area size measured in bytes
for 8 bits adressing or words for 16 bits addressing */ uint32_t BlockSize; /*!< NAND memory block size measured in number of pages */uint32_t BlockNbr; /*!< NAND memory number of total blocks */
uint32_t PlaneNbr; /*!< NAND memory number of planes */uint32_t PlaneSize; /*!< NAND memory zone size measured in number of blocks */
FunctionalState ExtraCommandEnable; /*!< NAND extra command needed for Page reading mode. This
parameter is mandatory for some NAND parts after the read command (NAND_CMD_AREA_TRUE1) and before DATA reading sequence. Example: Toshiba THTH58BYG3S0HBAI6. This parameter could be ENABLE or DISABLE Please check the Read Mode sequnece in the NAND device datasheet */}NAND_DeviceConfigTypeDef;2018-01-30 07:57 AM
In which help documentation you find the wrong comment?
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-01-30 08:03 AM
Hi.
I
was
looking in '..\STM32Cube_FW_F7_V1.5.0\Drivers\STM32F7xx_HAL_Driver\STM32F756xx_User_Manual.chm', old Cube version.I now have used '..\STM32Cube_FW_F7_V1.7.0\Drivers\STM32F7xx_HAL_Driver\STM32F756xx_User_Manual.chm' and the description is different.
I assume that's the best to use for the STM32F767NIH device.
The 'hint' inside the FMC NAND Setup dialog in STM32CubeMX however still mentions ' size in K. bytes ' which I think is wrong.
David
2018-01-30 08:19 AM
Hi David,
Thanks for your reply.
Using
STM32F767NIH, STM32F779xx_User_Manual.chm may be the more suitable.
Regarding the comment in CubeMX, I'll report it.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-03-20 09:33 AM
Hi
George.David.002
,This issue is now fixed in the current CubeMX release.
Please, upgrade with CubeMX4.25 if not already done.
BR. Jeanne