Exploring the IAP jump failure case of STM32H7 chip

With STM32 user feedback, he wrote the user boot program [BOOT CODE] and the application program [APP CODE] using STM32H750VB. According to the data sheet description, the STM32H750 has 128K Bytes of on-chip flash, and the address is from 0x0800 0000~~0x0801 FFFF. He places the user bootloader at 0x0800 0000~0x0800 2FFF and the application is placed at 0x08003000~0x0801 FFFF. But when he designed according to such a storage allocation, he found that there was always no way to jump from the BOOT area to the APP area.

Based on the feedback information of the user, he was given some reminders, such as the interrupt vector table positioning problem, the customer said that he had noticed that the code should be no problem. I have found a verification board for the STM32H743 board on the customer feedback. It is found that there is no abnormality in the jump from the BOOT area to the APP area, so how can the customer have problems?

Review the feedback from the customer email again. The default internal SRAM area used by him is AXI SRAM, the address range is 0x24000000 --0x2407FFFF, which is the A area in the table below, and the default internal SRAM area I use is DTCM SRAM, and the address range is 0x20000000 -0x2001FFFF, which is the following table. Zone B.

Is this difference leading to different results of the jump? Of course, there are still differences in the use of these two SRAM areas.

I tried to test the default SRAM area of the test project from TCM RAM to AXI SRAM. Really can't realize the jump from BOOT area to APP area! It seems that the jump failure has something to do with choosing this default SRAM area. That is to say, when I use DTCM RAM by default, the jump is normal. If I use AXI SRAM by default, the jump will fail.

We know that the STM32H7 series chips support D-CACHE/I-CACHE. Specifically, if you use AXI SRAM, you will often use D-CACHE. D-CACHE is also enabled in our project code. If for this reason, if you turn off D-CACHE before doing a jump operation, you should be able to achieve a normal jump. So the code is slightly adjusted, in fact, it is added a sentence to close the D-CACHE code. 

Test again, even if you use AXI RAM as the default memory space, you can reliably jump to the APP area from the user BOOT area, which is perfect.

This is related to the access characteristics and D-Cache related knowledge of different memory areas inside the STM32H7 series chip, and the details are quite a lot. If you are interested, you can check the relevant technical manuals for further understanding and exploration. There is time, and the follow-up will be further exchanged here. At this time, share the application case, and do an application reminder.