Tool/software:
I have a bootloader running from Flash. At the end, this Bl chooses one of the two possible applications (A or B) in flash and jumps to it. The application should run from RAM.
Before the jump, these things are done in a sequence (last things done in the BL):
wd_disable > init_ram (clearing whole RAM) > copy the selected application from Flash to RAM (A or B) > branch to the BEGIN address in Flash for the selected application (A or B)
this way, the selected application will start running (From RAM)
When first implemented this, I decided to run the BL itself from Flash instead of RAM, because I thought if running from RAM, the BL itself would crash when I clear the whole RAM at the end, before it could successfully jump to the selected application A or B. I have had very strange problems when the BL runs from Flash (explained here and here). Sometimes it works fine, sometimes I get strange behavior which happens randomly.
I tried running the BL from RAM instead, and saw that unlike what I expected, it works fine.
Now my question is this: Can this be safe to have this structure, and run the BL from RAM, and not from Flash? If yes, that could be a solution for me. But if you say it might not always work properly, I know that I have to discard this case (BL running from RAM) and focus on running the BL from Flash and solving the issues that I got in that case.
I should add that the sequence done at the end of BL (right before jump) mentioned above (clear RAM + copy selected application to RAM + branch into it's beginning address in Flash) are done in some assembly files that are linked to Flash (in the flash area dedicated for BL), and even when I tried running BL from RAM, I still kept those linked to Flash.