sdram and cdc,hdk serial test program for EA4088 mbed. HDK Serial stopped after a while, but CDC Serial and LED HeartBeat is alive.

Dependencies:   EALib USBDevice mbed

Files at this revision

API Documentation at this revision

Comitter:
mio
Date:
Sun Oct 06 04:24:24 2013 +0000
Commit message:
SDRAM malloc test; HDK Serial (pc) is stopped after a while,; But LED and CDC Serial is alive.

Changed in this revision

EALib.lib Show annotated file Show diff for this revision Revisions of this file
USBDevice.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
diff -r 000000000000 -r 0e8a8d6e4cfd EALib.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EALib.lib	Sun Oct 06 04:24:24 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/embeddedartists/code/EALib/#1c6134c80dc5
diff -r 000000000000 -r 0e8a8d6e4cfd USBDevice.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Sun Oct 06 04:24:24 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/USBDevice/#d495202c90f4
diff -r 000000000000 -r 0e8a8d6e4cfd main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Oct 06 04:24:24 2013 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "sdram.h"
+#include "USBSerial.h"
+
+DigitalOut led1(LED1);
+USBSerial cdc;
+Serial pc(USBTX,USBRX);
+
+#define SIZE (1024*1024)
+
+int alloccount = 0;
+unsigned char *ptr[100] ;
+
+int main() {
+    sdram_init();
+    while(1) {
+        ptr[alloccount] = (unsigned char *)malloc(SIZE) ;
+        cdc.printf ("Allocated Address = %08X\r\n",ptr[alloccount]);
+        pc.printf ("Allocated Address = %08X\r\n",ptr[alloccount]);
+        if (ptr[alloccount] == NULL) {
+            cdc.printf("MAX ALLOC MEMORY %d MB\r\n",alloccount);
+            pc.printf("MAX ALLOC MEMORY %d MB\r\n",alloccount);
+            for (int i=0;i<alloccount;i++) {
+                free(ptr[i]);
+            }
+            alloccount = 0;
+        } else {
+            alloccount++ ;
+        }
+        led1 = 1;
+        wait(0.1);
+        led1 = 0;
+        wait(0.1);
+    }
+}
diff -r 000000000000 -r 0e8a8d6e4cfd mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Oct 06 04:24:24 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file