]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
do not protect mdc sector at end of programming
authorhadaq <hadaq>
Wed, 2 Sep 2009 14:49:17 +0000 (14:49 +0000)
committerhadaq <hadaq>
Wed, 2 Sep 2009 14:49:17 +0000 (14:49 +0000)
trbrich/trbflash.c

index 7be5f2c3aad02dee6b35aa7efa7e1b9d801fcf4b..ab7d75ec8eeb50c7f70bc37fb259057ccc309ff0 100644 (file)
@@ -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;
     }