mcsdk_3.2.0:
authorMing Wei <mwei@ti.com>
Wed, 16 Sep 2015 20:21:21 +0000 (15:21 -0500)
committerMing Wei <mwei@ti.com>
Wed, 16 Sep 2015 20:21:21 +0000 (15:21 -0500)
update to PDK release 1.0

program_evm/binaries/evmk2g/eepromwriter_evmk2g.out
program_evm/binaries/evmk2g/eepromwriter_input.txt
program_evm/binaries/evmk2g/nand_writer_input.txt
program_evm/binaries/evmk2g/nandwriter_evmk2g.out
program_evm/binaries/evmk2g/nor_writer_input.txt
program_evm/binaries/evmk2g/norwriter_evmk2g.out
program_evm/binaries/evmk2g/qspi_flash_writer_input.txt [new file with mode: 0644]
program_evm/binaries/evmk2g/qspiflashwriter_evmk2g.out [new file with mode: 0644]
writer/nand/src/nandwriter.c
writer/qspi_flash/src/qspiflashwriter.c

index 278266b1d26aed338dccb6a325f5c59d51eea35e..3372bc8ca0d50cf4ececea2f0657137c0eac0e46 100644 (file)
Binary files a/program_evm/binaries/evmk2g/eepromwriter_evmk2g.out and b/program_evm/binaries/evmk2g/eepromwriter_evmk2g.out differ
index 23524b984955627b080e55ecef1aa99cf60f6931..1e601556b721c721d22592936a1a648cc7f7e142 100644 (file)
@@ -1,8 +1,8 @@
-file_name  = eeprom51.bin
-bus_addr   = 0x51
-start_addr = 0
-swap_data  = 0
-
-
-
-
+file_name  = app.bin\r
+bus_addr   = 0x51\r
+start_addr = 0\r
+swap_data  = 0\r
+\r
+\r
+\r
+\r
index 91aaaf1fcdd189c6e15137530afb5b430edbbde5..189470ac4d1d27ced503ca8f0eac7282ec8e00db 100644 (file)
@@ -1,6 +1,6 @@
-file_name  = nand.bin
-start_addr = 1572864
-rbl_ecc    = 0
-
-
-
+file_name  = app.bin\r
+start_addr = 0\r
+rbl_ecc    = 0\r
+skip_bad   = 1\r
+\r
+\r
index c04663a1cec17a99871da58ebbadf49510dd69d8..04eed21c9bdee4c1f0eb3ec8ee398417ea5ad061 100644 (file)
Binary files a/program_evm/binaries/evmk2g/nandwriter_evmk2g.out and b/program_evm/binaries/evmk2g/nandwriter_evmk2g.out differ
index c0ebbd831d606294b8ac5ce7bb3e86a477b5f92b..f9920fca261cc6f7a07852d82a09aef2057efb97 100644 (file)
@@ -1,5 +1,5 @@
-file_name  = nor.bin
-start_addr = 0
-
-
-
+file_name  = nor.bin\r
+start_addr = 0\r
+\r
+\r
+\r
index 3906bd2f4f483f7326af3601385776297d363fd0..3ee193f0e218615c83ef260d66fd9fe7198cf86a 100644 (file)
Binary files a/program_evm/binaries/evmk2g/norwriter_evmk2g.out and b/program_evm/binaries/evmk2g/norwriter_evmk2g.out differ
diff --git a/program_evm/binaries/evmk2g/qspi_flash_writer_input.txt b/program_evm/binaries/evmk2g/qspi_flash_writer_input.txt
new file mode 100644 (file)
index 0000000..fc922b8
--- /dev/null
@@ -0,0 +1,5 @@
+file_name  = app.bin\r
+start_addr = 0\r
+\r
+\r
+\r
diff --git a/program_evm/binaries/evmk2g/qspiflashwriter_evmk2g.out b/program_evm/binaries/evmk2g/qspiflashwriter_evmk2g.out
new file mode 100644 (file)
index 0000000..6f785be
Binary files /dev/null and b/program_evm/binaries/evmk2g/qspiflashwriter_evmk2g.out differ
index d520410f370deabe17be82302113300b56cf2e01..458796be306167549b6ef0ef762d399d86d35d6a 100755 (executable)
@@ -626,8 +626,6 @@ void main ()
         return;\r
     }\r
     nandWriterInfo.deviceTotalBytes = p_device->block_count * p_device->page_count * p_device->page_size;\r
-    if (nandWriterInfo.deviceTotalBytes > 0x40000000)\r
-        nandWriterInfo.deviceTotalBytes = 0x40000000; /* Max write size 1 GB */\r
     nandWriterInfo.blockSizeBytes   = p_device->page_count * p_device->page_size;\r
 \r
     if ((nandWriterInfo.startAddr % nandWriterInfo.blockSizeBytes) != 0)\r
index a0ec20d9e1d7ecf4e1546493c70e3cddd2676681..1f3f2bac3cb459e76517a3ef5bf186f6176c0bc4 100644 (file)
@@ -60,6 +60,7 @@ uint32_t swap_byte = 0;
 \r
 /* Memory address to store the write data */\r
 #define WRITE_DATA_ADDRESS     0x80000000\r
+#define QSPI_FLASH_SIZE              (64 * 1024 * 1024)\r
 \r
 /******************************************************************************\r
  * Structure:   QSPI_FLASH_WRITER_INFO_T\r
@@ -71,6 +72,7 @@ uint32_t swap_byte = 0;
 typedef struct QSPI_FLASH_WRITER_INFO_tag\r
 {\r
     char        file_name[MAX_LINE_LENGTH]; /* CCS format data file name */\r
+    uint32_t    filesize;                 /* Number of bytes to be written into the device */\r
     uint32_t    blockSizeBytes;             /* The size of each sector */\r
     uint32_t    deviceTotalBytes;           /* Total number of bytes available in the device */\r
     uint32_t    startAddr;                  /* Start address to write */\r
@@ -175,15 +177,26 @@ write_qspi_flash
 \r
     start_block = qspiFlashWriterInfo.startAddr / qspiFlashWriterInfo.blockSizeBytes;\r
 \r
+    for (block = start_block, wPos = 0; wPos < qspiFlashWriterInfo.filesize; block++, wPos += qspiFlashWriterInfo.blockSizeBytes)\r
+    {\r
+        printf ("Erasing sector %d \n", block);\r
+        if (platform_device_erase_block (p_device->handle, block))\r
+        {\r
+               printf ("platform_device_erase_block sector # %d failed!\n", start_block);\r
+               print_platform_errno();\r
+               if (swap_byte) free (scrach_block);\r
+               return (FALSE);\r
+        }\r
+    }\r
     /* Program the QSPI flash */\r
     for (block = start_block, wPos = 0; wPos < qspiFlashWriterInfo.writeBytes; block++, wPos += qspiFlashWriterInfo.blockSizeBytes)\r
     {\r
         printf ("Flashing sector %d (%d bytes of %d)\n", block, wPos, qspiFlashWriterInfo.writeBytes);\r
 \r
         wLen = qspiFlashWriterInfo.blockSizeBytes;\r
-        if ((qspiFlashWriterInfo.writeBytes - wPos) < qspiFlashWriterInfo.blockSizeBytes)\r
+        if ((qspiFlashWriterInfo.filesize - wPos) < qspiFlashWriterInfo.blockSizeBytes)\r
         {\r
-            wLen = (qspiFlashWriterInfo.writeBytes - wPos);\r
+            wLen = (qspiFlashWriterInfo.filesize - wPos);\r
         }\r
 \r
         if (swap_byte)\r
@@ -390,7 +403,7 @@ find_file_length
         data_len = ftell(fp);\r
         fseek(fp, 0, SEEK_SET);\r
     }\r
-\r
+    printf ("The contents of file %s of length %d will be written to QSPI flash of size 0x%x.\n", qspiFlashWriterInfo.file_name, data_len, QSPI_FLASH_SIZE);\r
     if (data_len > (qspiFlashWriterInfo.deviceTotalBytes - qspiFlashWriterInfo.startAddr))\r
     {\r
         printf ("The data file is too big to fit into the device.\n");\r
@@ -400,6 +413,9 @@ find_file_length
     qspiFlashWriterInfo.writeBytes = data_len;\r
     if (write_addr != WRITE_DATA_ADDRESS)\r
         write_addr = WRITE_DATA_ADDRESS;\r
+    memset((void *)write_addr, 0xFF, qspiFlashWriterInfo.blockSizeBytes);\r
+    qspiFlashWriterInfo.filesize= fread((void *)write_addr, 1, data_len, fp);\r
+    printf ("The contents of file %s read is of length %d.\n", qspiFlashWriterInfo.file_name, qspiFlashWriterInfo.filesize);\r
     qspiFlashWriterInfo.writeData  = (uint8_t *)write_addr;\r
     qspiFlashWriterInfo.readData   = (uint8_t *)(write_addr + qspiFlashWriterInfo.deviceTotalBytes);\r
 \r