ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Пятница
5 июля
136235 Топик полностью
ssergy (27.10.2008 18:20, просмотров: 182) ответил _user на конечно не облегчит ну и на том спасибо ! Мне не обновлять приложение, мне сохронять данные надо. Может еще кто ответит !
Может поможет ...  /* erase APP flash area */ InitIAP(48000); /* 48 MHz */ offset = (U32) &ADR_APP_BEGIN; size = offset + size; /* use 'size' as end adr */ while (offset < size) { if (EraseSector(offset) == 1) { printf ("FirmWare erase error\n"); return (1); } offset += SIZE_BIG_SECTOR >> 1; /* dummy double erase */ } /* update APP flash area */ printf ("FirmWare flash update\n"); fbin = fopen(file, "r"); if (fbin == NULL) { printf ("FirmWare file open error\n"); return (1); } offset = (U32) &ADR_APP_BEGIN; while (offset < size) { len = SIZE_PAGE; if ((size - offset) < SIZE_PAGE) len = size - offset; if (len != fread (&buff_PAGE[0], 1, len, fbin)) { printf ("FirmWare file read error\n"); return (1); } if (ProgramPage(offset, &buff_PAGE[0]) == 1) { printf ("FirmWare flash error\n"); return (1); } offset += SIZE_PAGE; } printf ("FirmWare update finish\n"); fclose (fbin); return (0);