Updated SPI flash example
authorKevin Townsend <kevin@ktownsend.com>
Mon, 3 Oct 2011 20:06:13 +0000 (22:06 +0200)
committerKevin Townsend <kevin@ktownsend.com>
Mon, 3 Oct 2011 20:06:13 +0000 (22:06 +0200)
build/crossworks/LPC1343_CodeBase.hzs
tools/examples/spiflash/erase_write_read/main.c

index fea48a7..f4373df 100644 (file)
  </TraceWindow>
  <Watch1>
   <Watches active="1" update="Each Second" >
-   <Watchpoint linenumber="155" radix="16" name="Tick" expression="Tick" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
-   <Watchpoint linenumber="155" radix="-1" name="xTickCount" expression="xTickCount" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
-   <Watchpoint linenumber="138" radix="16" name="timer32_0_counter" expression="timer32_0_counter" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/timer32/timer32.c" />
    <Watchpoint linenumber="66" radix="10" name="msTicks" expression="msTicks" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/systick/systick.c" />
+   <Watchpoint linenumber="138" radix="16" name="timer32_0_counter" expression="timer32_0_counter" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/timer32/timer32.c" />
+   <Watchpoint linenumber="155" radix="-1" name="xTickCount" expression="xTickCount" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
+   <Watchpoint linenumber="155" radix="16" name="Tick" expression="Tick" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
   </Watches>
  </Watch1>
  <Watch2>
@@ -68,7 +68,7 @@
   <Watches active="0" update="Never" />
  </Watch4>
  <Files>
-  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="76" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="34" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="0" />
+  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="18" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="14" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="84" />
  </Files>
  <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="Segger J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
 </session>
index 76fb3c4..4704a9f 100644 (file)
@@ -88,7 +88,7 @@ int main(void)
     }
   }
 
-  printf("Writing 8 bytes to page 0 (bytes 0..7)\r\n");
+  printf("Writing 8 bytes to page 0 starting at address 0x04 (byte 5)\r\n");
   buffer[0] = 0x12;
   buffer[1] = 0x34;
   buffer[2] = 0x56;
@@ -97,7 +97,7 @@ int main(void)
   buffer[5] = 0xCD;
   buffer[6] = 0xEF;
   buffer[7] = 0xAA;
-  error = spiflashWritePage (0, buffer, 8);
+  error = spiflashWritePage (0x04, buffer, 8);
   if (error)
   {
     // Check what went wrong
@@ -131,6 +131,14 @@ int main(void)
   buffer[5] = 0;
   buffer[6] = 0;
   buffer[7] = 0;
+  buffer[8] = 0;
+  buffer[9] = 0;
+  buffer[10] = 0;
+  buffer[11] = 0;
+  buffer[12] = 0;
+  buffer[13] = 0;
+  buffer[14] = 0;
+  buffer[15] = 0;
   error = spiflashReadBuffer (0, buffer, 16);
   if (error)
   {
This page took 0.026616 seconds and 4 git commands to generate.