Let me be more specific here:
I am placing my boot loader code including Flash erase/write APIs generated by PE into FlexNVM region (>=0x1000000), separated from normal flash sect. I have a function called flash_entry(), in the map file, it's located at the following address:
.flash_operate
0x100000dc 0xac ./Sources/flash_init_HW.o
0x100000dc a_reset
0x10000120 flash_entry
Now from my app code, it attempts to enter boot loader mode by calling flash_entry(). Under debug mode, I can observe the disassembled branch instruction:
91 flash_entry();
0000f074: bl __flash_entry_veneer (0x177b0); 0x000177b0
the assembly code branches address 0x177b0, which clearly is NOT the correction location. Please note that the instruction refers __flash_entry_veneer instead of flash_entry
If another function that is also located in the FlexNVM sector calls flash_entry(), it works expected.
65 flash_entry(); // never returns!
1000011a: bl flash_entry (0x10000120); 0x10000120
Any suggestion what did I do wrong? Can caller from normal flash sector invoking function in the FlexNVM sector or vice versa?