Unable to Jump from Bootloader to Application loaded into SDRAM
Hi,
My board consists of stm32h733 that interfaces SDRAM via FMC. I want to execute code from SDRAM. Code is loaded from external flash(OCTOSPI) to SDRAM at address 0xc0700000.
But running the code from this region causes hard-fault disabling the Debug Port. After this I'm unable to flash firmware into the hardware. I have to bring board into "connection under reset" by connecting BOOT0 to 3.3v and NRST to GND. I have tried with multiple test firmware but always got into hard-fault. Why MCU disables, it's debug port?
While debugging in the disassembly I can execute firmware running from SDRAM one by one line, but at some point code hard-fault, causing it to stuck into the above told situation. Here is the MPU config for SDRAM;
/* Configure the MPU attributes for SDRAM */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0xC0000000; // Start address of SDRAM Bank 1
MPU_InitStruct.Size = MPU_REGION_SIZE_8MB;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER3; // MPU region number
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
Why am I not able to execute code from SDRAM after jump from bootloader???
Thanks,
Umair
