cancel
Showing results for 
Search instead for 
Did you mean: 

Branch with link instruction doesn't jump to main

Mat1
Associate III

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?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Mat1
Associate III

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

View solution in original post

1 REPLY 1
Mat1
Associate III

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