cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeF4: changes for HAL NAND in version 1.27?

SMain.2
Associate II

File stm32f4xx_hal_nand.c has changed in version 1.27.0 of the STM32CubeF4 package, but nothing is mentioned in the release notes.

Also, in version 1.26.2, there was a 2017 copyright in the file, while in 1.27.0, there is a 2016 copyright. Is there any regression on this file? 

5 REPLIES 5
TDK
Guru

There don't appear to be any regressions.

The changes mostly involve addition of "#if defined(FMC_Bank2_3) || defined(FSMC_Bank2_3)" guards on statements and some DSB instructions.

If you feel a post has answered your question, please click "Accept as Solution".
SMain.2
Associate II

Hi,

When I look at the previous file I had in my project (I thought it was with STM32CubeF4 v1.26.2, but I could be wrong), I see more changes:

In stm32f4xx_hal_nand.h, I could see these definitions in my previous version:

typedef struct
{
  uint32_t        PageSize;              /*Number of data bytes per page - expected 00h, 20h, 00h, 00h*/
  uint16_t        SpareAreaSize;         /*Number of spare bytes per page - expected C0h, 01h*/
 ...
}NAND_MemOrgTypeDef;
HAL_StatusTypeDef  HAL_NAND_Read_Parameter(NAND_HandleTypeDef *hnand, NAND_MemOrgTypeDef *pNAND_MemOrg);
#define NAND_CMD_READPARAMETER      ((uint8_t)0xEC)

And in stm32f4xx_hal_nand.c, I see that a couple more blocks disappeared in the most recent HAL update, like the HAL_NAND_Read_Parameter function or a check at the end of the HAL_NAND_Erase_Block function:

HAL_StatusTypeDef  HAL_NAND_Read_Parameter(NAND_HandleTypeDef *hnand, NAND_MemOrgTypeDef *pNAND_MemOrg)
{...}
HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress)
{
 ...
 
  /* Read status until NAND is ready */
  while(HAL_NAND_Read_Status(hnand) != NAND_READY)
  {
    if((HAL_GetTick() - tickstart ) > NAND_WRITE_TIMEOUT)
    {
      /* Process unlocked */
      __HAL_UNLOCK(hnand);    
  
      return HAL_TIMEOUT; 
    } 
  }    
 ...
 
}

Why do I have these changes and I don't see anything in the release notes? They seem substantial enough...

SMain.2
Associate II

Sorry, I was wrong, I double checked with other colleagues and someone had done custom changes in stm32f4xx_hal_nand.h and stm32f4xx_hal_nand.c, so the files I was looking at were not original ST files. This is now corrected in a new version of the project...

TDK
Guru

Those changes are not in the GitHub repo, or anywhere else on GitHub.

0693W00000KciQTQAZ.png 

As for why not everything makes it into the release notes, that's just the way it is and always has been. I would recommend doing a diff whenever you upgrade and upgrade only when necessary and not simply when it's available.

If you feel a post has answered your question, please click "Accept as Solution".
vladsol2009
Associate II

Well... That's a problem with NAND Flashafter the update from 1.26.2 to 1.27 and newer (1.28) when the project is generated by CubeMX. Just crashing in HardFault, because, with the same cubemx configuration..
deviceaddress = 0x70000000 prior to 1.27 and 0x80000000 after the update.