Extend Flash Memory

Guest #4061099
Rate this post
• ▲ useful
▼ not useful
Hi everybody,
I am currently totally into OS dev but got very soon to memory 
restrictions (not enough flash memory) on my ATmega8. Is there a way 
(maybe a code trick) to extend the flash memory using an eeprom, SD,... 
besides transfering to a bigger ATmega? I read some stuff about the 
bootloader and SPM (though I have not fully understand everything)?! 
(already using -fshort-enums, -Os in gcc but -mint8 is not an option for 
me - results in creepy code crashes!)
(P.S.: don't wanna do a small sized OS or RTOS)
Guest #4061214
Rate this post
• ▲ useful
▼ not useful
cogadh wrote:

> I am currently totally into OS dev but got very soon to memory
> restrictions (not enough flash memory) on my ATmega8.

???

This sentence doesn't yield much sense. Querying my crystal ball I 
assume the code (flash) memory of your ATmega8 is simply to small to 
contain the whole nonsense shit you want to write into it.

> Is there a way
> (maybe a code trick) to extend the flash memory using an eeprom, SD,...
> besides transfering to a bigger ATmega?

Not in the first approach.

> I read some stuff about the
> bootloader

Yes, "bootloader" (better: self programming) mechanisms owns the might 
to virtually extend the flash. But not in the context of OS stuff. The 
limited count of possible flash erase/write cycles will prohibit this 
kind of usage. In the best case the flash write limits are wide enough 
to "load" rarely used applications on demand (superseding other rarely 
used applications).

You can do the game appr. 10.000 times, then the flash will die. Refer 
datasheet if you don't trust me.
Guest #4061290
Rate this post
• ▲ useful
▼ not useful
Wrong architecture!

AVR can only execute code from its internal flash. Period. And 
repeatedly rewriting this flash is not an option, either. So the answer 
is no.

On other architectures like ARM, MIPS (PIC32), or MPS430 (especially the 
FRAM based ones) this would be no problem at all.

fchk
Guest #4061306
Rate this post
• ▲ useful
▼ not useful
Thanks for your responses!

c-hater wrote:
> This sentence doesn't yield much sense. Querying my crystal ball I
> assume the code (flash) memory of your ATmega8 is simply to small to
> contain the whole nonsense shit you want to write into it.

Yeah, that's true! :)

I probably should switch to ARM with AVR as special purpose hardware 
extension...

***CLOSED***
Guest #4061428
Rate this post
• ▲ useful
▼ not useful
Well, you could put a virtual machine in flash which then executes byte 
code from an external eeprom.  Will be slow but gets you as much memory 
as you want.  Some systems using this technique: Basic STAMP, 
Propeller's SPIN, ...

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.