Thank you for your time Peg, but as I already mentioned in my first post, I am using Freescale beans for IFlash memory.
Of course this methods use RAM when writing to flash, therefore this is not the problem since I am never trying to read and write flash at the same time.
When I said my code was long to place it in RAM I was thinking about the whole loader code. But as I mentioned the part where the loader writes flash is copied into RAM and all of my loader code is place in a
protected area far from the memory I am erasing and rewriting.
Flash is working fine because when I erase and write memory that was not used by the user program, the loader continue to run fine.
All of the CAN routines are also placed in the same protected area, as well as the Flash routines. However I am missing something, thus I am erasing part of the loader (without knowing). Any helping tips? I'll appreciate any helping ideas. Thanks
Jaime
When deep debugging I found out that the compiler is using RTSHC08.C.o (ansiis.lib) and it is placing these functions into the memory I need to erase. Therefore, the question here is:
Is there any pragma or instruction to avoid jumping to libraries in specific functions?
I mean, can you specify the compiler to copy this instruction into your function instead of jumping to the library?
This is a very dumb example, but I hope it explains what I need to do:
//In ansiis.lib
void Increment(int & P)
{
P++;
}
//In bootloader.c
void Function()
{
int A = 1;
Increment(A);
}
I want the compiler to to this
void Function()
{
int P = 1;
P++;
}
instead of this
void Function()
{
int P = 1;
JMP Increment;
}
Message Edited by Jaime R on
2009-01-15 05:52 PM