Home > other >  STM32 IAP jump run after the APP, please help me analyze the great god, online etc.!!!!!!
STM32 IAP jump run after the APP, please help me analyze the great god, online etc.!!!!!!

Time:11-14

Currently doing a STM32 positioning module of IAP function of remote upgrade, the boot after the jump to the APP, the APP is only carried out the main function began to a piece of code is up in the, window10 on open the usb serial port also become unknown usb device:

The boot code is as follows:
 
Int main (void)
{
Under-16 len=0, data_len=0;
Int ret=0, I=0, n=0;
U32 offset=0;

USB_Config ();
USB_Cable_Config (ENABLE);
//Init_Image_tx ();
//led_on (LED_ALL);
While (1)
{
Len=0;
Memset (UWBRxBuff, 0 x0, sizeof (UWBRxBuff));
Len=USB_RxRead (UWBRxBuff, sizeof (UWBRxBuff));
If (UWBRxBuff [0]==0 x19 & amp; & UWBRxBuff [1]==0 xf1)
{
X080005000 jumpToApp (0);
return 0;
}
The else
{
N=sprintf (SendBuff, "waite for jump command!! ");
USB_TxWrite (SendBuff, n);
}
Sleep(1000);

}
}

Void jumpToApp (uint32_t appxaddr)
{
Int n=0;
N=sprintf ((char *) & amp; SendBuff [0], "% s \ r \ n", "Reay... ");
USB_TxWrite (SendBuff, n);
N=sprintf ((char *) & amp; SendBuff [0], "addr: 8 x % \ r \ n", appxaddr);
USB_TxWrite (SendBuff, n);
If (((* (volatile uint32_t *) appxaddr) & amp; 0 x2ffe0000)==0 x20000000)
{
N=sprintf ((char *) & amp; SendBuff [0], "% s", "Go! \r\n");
USB_TxWrite (SendBuff, n);
/* Jump to the user application */
JumpAddress=* (volatile uint32_t *) (ApplicationAddress + 4);
Jump_To_Application=(pFunction JumpAddress);
N=sprintf ((char *) & amp; SendBuff [0], "JumpAddress: 8 x % \ r \ n", JumpAddress);
USB_TxWrite (SendBuff, n);
/* the Initialize the user application 's Stack Pointer */
//USB_Cable_Config (DISABLE);
//INTX_DISABLE ();
__disable_irq ();
SCB - & gt; VTOR=FLASH_BASE | ApplicationAddress;
Appxaddr __set_MSP (* (volatile uint32_t *));
Jump_To_Application ();
}
}



The main APP code
 
Int main (void)
{
Volatile under-16 adcx;

INTX_DISABLE ();
SCB - & gt; VTOR=FLASH_BASE | 0 x00005000ul;
USB_Config ();
USB_Cable_Config (ENABLE);
Uart_init (UART_BAUDRATE);
GPIO_Configuration ();//PB6 PB7 LED0-1
SPI_Configuration ();/* SPI1, CS - & gt; GPIOA PIN4/5/6/7 */
Peripherals_init ();
INTX_ENABLE ();
//Flash_Configuration ();
Led_on (LED_ALL);
Printf (" 0123456789 \ r \ n ");
Printf (" abcdefghjk \ r \ n ");
Printf (" XXXXXXXXXX \ r \ n ");//boot after the jump, from the serial port output stopped here, behind Display_UWBInfo (1); There is also a printf output, but there is no printed
//RTC_Alarm_Configuration ();//Init RTC ALARM
//MYDMA_Config (DMA1_Channel4, (u32) & amp; USART1 - & gt; DR, (u32) DMA_USART_Buff, 3000);
//USART_DMACmd (USART1, USART_DMAReq_Tx, ENABLE);//DMA
Display_UWBInfo (1);
WaittingForCleConfig (0);

return 0;
}


The boot and APP independent flash can be normal operation; Sent by xcom jump command, the print on the serial port on the jump after the app has output, is given to illustrate the success of the jump;
APP running on, after a period of USB virtual serial port on the window10 also properly identified, please help to analysis and see what reason, thank you!!!!!

CodePudding user response:

Before you jump to note to reset all the used resources, especially the interrupt,

CodePudding user response:

Which chip is used?

CodePudding user response:

To analyze the hanging in what position, in the analysis what is the code, then find the solution
  • Related