Re: copy function and run it
- From: Vladimir Vassilevsky <antispam_bogus@xxxxxxxxxxx>
- Date: Fri, 06 Apr 2007 23:03:20 GMT
sconnet@xxxxxxxxx wrote:
I am using a PPC750 and vxWorks. I am trying to copy a function
outside of the text/data/bss segment into an unused portion of RAM and
jump to it. The function to be copied contains no library calls or
function calls. The executing function then copies a vxworks image
from another location in user defined memory over top of the existing
running image and jumps to it. Is this valid? People are telling me it
should work but does not.
I am not particularly familiar with the specifics of VxWorks, however I did the things similar to what you are trying to do. Yes, it is possible, however it requires a lot of care.
1. Make sure your function is properly linked. I.e. the code is placed at one location, and it is supposed to run from the other location.
2. There could be some agreement on the run time environment required to execute a function. Make sure the environment is correct at the location where the function is executed.
3. A compiler could have optimized your function away as a dead code.
4. It could be a problem with near/far memory access model depending on your CPU.
5. Make sure that the location in the RAM is not used by anything else. You should define it as the dedicated section in the linker file.
Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
.
- References:
- copy function and run it
- From: sconnet
- copy function and run it
- Prev by Date: Re: C 'desktop' programmer needs advice on how to code embedded C on a micro controller.
- Next by Date: Re: C 'desktop' programmer needs advice on how to code embedded C on a micro controller.
- Previous by thread: Re: copy function and run it
- Index(es):
Relevant Pages
|
|