Line 438... |
Line 438... |
438 |
|
438 |
|
439 |
bAuto = true; |
439 |
bAuto = true; |
440 |
|
440 |
|
441 |
// BOOT0 = High |
441 |
// BOOT0 = High |
442 |
STBL_SetDtr(TRUE); |
442 |
STBL_SetDtr(TRUE); |
443 |
Sleep(50); |
443 |
Sleep(100); |
444 |
// Reset = Low |
444 |
// Reset = Low |
445 |
STBL_SetRts(TRUE); |
445 |
STBL_SetRts(TRUE); |
446 |
|
446 |
|
447 |
Sleep(50); |
447 |
Sleep(100); |
448 |
|
448 |
|
449 |
// Reset = High |
449 |
// Reset = High |
450 |
STBL_SetRts(FALSE); |
450 |
STBL_SetRts(FALSE); |
- |
|
451 |
Sleep(100); |
- |
|
452 |
|
451 |
|
453 |
|
452 |
STBL_SetDtr(FALSE); |
454 |
STBL_SetDtr(FALSE); |
453 |
Sleep(100); |
455 |
Sleep(100); |
454 |
COM_Close(); |
456 |
COM_Close(); |
455 |
COM_Open(); |
457 |
COM_Open(); |
456 |
|
458 |
|
457 |
STBL_SetDtr(TRUE); |
459 |
STBL_SetDtr(TRUE); |
458 |
Sleep(50); |
460 |
Sleep(100); |
459 |
// Reset = Low |
461 |
// Reset = Low |
460 |
STBL_SetRts(TRUE); |
462 |
STBL_SetRts(TRUE); |
461 |
|
463 |
|
462 |
Sleep(50); |
464 |
Sleep(100); |
463 |
|
465 |
|
464 |
// Reset = High |
466 |
// Reset = High |
465 |
STBL_SetRts(FALSE); |
467 |
STBL_SetRts(FALSE); |
- |
|
468 |
Sleep(100); |
466 |
|
469 |
|
467 |
STBL_SetDtr(FALSE); |
470 |
STBL_SetDtr(FALSE); |
468 |
Sleep(500); |
471 |
Sleep(500); |
469 |
//Sleep(1000); |
- |
|
- |
|
472 |
|
470 |
write_debug_info("Setting device to BOOT0", 0 ,0, 0, OK); |
473 |
write_debug_info("Setting device to BOOT0", 0 ,0, 0, OK); |
471 |
|
474 |
|
472 |
//printf("\n RTS set low. Press any key to continue ... 4"); |
475 |
//printf("\n RTS set low. Press any key to continue ... 4"); |
473 |
//getchar(); |
476 |
//getchar(); |
474 |
} |
477 |
} |
Line 672... |
Line 675... |
672 |
|
675 |
|
673 |
// Verify writen data |
676 |
// Verify writen data |
674 |
BOOL VerifySuccess = TRUE; |
677 |
BOOL VerifySuccess = TRUE; |
675 |
_sleep(100);; |
678 |
_sleep(100);; |
676 |
|
679 |
|
677 |
#ifndef _VS6_USED |
680 |
//#ifndef _VS6_USED |
678 |
int el; |
681 |
int el; |
679 |
#endif |
682 |
//#endif |
680 |
for (el=0; el< (int)NbElements;el++) |
683 |
for (el=0; el< (int)NbElements;el++) |
681 |
{ |
684 |
{ |
682 |
IMAGEELEMENT Element={0}; |
685 |
IMAGEELEMENT Element={0}; |
683 |
if (FILES_GetImageElement(Image, el, &Element) == FILES_NOERROR) |
686 |
if (FILES_GetImageElement(Image, el, &Element) == FILES_NOERROR) |
684 |
{ |
687 |
{ |
Line 750... |
Line 753... |
750 |
|
753 |
|
751 |
WaitForMoreSubOpt = false; |
754 |
WaitForMoreSubOpt = false; |
752 |
|
755 |
|
753 |
printf("\nerasing %i sectors : ", sectors[0]); |
756 |
printf("\nerasing %i sectors : ", sectors[0]); |
754 |
|
757 |
|
755 |
#ifndef _VS6_USED |
758 |
//#ifndef _VS6_USED |
756 |
int i; |
759 |
int i; |
757 |
#endif |
760 |
//#endif |
758 |
|
761 |
|
759 |
for(i = 1; i<= nsec; i++) |
762 |
for(i = 1; i<= nsec; i++) |
760 |
{ |
763 |
{ |
761 |
printf("<%i>", sectors[i]); |
764 |
printf("<%i>", sectors[i]); |
762 |
} |
765 |
} |
Line 1156... |
Line 1159... |
1156 |
|
1159 |
|
1157 |
// Verify writen data |
1160 |
// Verify writen data |
1158 |
BOOL VerifySuccess = TRUE; |
1161 |
BOOL VerifySuccess = TRUE; |
1159 |
_sleep(100); |
1162 |
_sleep(100); |
1160 |
|
1163 |
|
1161 |
#ifndef _VS6_USED |
1164 |
//#ifndef _VS6_USED |
1162 |
int el; |
1165 |
int el; |
1163 |
#endif |
1166 |
//#endif |
1164 |
|
1167 |
|
1165 |
for (el=0; el< (int)NbElements;el++) |
1168 |
for (el=0; el< (int)NbElements;el++) |
1166 |
{ |
1169 |
{ |
1167 |
IMAGEELEMENT Element={0}; |
1170 |
IMAGEELEMENT Element={0}; |
1168 |
if (FILES_GetImageElement(Image, el, &Element) == FILES_NOERROR) |
1171 |
if (FILES_GetImageElement(Image, el, &Element) == FILES_NOERROR) |
Line 1591... |
Line 1594... |
1591 |
} |
1594 |
} |
1592 |
|
1595 |
|
1593 |
|
1596 |
|
1594 |
printf("\nenabling write protection %i sectors : ", sectors[0]); |
1597 |
printf("\nenabling write protection %i sectors : ", sectors[0]); |
1595 |
|
1598 |
|
1596 |
#ifndef _VS6_USED |
1599 |
//#ifndef _VS6_USED |
1597 |
int i; |
1600 |
int i; |
1598 |
#endif |
1601 |
//#endif |
1599 |
|
1602 |
|
1600 |
for(i = 1; i<= nsec; i++) |
1603 |
for(i = 1; i<= nsec; i++) |
1601 |
{ |
1604 |
{ |
1602 |
printf("<%i>", sectors[i]); |
1605 |
printf("<%i>", sectors[i]); |
1603 |
} |
1606 |
} |