X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fpic32mx.c;h=6e51f1aa2d0e2c631f1477b141f9b3011d15dcbf;hp=2fe864d4f0fbf592d05b76164e28a3ad1a7b6cc7;hb=4617cd0f911d64a460d99d25c531ddc55f2452ca;hpb=86e851e1e263c79f19eb9db52553de99f19b8bb9;ds=sidebyside diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c index 2fe864d4f0..6e51f1aa2d 100644 --- a/src/flash/nor/pic32mx.c +++ b/src/flash/nor/pic32mx.c @@ -227,6 +227,8 @@ static int pic32mx_protect(struct flash_bank *bank, int set, int first, int last return ERROR_OK; } +/* see contib/loaders/flash/pic32mx.s for src */ + static const uint32_t pic32mx_flash_write_code[] = { /* write: */ 0x3C08AA99, /* lui $t0, 0xaa99 */ @@ -360,7 +362,7 @@ static int pic32mx_write_block(struct flash_bank *bank, uint8_t *buffer, if ((retval = target_run_algorithm(target, 0, NULL, 3, reg_params, pic32mx_info->write_algorithm->address, - pic32mx_info->write_algorithm->address + (sizeof(pic32mx_flash_write_code) - 76), + 0, 10000, &mips32_info)) != ERROR_OK) { LOG_ERROR("error executing pic32mx flash write algorithm");