2014-07-02 07:44 AM
I'm working with STM32F401C DISCO on IAR.
I'm trying to jump from code to the boot mode and my PC don't recognize the USB when I perform the jump.
When I perform the jump from HW pins the PC recognize the USB.
The code I used :
&sharpinclude ''stm32f401_discovery.h''
typedef void (*pFunction)(void);
&sharpdefine BOOTLOADER_ADDRESS (uint32_t)0x1FFF0000
pFunction Jump_To_BootLoader;
uint32_t JumpAddress;
int main(void)
{
JumpAddress = *(__IO uint32_t*) (BOOTLOADER_ADDRESS + 4);
Jump_To_BootLoader = (pFunction) JumpAddress;
RCC_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__set_PRIMASK(1);
__set_MSP(*(__IO uint32_t*) BOOTLOADER_ADDRESS);
Jump_To_BootLoader();
while (1);
}
#it''s-deja-vu-all-over-again2014-07-02 11:50 AM
https://community.st.com/0D50X00009Xkh7wSAB
Edit: Fixing DEAD LINK, original post from 2-July-2014
2014-07-03 01:42 AM
Hi,
I remarked the line://__set_PRIMASK(1);
and it's work.Is this the correct way to jump to boot mode?