STM32L5 - Single Bank Flash Mode
I'm attempting to switch to single-bank flash mode on an STM32L562ZET6Q (512k Flash), but so far I've been unable to get the Flash OPTR to operate as the reference manual claims.
I used the normal process for modifying the OPTR:
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
HAL_FLASHEx_OBGetConfig(&flash_ob);
flash_ob.OptionType = OPTIONBYTE_USER;
flash_ob.USERType = OB_USER_DBANK;
flash_ob.USERConfig = OB_DBANK_128_BITS;
HAL_FLASHEx_OBProgram(&flash_ob);
HAL_FLASH_OB_Launch();
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();This, however, did not change the Flash OPTR on the next boot. I looked into it a bit more and discovered that the FLASH_OB_UserConfig function in stm32l5xx_hal_flash_ex.c doesn't have any code to handle the DBANK bit. I searched the entire stm32l5 HAL codebase and couldn't find anywhere OB_USER_DBANK is actually referenced (except for where it's defined).
Is there another way I'm supposed to be setting the DBANK bit?
Thanks!