behnam9200
Newbie level 2

Hi guyz,
I've programmed a bootloader for STM32f103rbt6 and runs my application at address 0x8009000
bootloader jumps to app address and works fine.
but when I add RCC_Init() and initialize MicroSd memory in my bootloader project, the bootloader can not jump to 0x8009000
note that Initializing MicroSd send some commands via spi to configure it, not initializing SPI.
here's jumping code:
P.S: I dont know why below jump code doesnt work:
any idea?
best regards
I've programmed a bootloader for STM32f103rbt6 and runs my application at address 0x8009000
bootloader jumps to app address and works fine.
but when I add RCC_Init() and initialize MicroSd memory in my bootloader project, the bootloader can not jump to 0x8009000
note that Initializing MicroSd send some commands via spi to configure it, not initializing SPI.
here's jumping code:
Code:
typedef void __attribute__((noreturn)) (*exec)();
uint32_t *start ;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) APPLICATION_START_ADDRESS);
// jump to the new binary
start = (uint32_t*) (APPLICATION_START_ADDRESS + 4); // address of the reset vector for the new binary
((exec)(*start))();
P.S: I dont know why below jump code doesnt work:
Code:
typedef void (*pFunction)(void);
pFunction Jump_To_Application;
uint32_t JumpAddress;
JumpAddress = *(__IO uint32_t*) (APPLICATION_START_ADDRESS + 4);
/* Jump to user application */
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) APPLICATION_START_ADDRESS);
Jump_To_Application();
any idea?
best regards