CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

#ZERORAM is halting my debug

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

#ZERORAM is halting my debug
PostPosted: Wed Sep 25, 2019 8:51 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 25, 2019 9:46 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 25, 2019 11:46 am     Reply with quote

Thanks!
Are you sure that this was fixed?
I can't find anything about #ZERORAM in http://www.ccsinfo.com/devices.php?page=versioninfo
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19549

View user's profile Send private message

PostPosted: Wed Sep 25, 2019 12:00 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group