Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:18d7c2b051c8, committed 2022-09-23
- Comitter:
- 4180_1
- Date:
- Fri Sep 23 14:09:54 2022 +0000
- Commit message:
- ver 1.0
Changed in this revision
| 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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Sep 23 14:09:54 2022 +0000
@@ -0,0 +1,40 @@
+//Demo using additional SRAM Banks on LPC1768
+#include "mbed.h"
+Serial pc(USBTX,USBRX);
+DigitalOut myled(LED1);
+int i=0;
+int buffer_SRAM[3000]; //regular SRAM use by compiler
+int buffer_SRAM_Bank0[4000] __attribute__((section("AHBSRAM0"))); //put in extra 16K bank
+int buffer_SRAM_Bank1[4000] __attribute__((section("AHBSRAM1"))); //put in other extra 16K bank
+int main()
+{
+ pc.printf("Hello Extra SRAM\n\r");
+ pc.printf("size of int %d bytes\n\r",sizeof(buffer_SRAM[0]));
+ pc.printf("address of buffer_SRAM %x\n\r",buffer_SRAM);
+ pc.printf("address of buffer_SRAM_Bank0 %x\n\r",buffer_SRAM_Bank0);
+ pc.printf("address of buffer_SRAM_Bank1 %x\n\r",buffer_SRAM_Bank1);
+ wait(5);
+ while(1) {
+ myled = 1;
+ for(i=0; i<4000; i++) {
+ buffer_SRAM_Bank0[i]=i;
+ }
+ for(i=0; i<4000; i++) {
+ buffer_SRAM_Bank1[i]= -i;
+ }
+ for(i=0; i<3000; i++) {
+ buffer_SRAM[i]= 0;
+ }
+ myled=0;
+ for (i=0; i<4000; i++) {
+ pc.printf("%d\n\r",buffer_SRAM_Bank0[i]);
+ }
+ for (i=0; i<4000; i++) {
+ pc.printf("%d\n\r",buffer_SRAM_Bank1[i]);
+ }
+ for (i=0; i<3000; i++) {
+ pc.printf("%d\n\r",buffer_SRAM[i]);
+ }
+ myled = 1;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Sep 23 14:09:54 2022 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/0954ebd79f59 \ No newline at end of file