Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How i can allocate dynamically memory to a function

Status
Not open for further replies.

Majidmanzoor

Newbie level 4
Joined
May 27, 2010
Messages
6
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Pakistan
Activity points
1,313
it is possible that i write program memory with hex code(a complete program) when there is already a program is running.both at diff addresses. its kind of bootloader. but hex code is stored in external EEPROM. using I2c i write that in flash memory.is that works or not?????
2nd thing is that i want to replace a function of a complete program using same idea as above.
 

Yes, I've done it and it works.
A number of conditions must be fulfilled for this to work:

1. you didn't say which uC you use, but it needs to programmatically be able to write its own flash (I did it on NEC's 78k0, Silabs' 8051 and TI's CC2430);
2. if there's no ROM support for writing the flash, you'll need to write a short routine that you relocate in RAM (not all uC can run code from RAM), since you won't be able to execute code from flash while writing it;
3. the function you're replacing must be completely relocatable, and you might need to redirect all calls to it through a vector at a fixed location (as the interrupt service routines do).

There are a lot of other complications you might run into so you'll need a proper design and to master the linker and its configuration to succeed.

Arthur
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top