Hi Jan
Thank you very much for your patience.
I have checked USB ISP enter code again, it's wrong, I modified it again, it works now.
From user manual, Reinvoke ISP input is:Command code: 57 (decimal), Param0: Pointer to ISP parameter structure. See Table 78.
You and I all write the wrong code, param0 is the pointer to ISP parameter structure, not the data directly.
Now, I modified the code like this:
status_t Chip_IAP_ReinvokeISP( void )
{
uint32_t command[9], result[4];
uint8_t Param[8];
uint8_t *p=Param;
Param[0] = 0;
Param[1] = 8; //usb 8// 6 usart
Param[2] = 0;
Param[3] = 0;
Param[4] = 0;
Param[5] = 0;
Param[6] = 0;
Param[7] = 8;
command[0] = kIapCmd_FLASHIAP_ReinvokeISP; //57
command[1] = (uint32_t )p;
iap_entry(command, result);
return translate_iap_status(result[0]);
}
Now, I can ener the USB ISP mode now, is the same function as the ISP1 pin enter.
After you call Chip_IAP_ReinvokeISP, please also connect a USB port in J3, then you will find a device named as: CRP DISABLED
Then open CRP DISABLED, delete the firmware.bin file, change your own application bin file as firmware.bin, and copy it to CPR DISABLED, press the reset button.
You will find the application code work.
Please try it on your side.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------