Page 4 of 4

Re: Need to change Vector table Address

Posted: Sat Jun 06, 2020 11:12 am
by stevestrong
I have no idea if this is resetting or jumping to 8010000, the debugger should show you the stack pointer.

Re: Need to change Vector table Address

Posted: Sat Jun 06, 2020 11:44 am
by sankarAMP2
In keil
Registers window

Code: Select all

R0:0x08010145
R13(SP):0x20000458
in debugger window the pointer showing

Code: Select all

0x8010E62 421   CMP    r1,r4
I'm in very big confusion now, why it this bootloader is working with keil generated code not Arduino?

Re: Need to change Vector table Address

Posted: Sat Jun 06, 2020 1:08 pm
by stevestrong
You should track step by step with the debugger what is happening with Arduino generated code.
If the bootloader jumps to 0x8010xxxx address then it is the application which is faulty.

You could also compare the MAP files for the code generated with Keil and Arduino to figure out the difference.

Re: Need to change Vector table Address

Posted: Sat Jun 06, 2020 3:29 pm
by darkspr1te
It could be a module in arduino being enabled (eg usb) that might be conflicting with the bootloader , that is just a assumption thought.

Re: Need to change Vector table Address

Posted: Mon Jun 08, 2020 6:50 am
by sankarAMP2
thank you @stevestrong and @darkspr1te.
bootloader is jumping to 0x8010000 perfectly but application not going forward. I assume that the problem with arduino generated file.
Now I want to generate same simple blinky example in STM32CUBE IDE. I'm new to use this IDE.
I found linker file STM32F103RET6_FLASH.ld and I changed flash address there, Is that enough or need to change any other files?

Re: Need to change Vector table Address

Posted: Mon Jun 08, 2020 7:54 am
by stas2z
sankarAMP2 wrote:
Mon Jun 08, 2020 6:50 am
I found linker file STM32F103RET6_FLASH.ld and I changed flash address there, Is that enough or need to change any other files?
VECT_TAB_OFFSET inside the system_stm32f1xx.c

Re: Need to change Vector table Address

Posted: Mon Jun 08, 2020 8:08 am
by sankarAMP2
stas2z wrote:
Mon Jun 08, 2020 7:54 am
VECT_TAB_OFFSET inside the system_stm32f1xx.c
Thank you @stas2z
After changing flash address in both files, this blinky application generated in cude ide also not working with that bootloader. Bootloader might be buggy.. :roll:

Re: Need to change Vector table Address

Posted: Mon Jun 08, 2020 8:23 am
by stas2z
First check if your jump from bl is working properly, just flash generated bin to exact offset using cubeprog

Re: Need to change Vector table Address

Posted: Mon Jun 08, 2020 10:26 am
by sankarAMP2
Thank you every one for your great support.
Now its working fine.
bug in bootloader code only.
by commenting __set_MSP(*mcuFirstPageAddr); this line is going to work.