Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am only able to save the data on to the SRAM which is only 20KB. I need to define the ports and include other libraries which are very important. These take up a total of 12KB. Which leaves me with 8KB of memory for my program. How do you save the data onto the flash memory? The flash memory is 128KB. I connect the embed to the USB and drop the program onto the mbed drive (the icon for it appears on my computer screen).

I am using an mbed online compiler
Login or Signup | mbed[^]

What I have tried:

I have tried to optimize my program to make it short but all the things i want to achieve cannot be achieved within 8KB of data.
I have read the online hand book that is given for this specific mbed.
Posted
Updated 30-Apr-16 3:39am

1 solution

You'd be better off asking this in a forum dedicated to the hardware you're using.

But, I don't know of a single micro that will let you use Flash as RAM.

You either need to get hardware that has more memory in it (your best option!) and/or find a compiler that generates better/smaller bins from your source. Chances are really good this option is going to cost you a few hundred dollars.

The last option is to rewrite your code very creatively to reduce it's size. How much memory this is going to save you depends on your skills, but this will only get you so far. You still may not be able to get enough savings to fit your code in the limited space.
 
Share this answer
 
Comments
bahjat93 30-Apr-16 10:13am    
Firstly thank you for your reply. I originally did submit this question onto the specific forum over a week ago but it is still waiting moderate approval, i think that forum is no longer active.
Secondly the SRAM is only 20KB, however the flash memory is 128KB. The embed is automatically supposed to save data onto the flash memory not SRAM. The code i am using is only 25KB big altogether. When I connect the mbed to the computer it only shows that it has 20KB of space.

Since posting this forum i tried to optimize my program.bin file but turns out optimization for a .bin file is not really possible.

I have the memory available, i just don't know how to access it. I've read the online handbook as well and it says nothing about this.
Dave Kreskowiak 30-Apr-16 10:16am    
I don't have a clue. I've never seen the hardware you're using. What I told you is generic for all micros, not just yours.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900