2015-03-31 08:57 AM
Hi I am trying to jump to the bootloader on F429z with using B0 B1 pins
using the code belowbut when i send 0x7f on uart1 (from my remote client app) I get no response back at allI have confirmed Buad rate 57600 8e1 with logic analyser.The Stack Pointer is set to the Value( 0x20002d40) I see in address 0x1FFF0000. Is this correct?Any Ideas to why i get no response?Thanksvoid (*SysMemBootJump)(void);void BootLoaderInit(uint32_t BootLoaderStatus){SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1FFF0004)); if(BootLoaderStatus ==1) { //Shut down any tasks running __set_PRIMASK(1); //Disable Interupts HAL_UART_MspDeInit(&UartHandle); HAL_RCC_DeInit(); SysTick->CTRL = 0; //reset systic timer SysTick->LOAD = 0; SysTick->VAL = 0; __set_MSP(0x20002d40); //Set the main stack pointer to its default values SysMemBootJump(); while(1);} #bootloader-started-by-software #groundhog-day2015-04-03 09:00 AM
Hi Edje
The Boards Usart is normally in use to an on board linux module.It works fine When I jump to bootloader the Logic analyser sees High so pullups are activeI wonder if the Usart is still being controlled by the DMA (normal application operation) when I jump to bootloader.even though I do HAL_UART_MspDeInit(&UartHandle);before jumpingThanks2015-04-03 09:25 AM
2015-04-04 09:55 AM
Got it working
In order to get a ''close to reset'' state and run the bootloader , run the function ''BootLoaderInit()''void BootLoaderInit(void){ (*(__IO uint32_t *) (BKPSRAM_BASE + 4)) = 0xDEADBEEF; // flag that will be readable after reboot // Reset the processor NVIC_SystemReset();}main(){// read backupsram flag if need to enter bootloader __PWR_CLK_ENABLE(); __BKPSRAM_CLK_ENABLE(); HAL_PWR_EnableBkUpAccess(); uint32_t bt; bt = (*(__IO uint32_t *) (BKPSRAM_BASE + 4)) ; if ( bt == 0xDEADBEEF ) { (*(__IO uint32_t *) (BKPSRAM_BASE + 4)) = 0xCAFEFEED; // Reset our trigger void (*SysMemBootJump)(void); __SYSCFG_CLK_ENABLE(); SYSCFG->MEMRMP |= SYSCFG_MEMRMP_MEM_MODE_0 ; uint32_t p = (*((uint32_t *) 0x1fff0000)); /// debug p returns 0x20002d40 0x1fff0000 is the bootloader rom start address __set_MSP(p); //Set the main stack pointer to its defualt values SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1FFF0004)); // Point the PC to the System Memory reset vector (+4) SysMemBootJump(); while (1); }//continue to normal main init and applicationThanks all for your help