View previous topic :: View next topic |
Author |
Message |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
#ZERORAM is halting my debug |
Posted: Wed Sep 25, 2019 8:51 am |
|
|
Scenario:
CCS v5.078
MPLAB X IDE V5.15
This come from here http://www.ccsinfo.com/forum/viewtopic.php?p=225720#225720
I'm trying to blink a simple LED to test the internal oscillator configuration is ok.
Both codes compile ok but the ones with #ZERORAM is being halted.
I also tried to just run the code without the ICD3 debugger and the LED never goes on.
Code: | #include <24FJ1024GB606.h>
#device ICD=1
#ZERO_RAM
#use delay(internal=32MHz)
void main()
{
while(1)
{
output_toggle(PIN_D6);
delay_ms(500);
}
} |
Runs OK
Code: | #include <24FJ1024GB606.h>
#device ICD=1
//#ZERO_RAM
#use delay(internal=32MHz)
void main()
{
while(1)
{
output_toggle(PIN_D6);
delay_ms(500);
}
} |
I just found that the ASM get this extra lines on the #ZERORAM code
Code: | 0x222: MOV #0x867, W0
0x224: MOV #0x3BCB, W1
0x226: REPEAT W1
0x228: CLR [W0++] |
_________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Wed Sep 25, 2019 9:46 am |
|
|
It'll be causing an address fault trap.
Problem is that 16bit RAM accesses must only be done to even
addresses. So starting at 0x867, will cause a problem....
It's calculating it correctly, and basing it's starting point one byte
above the scratch and other RAM used for temporary variables, but
not correcting to use an even address.
It was fixed a few versions later (current version starts at 0x868). |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Wed Sep 25, 2019 12:00 pm |
|
|
Don't get me wrong, but there are hundreds of changes in the compilers
that are not listed in the CCS notes. There are at least four that have
been done to fix problems I've reported in the last few versions that
are not listed there.
The notes also 'lag', so things are often reported several versions
after when they are actually first done.
Yes, the current compiler has it fixed. However haven't checked which
version first corrects this. |
|
|
|