Hi,
First of all, when you upload new application code to flash, the previous code are erased and updated with new code.
Regarding your code, it appears that the delay function is ambiguous, pls try to use the following code:
void msdelay(unsigned int time)
{
unsigned int i,j;
for(i=0; i<time; i++) {}
for(j=0;j <6002; j++) {}
}
or
void msdelay1(unsigned int time)
{
unsigned int i,j;
for(i=0; i<time; i++)
{
for(j=0;j <6002; j++)
{
__asm("nop");
}
}
}
do you know that MCU runs in different speed by observing the GPIO toggling in different frequency with the same code?
BR
XiangJun Rong