Several pgm flash areas ?

Hello!

I would like to know if it's possible to have this context:

  • On Flash (address 0x0000): my main kernel firmware
  • On Flash (external or internal): other little librairies (example: a new sensor implementation, etc)

And of course my main firmware must call these librairies and these librairies must call the main firmware.

Actually my problem is the space (RAM and FLASH), and my current firmware is very big. So I would like to refactor it, to have a kernel, and create some other librairies (like sensors implementation, specific behaviors, etc,), and flash (automatically in FLASH) one or several librairies according the user configuration.

Thanks for your help guys!

The AVR can not store programs in any kind of external flash; you have only the internal flash.
I don't think there is any way to refactor the internal flash that won't make it bigger. Minimally, you'd probably need some (additional) table of vectors to the functions provided by your libraries, so that your kernel would know where they were.

You could think about using some sort of interpreted code; that could be stored in external flash, if you can take the performance penalty. You could store an awful lot of BASIC or FORTH on a 16GB microSD card. (but the thought of managing several MB of forth or basic ought to be making you cringe.)

AnthoYoung:
Hello!

I would like to know if it's possible to have this context:

  • On Flash (address 0x0000): my main kernel firmware
  • On Flash (external or internal): other little librairies (example: a new sensor implementation, etc)

And of course my main firmware must call these librairies and these librairies must call the main firmware.

Anything's possible. AVR chips can update the internal flash as needed (it's what the bootloader does)

If your next question is "OK, how do I do it?" then you're probably on your own. The Arduino IDE won't do it for you, you'll have to do it yourself.

AnthoYoung:
Actually my problem is the space (RAM and FLASH), and my current firmware is very big. So I would like to refactor it, to have a kernel, and create some other librairies (like sensors implementation, specific behaviors, etc,), and flash (automatically in FLASH) one or several librairies according the user configuration.

Wouldn't it be simpler to get an Arduino Mega with 256k flash?