Changing mbed SRAM size

09 Aug 2010

My program needs nearly 40 Kb RAM size for image storage. Can I change mbed RAM size to store the image?

09 Aug 2010

mbed does not have 40KB of contiguous RAM, it has two 32KB blocks (at 0x10000000 and 0x2007C000). If you want to use the second block, you'll need to allocate your variable to sections "AHBSRAM0" or "AHBSRAM1", they're not used automatically.

Is the image data read-only? If so, you can keep it in the flash, no need to spend RAM. Just make sure you add const specifier to the declaration.

09 Aug 2010

I reduced its size to 30400 bytes. It is not read only. I will take image data from a CMOS sensor. I only want to transfer this image data over ethernet. I think i cannot use ethernet library if I use theese sections :(

09 Aug 2010

Can you transfer that data in smaller chunks?

09 Aug 2010

I think I will allocate data and write back to the flash using IAP routines. That's to free the image area in RAM. Then I will transfer them as smaller chunks. How can I use malloc and free for the data to reside in AHBSRAM1?

10 Aug 2010

How do you get data from camera? I'm sure there should be a way to get it and transfer immediately using small buffers.

10 Aug 2010

Using flash as temporary storage with IAP is a pretty bad idea. The flash is only specified to last 10,000 write/erase cycles. If you really want to do this with this camera, and this microcontroller, but can't read the data from the camera sequentially in smaller blocks whilst sending it, then I'd suggest hooking up some external SRAM though a bunch of the mbed IO pins. You won't be able to directly access this memory (because the LPC17xx doesn't have an external bus interface) but you'll be able to emulate it with software and get the job done.

10 Aug 2010

I think I must use 23K256 SPI SRAM. I will get data from camera byte by byte and write it to SPI SRAM. I will do some calculations (like average intensity value) and send then send data over ethernet.

Thanks all.

10 Aug 2010

Do you have to store all data for the calculation? E.g. the average can be computed by just summing up all values as they arrive, no need to keep them.

10 Aug 2010

After the calculation I have to make a decision: If black pixels count is more than half of pixels I will transfer the image otherwise I will not transfer the image.