Skip to main content
Explorer
April 15, 2024
Solved

Nucleo-H7S3L8 Booting to Application via Bootloader

  • April 15, 2024
  • 6 replies
  • 7609 views

Hi all,

I have a Nucelo-H7S3L8 board running the demo application. The project has 2 applications (boot, and application). The boot is supposed to jump to the application, which is located in the external MX25UM25645GXDI00 memory.

 

However when debugging the boot application the BOOT_Application() function returns "BOOT_ERROR_MAPPEDMODEFAIL". My configuration for the MX25UM25645GXDI00 is attached to this post.

Any hints or guidance will be greatly appreciated.

    This topic has been closed for replies.
    Best answer by KDJEM.1

    Hello @bashira@Malvi2024 and @atosun ,

    Thank you for this clarification.

    Could you please try to use the STM32CubeProgrammer to check the value of XSPI2-HSLV option byte.

    KDJEM1_0-1713450368684.png

    To achieve higher frequency the XSPI2-HSLV must be "Checked" as mentioned in the readme.

    KDJEM1_1-1713451422582.png

    Please let me know if the issue is solved or not.

    Thank you for your contribution.

    Kaouthar

    6 replies

    Technical Moderator
    April 15, 2024

    Hello @bashira and welcome to the Community :),

    May Template_XIP example can help you.

    For that, I advise you to take a look at this example and get inspired from the .ioc file and the readme.

    I hope this help you.

    Thank you.

    Kaouthar

    bashiraAuthor
    Explorer
    April 15, 2024

    Hi Kaouthar,

    Thanks for your replay.


    I have had a chance to match my settings in the ioc file with the "Template_XIP" ioc settings. Unfortunately, I have had no luck with my problem. I am debugging the external memory with the  "ExtMem_manager" application but no luck.

    Technical Moderator
    April 17, 2024

    Hi @bashira ,

    Could you please check "MX25UW25645GXDI00" memory configuration.

    KDJEM1_0-1713358092778.png

    Are you able to run this example Template_XIP ?

    Note that, this project is targeted to run on STM32H7S3xx device on NUCLEO-H7S3L8 board from STMicroelectronics. 

    This project runs from the external Flash memory. It is launched from a first boot stage and inherits from this boot project configuration (caches, MPU regions [regions 0 and 1], system clock at 600 MHz and external memory interface at the highest speed). Note that the boot part is automatically downloaded from the IDE environment via the board project Templates/Template_XIP/Binary/Boot_XIP.hex file.

    Thank you.

    Kaouthar

     

     

    Visitor II
    April 17, 2024

    I must say that I have found the same problem with Template_XIP.
    Debugging boot project, the function BOOT_Application() fails with BOOT_ERROR_MAPPEDMODEFAIL.
    I have seen that this comes from HAL_XSPI_Command() making some checks, then setting hxspi->ErrorCode = HAL_XSPI_ERROR_INVALID_SEQUENCE and returning HAL_ERROR.
    Additionally I have also tried to replace hxspi2.Init.MemorySize = HAL_XSPI_SIZE_32GB with HAL_XSPI_SIZE_256MB (256Mbits), but no luck.

    bashiraAuthor
    Explorer
    April 17, 2024

    I can confirm this @Malvi2024 

    The function in question is:
    HAL_StatusTypeDef HAL_XSPI_Command(XSPI_HandleTypeDef *hxspi, XSPI_RegularCmdTypeDef *const pCmd, uint32_t Timeout)

    bashira_0-1713371185724.png

    The state gets set to 512 somehow. I have not had time to debug this further, but I know that state is NOT valid after the init function MX_EXTMEM_MANAGER_Init()

     

    @KDJEM.1I just made a new project for the Nucleo-H7S3L8 board. Below is how everything is configured. I have not changed anything.

    bashira_1-1713371474961.png

     

    bashira_2-1713371499879.png



    bashira_3-1713371518134.png


    Thank you for the help.

    bashiraAuthor
    Explorer
    April 17, 2024

    @Malvi2024I just had a little debugging session and I found out that the invalid state is set at this point:

    bashira_0-1713374217606.png

    inside the HAL_XSPI_Read() function there is a XSPI_Command() followed by XSPI_Recieve(). The recieve function seems to timeout.

    bashira_1-1713374374378.png

     

    Here is my clock config.

    bashira_2-1713374515285.png

     

    bashira_3-1713374548460.png


    Not sure, how to move forwards.

    Thanks for the help guys.

     

    Visitor II
    April 17, 2024

    I have the same board and encountered the same problem @bashira described.

     

    Help would be massively appreciated.

    KDJEM.1Answer
    Technical Moderator
    April 18, 2024

    Hello @bashira@Malvi2024 and @atosun ,

    Thank you for this clarification.

    Could you please try to use the STM32CubeProgrammer to check the value of XSPI2-HSLV option byte.

    KDJEM1_0-1713450368684.png

    To achieve higher frequency the XSPI2-HSLV must be "Checked" as mentioned in the readme.

    KDJEM1_1-1713451422582.png

    Please let me know if the issue is solved or not.

    Thank you for your contribution.

    Kaouthar

    bashiraAuthor
    Explorer
    April 18, 2024

    Hi Kaouthar,

    That definitely seemed to have solved the problem for me. I will do some intensive testing later on.

    Thank you very much for the help :)