AnsweredAssumed Answered

HAL NAND Config - SpareAreaSize / PageSize values..

Question asked by David George on Jan 30, 2018
Latest reply on Mar 20, 2018 by Jeanne Joly


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 the page?


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 PageSize;       /*!< NAND memory page (without spare area) size measured in K. bytes */uint32_t SpareAreaSize/*!< NAND memory spare area size measured in K. bytes                */
Thank you!