Skip to main content
Visitor II
March 15, 2022
Question

STM32CubeF4: changes for HAL NAND in version 1.27?

  • March 15, 2022
  • 5 replies
  • 2021 views

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? 

    This topic has been closed for replies.

    5 replies

    Super User
    March 15, 2022

    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.

    SMain.2Author
    Visitor II
    March 15, 2022

    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.2Author
    Visitor II
    March 15, 2022

    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...

    Super User
    March 15, 2022

    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.

    Visitor II
    January 3, 2024

    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.