做擦除操作时,在设备不断的发送给pc等待时间(擦除8k扇区时是1s,32k时是2s,64k时是4s)时截的图。此时iap程序运行在程序最后的语句while(1);长时间没有得到请求DFU_GETSTATUS,程序进不了下面的擦除操作。 void DFU_Status_Out (void) { DEVICE_INFO *pInfo = &Device_Info; u32 i,Addr,DATA; if(pInfo->USBbRequest == DFU_GETSTATUS) { if(DeviceState ==STATE_dfuDNBUSY) { if (wBlockNum == 0 ) /* Decode the Special Command*/ { if ( (Load_Buffer[0] == CMD_GETCOMMANDS) &&(wlength == 1) ) { } else if (( Load_Buffer[0] == CMD_SETADDRESSPOINTER )&&(wlength == 5)) { Pointer = Load_Buffer[1]; Pointer += Load_Buffer[2] << 8; Pointer += Load_Buffer[3] << 16; Pointer += Load_Buffer[4] << 24; } else if (( Load_Buffer[0] == CMD_ERASE )&&(wlength == 5)) { Pointer = Load_Buffer[1]; Pointer += Load_Buffer[2] << 8; Pointer += Load_Buffer[3] << 16; Pointer += Load_Buffer[4] << 24; if ( Pointer < 0x60000000 ) /* Internal Flash */ { Internal_FLASH_WritePrConfig(Internal_FLASH_SectorMask(Pointer),DISABLE); Internal_FLASH_SectorErase(Internal_FLASH_SectorMask(Pointer)); } |