2024-05-08 04:27 AM
Hello,
I'm currently working with the STM32G474RE microcontroller and aiming to transition from the standard dual bank mode to the single bank mode.
However, I've encountered an issue during this transition. When switching the bank mode, the read width changes from 64 bits to 128 bits. This change in read width is leading to data misalignment problems so when the HAL launch function responsible for loading and resetting the option byte after the bank mode switch is called, the program seems to hang, suggesting possible damage.
Could you please provide guidance on how to address these issues and ensure a smooth transition to single bank mode without causing data misalignment or program damage?
Thank you for your assistance.
2024-06-04 01:25 AM
Hello @ssmrabhi
ST-LINK utility is no longer the recommended tool to use. Could you try using STM32CubeProgrammer and share the results here.
By definition, the dual bank Option Bit will surely change the flash memory (bank used, sector sizes or indexes...). Is there a reason why you need to program the chip then change the value for that Option Bit ? Could you explain your exact use case ?
Thanks,
Aziz
2024-06-11 07:52 AM
Hello thank you for replying
I am experiencing the same missalignement when viewing the flash in the stm programmer. This misalignment seems to be related to loading changes to the option bytes with HAL_FLASH_OB_Launch rather than switching between dual-bank or single-bank modes. For example, the issue persists after setting write protection, read protection or setting the nboot bits which all require loading the changes to the option bytes using HAL_FLASH_OB_Launch.
2024-06-13 02:32 AM
Hello,
Yes, to apply the changes to option bytes, that is the API to call. Refer to modifying option bytes section in the reference manual. My question is why do you need to change option bytes interfering with flash organization from your application ?. My suggestion is to :
1) Set your Option Bytes (beside write and read protection)
2) Download your app
3) Set your read/write protections (WRP and RDP)
Aziz