cancel
Showing results for 
Search instead for 
Did you mean: 

jump from bootloader to application is not working in SDRAM in STM32H7

Rajesh Kannan
Associate II

Hi ,

I am using bootloader to jump application using QSPI .It is jumping proper in QSPI loader.

I faced some timing issue in QSPI. I planned to use SDRAM or internal SRAM1 (0X30000000).

In my MCU STM32H750XBH6U single core M7.

In bootloader copied image from QSPI to SDRAM. I checked CRC in SDRAM bank1 (0xC0000000) and call jump function.

It is not jumping to the address .I added LED ON in SystemInit() function.

I can able jump AXI SRAM 0x24000000 .

I couldn't jump SDRAM bank1 (0xC0000000) or SRAM1(0x30000000).

How to load application from boot loader using SDRAM bank1?

1 ACCEPTED SOLUTION

Accepted Solutions

Check what the objection is..

Perhaps look at

STM32Cube_FW_H7_V1.8.0\Projects\STM32H743I-EVAL\Examples\BSP\Src\main.c

/**

 * @brief Configure the MPU attributes as Write Through for SDRAM.

 * @note  The Base Address is SDRAM_DEVICE_ADDR.

 *     The Region Size is 32MB.

 * @param None

 * @retval None

 */

static void MPU_Config(void)

{

 MPU_Region_InitTypeDef MPU_InitStruct;

 /* Disable the MPU */

 HAL_MPU_Disable();

 /* Configure the MPU attributes as WT for SDRAM */

 MPU_InitStruct.Enable = MPU_REGION_ENABLE;

 MPU_InitStruct.BaseAddress = SDRAM_DEVICE_ADDR;

 MPU_InitStruct.Size = MPU_REGION_SIZE_32MB;

 MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

 MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

 MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;

 MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;

 MPU_InitStruct.Number = MPU_REGION_NUMBER0;

 MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;

 MPU_InitStruct.SubRegionDisable = 0x00;

 MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

 HAL_MPU_ConfigRegion(&MPU_InitStruct);

 /* Configure the MPU attributes as WT for NOR */

 MPU_InitStruct.Enable = MPU_REGION_ENABLE;

 MPU_InitStruct.BaseAddress = NOR_DEVICE_ADDR;

 MPU_InitStruct.Size = MPU_REGION_SIZE_16MB;

 MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

 MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

 MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;

 MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;

 MPU_InitStruct.Number = MPU_REGION_NUMBER1;

 MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;

 MPU_InitStruct.SubRegionDisable = 0x00;

 MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

 HAL_MPU_ConfigRegion(&MPU_InitStruct);

 HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

5 REPLIES 5
MM..1
Chief II

You debug this ? Isnt your application selferased after start ?

>>It is not jumping to the address .

I'm sure it's jumping where ever you tell it to go.

Where does it end up? Where does the debugger suggest it went? Did you step it into your code?

The Hard Fault Handler? Do have that written to provide any actionable data?

Could be a MPU executable setting.

As you've said the data CRC's properly you could perhaps disassemble and review what the linker output, and if that's consistent with code bound to execute in the 0xC0000000 region.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

HI Tesla,

Thanks for reply,

I did step in my code. It is going to Hard Fault in bootloader.

I checked map file linked 0xc0000000 and offset.

I will check disassemble linker output.

Check what the objection is..

Perhaps look at

STM32Cube_FW_H7_V1.8.0\Projects\STM32H743I-EVAL\Examples\BSP\Src\main.c

/**

 * @brief Configure the MPU attributes as Write Through for SDRAM.

 * @note  The Base Address is SDRAM_DEVICE_ADDR.

 *     The Region Size is 32MB.

 * @param None

 * @retval None

 */

static void MPU_Config(void)

{

 MPU_Region_InitTypeDef MPU_InitStruct;

 /* Disable the MPU */

 HAL_MPU_Disable();

 /* Configure the MPU attributes as WT for SDRAM */

 MPU_InitStruct.Enable = MPU_REGION_ENABLE;

 MPU_InitStruct.BaseAddress = SDRAM_DEVICE_ADDR;

 MPU_InitStruct.Size = MPU_REGION_SIZE_32MB;

 MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

 MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

 MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;

 MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;

 MPU_InitStruct.Number = MPU_REGION_NUMBER0;

 MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;

 MPU_InitStruct.SubRegionDisable = 0x00;

 MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

 HAL_MPU_ConfigRegion(&MPU_InitStruct);

 /* Configure the MPU attributes as WT for NOR */

 MPU_InitStruct.Enable = MPU_REGION_ENABLE;

 MPU_InitStruct.BaseAddress = NOR_DEVICE_ADDR;

 MPU_InitStruct.Size = MPU_REGION_SIZE_16MB;

 MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

 MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

 MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;

 MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;

 MPU_InitStruct.Number = MPU_REGION_NUMBER1;

 MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;

 MPU_InitStruct.SubRegionDisable = 0x00;

 MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

 HAL_MPU_ConfigRegion(&MPU_InitStruct);

 HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks Tesla,

It is working fine.