Skip to content

Commit 4bc1547

Browse files
committed
Fixed high address error and added DAA288
1 parent bac7372 commit 4bc1547

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/pic32prog.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ int read_hex(char *filename, uint32_t *topaddr)
216216
unsigned address, high;
217217
int bytes, i;
218218

219+
*topaddr = 0;
220+
219221
fd = fopen(filename, "r");
220222
if (! fd) {
221223
perror(filename);
@@ -283,9 +285,10 @@ int read_hex(char *filename, uint32_t *topaddr)
283285
for (i=0; i<bytes; i++) {
284286
store_data(address++, data [i]);
285287
}
288+
289+
if (address > *topaddr) *topaddr = address;
286290
}
287291
fclose(fd);
288-
*topaddr = address;
289292
return 1;
290293
}
291294

@@ -444,7 +447,6 @@ void do_erase()
444447

445448
void do_program(char *filename, uint32_t maxaddr)
446449
{
447-
448450
maxaddr &= 0x00FFFFFF;
449451
unsigned addr;
450452
int progress_len, progress_step, boot_progress_len;

src/target.c

+2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ static variant_t pic32_tab[TABSZ] = {
275275
{0x7227053, "MZ2048EFH144", 2048, &family_mz},
276276
{0x724F053, "MZ2048EFM144", 2048, &family_mz},
277277

278+
{0x5f69053, "MZ2064DAA288", 2048, &family_mz},
279+
278280
/* USB bootloader */
279281
{0xEAFB00B, "Bootloader", 0, &family_bl},
280282
{0}

0 commit comments

Comments
 (0)