
Zitat von
HaWe
ps, @mxt:
der LPC4088 mit seinen nur 512 kB Flash-Programmspeicher und 96 kB SRAM wäre mir eigentlich zu schwach auf der Brust.
Das EA LPC4088 Quickstart Board hat 32 MB externen SRAM über ein 32 Bit Interface an den Controller angebunden, außerdem 8 MB externen Flash über QSPI. Alles große was man auf dem Heap anlegt, also mit malloc bzw. new landet im externen Speicher.
Code:
#include "mbed.h"
#include "sdram.h"
int main (void) {
void* a, b, c, d, e;
if (sdram_init() == 1) {
printf("Failed to initialize SDRAM\n");
return 1;
}
a = malloc( 1024); // will be from internal RAM
b = malloc( 1024*1024); // will be from SDRAM as it is too large
c = malloc(15*1024*1024); // will be from SDRAM
d = malloc(15*1024*1024); // will be from SDRAM
e = malloc(15*1024*1024); // will fail as there is not enough heap left
// deallocation goes here...
}
Ich erreiche über Ethernet vom PC aus Schreib- und Leseraten von 6,9 MByte / s auf das Board. Das ist schon ganz ordentlich.
Lesezeichen