2018-11-30 01:10 AM
I have a custom bootloader in sector 0,the app created in .net and it communicates with MCU through VIRTUAL COMM POT (HIGH SPEED), when the app starts if its no updates for firmware it jumps to the sector2 where main programm is based. THis works perfect in windows 10. But when i try it in XP or 7, the bootloader part is loading fine and connects with comm port and responds but after jumping to sector2 i can not recconect to the VCP com port. i have an exception that comm port doesnt exist, while it is. I can see it on device manager. I have no idea whats the problem. Proper stm for VCP drivers were installed.
this is mine config of VCP:
#define CDC_IN_EP 0x81 /* EP1 for data IN */
#define CDC_OUT_EP 0x01 /* EP1 for data OUT */
#define CDC_CMD_EP 0x82 /* EP2 for CDC commands */
/* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */
#define CDC_DATA_HS_MAX_PACKET_SIZE 64 /* Endpoint IN & OUT Packet size */
#define CDC_DATA_FS_MAX_PACKET_SIZE 64 /* Endpoint IN & OUT Packet size */
#define CDC_CMD_PACKET_SIZE 8 /* Control Endpoint Packet size */
#define USB_CDC_CONFIG_DESC_SIZ 67
#define CDC_DATA_HS_IN_PACKET_SIZE CDC_DATA_HS_MAX_PACKET_SIZE
#define CDC_DATA_HS_OUT_PACKET_SIZE CDC_DATA_HS_MAX_PACKET_SIZE
#define CDC_DATA_FS_IN_PACKET_SIZE CDC_DATA_FS_MAX_PACKET_SIZE
#define CDC_DATA_FS_OUT_PACKET_SIZE CDC_DATA_FS_MAX_PACKET_SIZE
this is mine jumping code:
if (UserRxBufferFS[0] == 0x82) // accept CMD from PC
{
bootloader_jump_to_user_app();
}
void bootloader_jump_to_user_app(void)
{
void (*app_reset_handler)(void);
uint32_t msp_value = *(volatile uint32_t *) FLASH_SECTOR2_BASE_ADDRESS;
__set_MSP(msp_value);
uint32_t resethandler_address = *(volatile uint32_t*) (FLASH_SECTOR2_BASE_ADDRESS + 4);
app_reset_handler = (void*) resethandler_address;
app_reset_handler();
}
2018-12-01 09:14 PM
no any ideas?