Skip to main content
Mat1
Associate III
September 20, 2023
Solved

Branch with link instruction doesn't jump to main

Hi,

I'm working with a STM32G491KEU (512KB Flash).

I use a custom bootloader so the startup in the printsreen is from the application. The MCU will first start in the custom bootloader and then it should change to the application.

It reaches the startup_stm32g491keux.s and should branch to the mainApp with Address 0x800fcdc. The program counter is at 0x80131e2. And then it happens and it jumps wrong.

Is that jump too long for "bl"? My answer: branch can work with MB ranges should not be an issue for the 512KB.

Mat1_1-1695223672584.png

Todays Update

There is something strange happening. If I have only an empty main (the same project) I get a very different disassembly. For me it looks like one is in thumb mode and the other one is ARM assembler.

Mat1_0-1695297751792.png

Any ideas?

 

 

 

This topic has been closed for replies.
Mat1
Mat1Best answer
Associate III
September 21, 2023

The problem I found in the custom bootloader. Data wasn't written correctly to flash memory.

1 reply

Mat1
Mat1AuthorBest answer
Associate III
September 21, 2023

The problem I found in the custom bootloader. Data wasn't written correctly to flash memory.