M Aanenson / Mbed 2 deprecated EXOSITE_DISCO-F746NG_MACHINE_DEMO

Dependencies:   BSP_DISCO_F746NG F746_GUI F7_Ethernet HTTPClient LCD_DISCO_F746NG NTPClient QSPI_DISCO_F746NG TS_DISCO_F746NG mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
maanenson
Date:
Fri Oct 14 17:38:33 2016 +0000
Parent:
3:1bbacf8bb57d
Commit message:
I believe the issue with CIK non correctly being stored to NVMEM is now fixed by adding a erase command before writing. This seems like a problem with the QSPI library but I have not debugged further, as it now seems to work.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 04 16:28:13 2016 +0000
+++ b/main.cpp	Fri Oct 14 17:38:33 2016 +0000
@@ -60,7 +60,7 @@
 bool saveNVCIK(){
 
     // Erase memory
-    //qspi.Erase_Block(CIK_ADDR);
+    qspi.Erase_Block(CIK_ADDR);
 
     uint8_t TempCIK[CIK_BUFFER_SIZE];
     
@@ -71,18 +71,19 @@
         TempCIK[i] = uint8_t(cik[i]); 
         //printf("%d\r\n",TempCIK[i]);
     }
-    //printf("\r\n");*/
+    printf("\r\n");
     
     // Write memory
     if (qspi.Write(TempCIK, CIK_ADDR, 40) != QSPI_OK)
     {
       printf("NVMEM Write FAILED\r\n");
+      return false;
     }
-    /*else
+    else
     {
       printf("NVMEM Write PASSED\r\n");
-    }*/
-    return true;
+      return true;
+    }
 }
 
 
@@ -103,7 +104,7 @@
     {
       ReadBuffer[40] = '\0';
       //printf("NVMEM Read PASSED\r\n");
-      //printf("Buffer read [%s]\r\n", ReadBuffer);
+      printf("Buffer read [%s]\r\n", ReadBuffer);
     }
     
     char tempCIK[41];
@@ -114,7 +115,7 @@
         //printf("%c\r\n",tempCIK[i]);
     }
     
-    //sprintf(tempCIK,"%s",ReadBuffer);
+    sprintf(tempCIK,"%s",ReadBuffer);
     
     if(strlen(tempCIK) == 40){
         strcpy(cik, tempCIK);