cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L562RETX bootloader problem

Ljunh.1
Associate II

I'm using the cubeide 1.6.1 version.

There's a problem with using the bootloader this time.

This is bootloader code

#define APPLICATION_ADDRESS    (uint32_t)0x08010000

typedef void (*pFunction)(void);

pFunction JumpToApplication;

uint32_t JumpAddress;

​int main(void)

{

 /* USER CODE BEGIN 1 */

 /* USER CODE END 1 */

 /* MCU Configuration--------------------------------------------------------*/

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */

 HAL_Init();

 /* USER CODE BEGIN Init */

 /* USER CODE END Init */

 /* Configure the system clock */

 SystemClock_Config();

 /* USER CODE BEGIN SysInit */

 /* USER CODE END SysInit */

 /* Initialize all configured peripherals */

 MX_GPIO_Init();

 MX_ICACHE_Init();

 MX_USART1_UART_Init();

 MX_RTC_Init();

 /* USER CODE BEGIN 2 */

 setvbuf(stdout, NULL, _IONBF,0);

 printf("\r\nstart!!!");

 Jump_to_app_flash();

 HAL_Delay(100);

}

void Jump_to_app_flash(void)

{

// HAL_RCC_DeInit();

// SysTick->CTRL=0;

// SysTick->LOAD=0;

// SysTick->VAL=0;

// __disable_irq();

// Jump to user application

JumpAddress = *(__IO uint32_t*)(APPLICATION_ADDRESS + 4);

JumpToApplication = (pFunction) JumpAddress;

// Initialize user application's Stack Pointer

__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);

JumpToApplication();

}

and

I changed the main code setting like this.

0693W00000HqSl7QAF.jpg0693W00000HqSlCQAV.jpg

I'm want to jump from 0x8000000 bootloader to 0x8010000 main firmware.

There's an error in the jump.

I downloaded the firmware with a cubeprogrammer.

In this case, how should I solve this?

3 REPLIES 3
Shwan.1
Associate

I have same problem.

I’ d be grateful if you could do something to expedite a reply to my query.

Arnaud Joubert
Associate II

UP !

Arnaud Joubert
Associate II

Hi,

Try to set Jump variables in "static" like this:

static pFunction Jump_To_Application;
static uint32_t JumpAddress;

I had the same issue using STM32L562VET6 and ARM Compiler V6 on Keil.