Issue using the HAL internal flash memory interface when leveraging a bootloader and firmware memory structure.
I am currently using an STM32L452 MCU that operates using a custom bootloader and firmware package for operation. I have leveraged the bootloader on other projects before, so I knew (or at least thought i knew) it was solid.
I'm learning that when i attempt to use the built in HAL flash memory writing functions (such as HAL_FLASH_Program()), after my bootloader has launched and jumped memory locations to the firmware address, any write to flash memory in the firmware operation fails. (error codes detailed at bottom of message).
I know that if i remove the bootloader entirely, I have no issues writing to flash memory using the interface in the firmware. I also know that if I don't do anything in the bootloader (literally launch the startup script and then jump to the firmware image immediately), this issue where the flash write fails still occurs. This tells me the issue isn't with any code in the bootloader or unintentional memory writes or anything, but the project itself and its interaction with the firmware in memory....which seems crazy and weird to me.
If it helps, the three flash memory errors I get from the MCU Flash-SR register after attempting to write are FLASH_FLAG_PROGERR, FLASH_FLAG_PGAERR, and FLASH_FLAG_PGSERR.
Any and all thoughts are appreciated!
