Page 1 of 1

Writing to Compressed Application Code memory...possible?

Posted: Mon Jan 26, 2009 10:13 am
by cme0848
Just wanted to get some input from the group as to the feasibility of the following:

I have 2 different applications that I want to run on the netburner (I'm using MOD5282). Lets say the logic for each program is 300K thus making it impossible to combine the two applications into one and still fit in the 512k limit. I would like to run the 1st app until an event occurs then have the 1st app load the 2nd application into flash memory and call a ForceReboot(). Both applications *APP.s19 files would be stored on an external SD memory card.

Are there any major obstacles in regards to writing to the Compressed Application Code memory area in order to accomplish this?

Thanks for you input,
Craig

Re: Writing to Compressed Application Code memory...possible?

Posted: Mon Jan 26, 2009 10:28 am
by Chris Ruff
Craig:

Remarkably difficult.

You would need to make your 1st and 2nd apps run in RAM above your 'manager' app. Your manager app would unpack the 1st and 2nd apps into SDRAM from the SD card and jump on them based on what is going on.

The two main apps would need to be based at the addresses you unpack them into. They would reference locations in the manager app as well.

Remarkably Difficult.

Wouldn't you prefer to use a module without the 512k flash limitation?

Chris

Re: Writing to Compressed Application Code memory...possible?

Posted: Mon Jan 26, 2009 12:00 pm
by cme0848
Hmm. Interesting thoughts. Not sure if I understand there's a need for a managing app. Everything is running in RAM so what would it matter if it was the 1st application that spawned the 2nd or in your case you suggest the manager spawn the 2nd.

As I see it only 3 memory locations would need to be kept track of (none of which ever change).
1) Start of 1st application on SD card
2) Start of 2nd application on SD card
3) Start of Compressed Application code memory

And YES, i'd love a module that does have this 512k memory limitation but i need the ADCs. Do you know of one that has more than 512K flash and ADCs?

Craig

Re: Writing to Compressed Application Code memory...possible?

Posted: Mon Jan 26, 2009 12:13 pm
by Chris Ruff
Craig:

Is each 'app' going to have its own instantiation of uCOS? will the netburner library be in each app?

What I am basically discussing here is "overlays" like we used to do in "real memory" DOS. The root app would load and use overlays. The overlay code would be loaded into various spots in RAM and it's entry points were known to the app that never moves at the 'base' of memory.

If only two apps, one app supplants the other then both apps would have to have substantial parts that are exactly the same and include the NB library, uCOS, Vectors, CLib, startup.s, on and on.

Chris

Re: Writing to Compressed Application Code memory...possible?

Posted: Mon Jan 26, 2009 2:03 pm
by rnixon
Craig,

I'm not sure I follow your first and second posts. In the first post it seems like you want to reprogram flash. In the second it kind of seems like you want to load something in ram from the sd card. You might be able to work out some kind of scheme where the flash app just determines which of 2 SD card apps to load into sdram, and run from there. Not sure how to do that, but rewriting flash doesn't seem like an option.

Re: Writing to Compressed Application Code memory...possible?

Posted: Tue Jan 27, 2009 5:08 pm
by thomastaranowski
Seems like you might be able to get away with the following"

Setup:
*Both apps are stored on the sdcard as "normal" .s19 images

1.) run your application until said event happens
2.) Emulate the software download process, wherein instead of flashing the software from the network you copy it in from the sdcard.
3.) Reboot after completion

One could hack at the autoupdate code as a start, and maybe come up with something workable.

Re: Writing to Compressed Application Code memory...possible?

Posted: Tue Jan 27, 2009 6:30 pm
by bbracken
If each application is 300k... compressed they will most likely be half as much. Remember also that two seperate applications will have all of the NB "overhead" duplicated in each (uCOS, TCP/IP...). Might be worth a try to combine them. There are probably other common functions between the two applications. If you mess with the application loading, you most likely will lose the ability to autoupdate or TCPUpdate.

bb