Hi,
We are using recently released GW64 MCU and developed most of the code on CW6.2
After introducing irtc interrupt routines in the code, CW6.2 was giving us problems related to irtc write protect registers which we could not solve.
After discussing in detail with the FSL FAE's we decided to move to CW10.1 and ported whole code to CW10.1
Now we are stuck on this problem of "Out of allocation space in segment ROM at address 0x7FD9"
Being relatively new to FSL MCU's we are not sure of what to look at in the generated map file. Any comments/suggestions are welcome.
Thanks in advance for any help.
Cheers
DC
Are you using the same prm as in 6.2?
Check the compilation options and the linker command line as well,
for example check that you are picking up the desired ansi library.
When creating the project with the 10.1 wizard, make sure to select the same options as with 6.2. For example enable floating point support can add a lot of code is you use a function out of the printf or scanf family (sprintf,...).
Daniel
Hi,
We have also tried building a new workspace using banked memory model.
It started giving fixup overflow in _Vector_52, to PDB_ISR type 1, at offset 0x0
After going through the forum threads discussing similar errors, we tried
#pragma push
#pragma CODE_SEG __NEAR_SEG PAGED_ROM
// interrupt handler here....
#pragma pop
for every ISR that was showing the problem.
We were able to sort our first few fixup errors.
Then we got stuck at a Fixup overflow error for a vector location which is not being used in our program
No luck
Hope, someone will help us understand and overcome this problem soon.
Cheers
DC
> Then we got stuck at a Fixup overflow error for a vector location which is not being used in our program
That's too little information to know what failed. Apparently something was using it, what was the failure message?
Anyhow, placing all interrupt handlers explicitely into non banked is a good idea for CW 6.2 or when using the small mm as well.
Daniel
> That's too little information to know what failed. Apparently something was using it, what was the failure message?
You are right Daniel, apparently one of our team members did wrote an ISR for that location and it was there all the time when we were trying to debug. I somehow missed it.
Thanks for pointing out.
No more fixup overflow problem now. Its the lauch configuration error
Cheers
DC
Hello
Placing interrupt code in a section called PAGED_ROM is just confusing for everybody I think.
I would recommend you to fix the issue in 2 steps:
1- Place the interrupt functions code in a user define section called INTERRUPT_CODE for instance.
This is done as follows:
#pragma push#pragma CODE_SEG __NEAR_SEG INTERRUPT_CODE// interrupt handler here....#pragma pop
2- Place the INTERRUPT_CODE section appropriately in the .prm file.
For this modify the placement block from
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ DEFAULT_RAM, /* non-zero page variables */ INTO RAM; _PRESTART, /* startup code */ STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ NON_BANKED, /* runtime routines which must not be banked */ DEFAULT_ROM, COPY /* copy down information: how to initialize variables */ INTO ROM; /* ,ROM1,ROM2: To use "ROM1,ROM2" as well, pass the option -OnB=b to the compiler */ PAGED_ROM /* routines which can be banked */ INTO PPAGE_0,PPAGE_0_1,PPAGE_2,ROM1,ROM2;
to
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ DEFAULT_RAM, /* non-zero page variables */ INTO RAM; _PRESTART, /* startup code */ STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ NON_BANKED, /* runtime routines which must not be banked */ INTERRUPT_CODE, COPY /* copy down information: how to initialize variables */ INTO ROM; /* ,ROM1,ROM2: To use "ROM1,ROM2" as well, pass the option -OnB=b to the compiler */ DEFAULT_ROM, PAGED_ROM /* routines which can be banked */ INTO PPAGE_0,PPAGE_0_1,PPAGE_2,ROM1,ROM2;
CrasyCat
Hello CrazyCat,
I tried your suggestion, with this suggestion fixup overflow error is coming in normal function calls.
E.g..: Fixup overflow in Set_TimeOut_MTIM1, to Disable_MTIM1 type 3, at offset 0x5
Both Set_TimeOut_MTIM1 and Disable_MTIM1 are simple timer init function calls
Do you think we might have allocated too much contiguous memory space to INTERRUPT_CODE. 0x1960 TO 0x7FFF is about 26KBytes out of 64KBytes!
Would you suggest judicious use of paged memory section ,by allocating them like this
INTERRUPT_CODE_SECTION_1, COPY PPAGE_0
INTERRUPT_CODE_SECTION_2, COPY PPAGE_0_1
INTERRUPT_CODE_SECTION_3, COPY PPAGE_2
instead of
INTERRUPT_CODE, COPY INTO ROM;
in the prm file?
Consequently pragma directives will need to be updated accordingly.
Cheers
DC
Interrupt handles themselves must be non banked as the vector table just takes 16 bit vectors.
However any other functions can be allocated banked, and if you happen to have some huge interrupt handlers you can move those into normal functions and call them from a trivial interrupt handler (will slow it a bit down, of course).
Do your interrupt handlers themselves use 26k?
Also note that this fixup overflow is a different type than the prior ones. Has been a while, but could it be that you allocate the section containing both Set_TimeOut_MTIM1 and Disable_MTIM1 into 2 separate segments?
Say, something like
MY_SECTION INTO ROM, ROM1;
For that to work, please add the -OnB=b compiler option (many prm files contain a note stating that too).
The COPY section must be the last one placed in a non banked segment.
Daniel
Hello
I assume you are building code in banked memory model.
Is that correct?
Can you check preprocessor listing in file where Set_TimeOut_MTIM1 is implemented.
Do you have a prototype for Disable_MTIM1 in there? What is the latest pragma CODE_SEG preceding the prototype?
CrasyCat
@ Daniel: We are using CW 10.1 at the moment because of some irtc related issues in CW6.2 especially with GW64 MCU. We are not even able to use any basic irtc drivers in CW 6.2 IDE. Thats why we ported our whole code to CW 10.1
Hi Crazycat,
I feel that is where the problem is. Issue is with our understanding of the prn file.
Attached is the original unmodified prn file. I am confused about where and what to modify to place PAGED_ROM in NON_BANKED memory area.
We did a few experiments with the prm file. Now we are not getting any errors. But, we are stuck at launch configuration error just after initiating debug mode.
also tried disabling -OnB-b optimization. No luck
I really appreciate the help you guys extend to the freescale forums. God bless you all.
cheers
DC