Skip to main content
Associate II
August 28, 2024
Question

STM32H7S3L8 - Is there any way to set option byte XSPI2_HSLV through software.

  • August 28, 2024
  • 1 reply
  • 757 views

I want to set XSPI2_HSLV option byte through software , is there any way to do it or i have to use stm32cubeprogrammer only to Enable it.

Device = STM32H7S3L8 .

This topic has been closed for replies.

1 reply

ST Technical Moderator
August 28, 2024

Hi @AnoopYadav 

The XSPI2_HSLV can be done by user code as described in RM0477 section 5.4.3 Option byte words modification / Changing option byte words. VDDIO_HSLV option bit is also required with XSPI2_HSLV.

The flash driver provide the following HAL API that can be used. 

 

/**
 * @brief Program Option bytes.
 * @param pOBInit pointer to an FLASH_OBInitStruct structure that
 * contains the configuration information for the programming.
 *
 * @note To configure any option bytes, the option lock bit OPTLOCK must be
 * cleared with the call of HAL_FLASH_OB_Unlock() function.
 * @note New option bytes configuration will be taken into account in two cases:
 * - after an option bytes launch through the call of HAL_FLASH_OB_Launch()
 * - after a power reset (BOR reset or exit from Standby/Shutdown modes)
 *
 * @retval HAL Status
 */
HAL_StatusTypeDef HAL_FLASHEx_OBProgram(const FLASH_OBProgramInitTypeDef *pOBInit)

 

  • Note 1: This API will reset the device at the end to ensure the programming of the Option byte. To avoid a recall to the API after reset, you may need to test that the value of the option bit is not set before calling this API
  • Note2: Using CubeMx you need to insert this in the code for modifying HSLV option bit into the boot project, before any configuration of XSPI2. 

Best regards