Kazuki Yamamoto / Mbed 2 deprecated 11u35_usbLocalFilesystem Featured

Dependencies:   BaseDAP SWD USBDAP USBLocalFileSystem mbed DA14580 SWSPI W25X40BV

USB memory + Writer for DA14580 BLE chip + CMSIS-DAP debugger + USB-UART functions in one chip

One button input loads your application into DA14580 or DA14580 included BLE modules

Quote:

Current compatible hardware description can be found at https://github.com/K4zuki/da14580/releases/tag/MurataBLEr04

Files at this revision

API Documentation at this revision

Comitter:
k4zuki
Date:
Sat Sep 19 10:48:38 2015 +0000
Parent:
4:64a29271d7b8
Child:
6:cb6984367a7a
Commit message:
update DA14580/at45db161d; add target switches for LPC1768 and 11U35/501

Changed in this revision

DA14580.lib Show annotated file Show diff for this revision Revisions of this file
at45db161d.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/DA14580.lib	Wed Aug 19 15:53:30 2015 +0000
+++ b/DA14580.lib	Sat Sep 19 10:48:38 2015 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/k4zuki/code/DA14580/#043522e836ab
+http://mbed.org/users/k4zuki/code/DA14580/#a9684679d1ec
--- a/at45db161d.lib	Wed Aug 19 15:53:30 2015 +0000
+++ b/at45db161d.lib	Sat Sep 19 10:48:38 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/okini3939/code/at45db161d/#b379e16fdf6f
+https://developer.mbed.org/users/k4zuki/code/at45db161d/#111e8cf6f263
--- a/main.cpp	Wed Aug 19 15:53:30 2015 +0000
+++ b/main.cpp	Sat Sep 19 10:48:38 2015 +0000
@@ -22,15 +22,29 @@
 #define     LOADER_FILE         "/local/loader.bin"
 #define     TARGET_FILE         "/local/target.bin"
 
+#if defined(TARGET_LPC1768)
+//SWD swd(p25,p24,p23); // SWDIO,SWCLK,nRESET
+SWD swd(p24, p23, p22); // SWDIO,SWCLK,nRESET
+DigitalOut connected(LED1);
+DigitalOut running(LED4);
+
+SWSPI spi(p5, p7, p6); // mosi, miso, sclk
+
+ATD45DB161D memory(spi, p8);
+RawSerial ble(p5, p6);
+DA14580 BLE(ble, p26);
+
+#elif defined(TARGET_LPC11U35_501)
 //SWD swd(p25,p24,p23); // SWDIO,SWCLK,nRESET
 SWD swd(P0_5,P0_4,P0_21); // SWDIO,SWCLK,nRESET
 DigitalOut connected(P0_20);
 DigitalOut running(P0_2);
 
-SPI spi(P0_9,P0_8,P0_10); // mosi, miso, sclk
+SWSPI spi(P0_9,P0_8,P0_10); // mosi, miso, sclk
 ATD45DB161D memory(spi, P0_7);
 RawSerial ble(P0_19,P0_18);
 DA14580 BLE(ble, P0_1);
+#endif
 
 int file_size( FILE *fp );
 void flash_write (int addr, char *buf, int len);
@@ -57,7 +71,8 @@
 
 int main()
 {
-    USBLocalFileSystem* usb_local = new USBLocalFileSystem(P0_9, P0_8, P0_10, P0_7,"local"); // RamDisk(64KB)
+//    USBLocalFileSystem* usb_local = new USBLocalFileSystem(P0_9, P0_8, P0_10, P0_7,"local"); // RamDisk(64KB)
+    USBLocalFileSystem* usb_local = new USBLocalFileSystem(p17, p15, p16, p18,"local"); // SD
 //    USBLocalFileSystem* usb_local = new USBLocalFileSystem(P0_14, P0_15, P0_16, P0_32,"local"); // SD
     usb_local->lock(true);
     myDAP* dap = new myDAP(&swd);
@@ -76,15 +91,11 @@
         usb_local->remount();
         char filename[32];
 
+        usb_local->puts("Try BLE.load(): ");
         result = BLE.load();
         usb_local->putc(result);
-        /*
-        fp = fopen( SOURCE_FILE, "rb" )
-        if (fp) {
-            filesize=file_size(fp);
-            pc.printf("0x%04X\n\r",filesize);
-        }
-        */
+        usb_local->puts("\n\r");
+
         if (usb_local->find(filename, sizeof(filename), "*.TXT")) {
             fp = fopen(filename, "r");
             if (fp) {
@@ -100,7 +111,6 @@
             }
         }
 
-
         USBStorage2* _usb = usb_local->getUsb();
         USB_HID* _hid = _usb->getHID();
         HID_REPORT recv_report;
--- a/mbed.bld	Wed Aug 19 15:53:30 2015 +0000
+++ b/mbed.bld	Sat Sep 19 10:48:38 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file