From: hadaq Date: Wed, 2 Sep 2009 14:49:17 +0000 (+0000) Subject: do not protect mdc sector at end of programming X-Git-Tag: v6.0~383 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=b57750256f7170defbbeb26314063628901e18e1;p=trbnettools.git do not protect mdc sector at end of programming --- diff --git a/trbrich/trbflash.c b/trbrich/trbflash.c index 7be5f2c..ab7d75e 100644 --- a/trbrich/trbflash.c +++ b/trbrich/trbflash.c @@ -636,7 +636,7 @@ static int programImageBuffer(uint16_t trb_address, unsigned int size, if ((flashType == FLASH_ADCM1) || (flashType == FLASH_ADCM2)) { /* Enable writing */ - if (sendCommand(trb_address, 0x06 << 24, 0) == -1) { + if (sendCommand(trb_address, 0x06 << 24, 0x00) == -1) { fprintf(stderr, "\nError > program: write enable, aborting\n"); return -1; } @@ -695,8 +695,8 @@ static int programImageBuffer(uint16_t trb_address, unsigned int size, } if ((verifyOnly == 0) && (flashType == FLASH_MDC)) { - /* Protect all Sectors */ - if (writeStatusRegister(trb_address, 0x3c) == -1) { + /* Protect all Sectors i.e. write 0x3c to statusRegister */ + if (writeStatusRegister(trb_address, 0x00) == -1) { fprintf(stderr, "\nError > program: protect all sectors, aborting\n"); return -1; }