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 support@ccsinfo.com

Warning: Total RAM of 18F45K42 wrong

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



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

Warning: Total RAM of 18F45K42 wrong
PostPosted: Sat Apr 30, 2022 2:54 pm     Reply with quote

Title says it all. Tried versions 5.093, 5.105, 5.107 and 5.108. The entry in the compiler database for the 18F45K42 shows 0x1000 for total RAM (4,096 bytes), but it actually has only 2,048 bytes (0x800).

No wonder it was behaving so strangely! I spent a good portion of yesterday afternoon wondering why functions that were defined/declared *but not called* were causing the processor to hang. Dug quite a bit today and found that simply declaring a couple of large arrays would cause it to hang. Kept digging and found that the total memory as defined in the database was 2x as big as it should have been. Also discovered that if I use the chip editor to fix it, the compiler then complains about standard things (for example, INT_TBE) not being defined.

I sent ccs support an email regarding the issue. I suspect that other chips from this family (46K42 and 47K42) might also be wrong.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sun May 01, 2022 2:21 am     Reply with quote

Ouch.

It is not wrong on the other chips I have tried. I thought when you posted,
"ooh, why haven't I had this problem", but then realised I had used the
46K42 (which does have 4K RAM), and the 25K42, which has the 2K. A
quick check showed that both are reporting their RAM sizes correctly.
It is a classic 'one line out' when this was being entered into the database,
with the 46K42, the line below having the extra RAM.
I just tried a bit of my code for the 46K42, recompiling to the 45K42, and
changing the memory size. It merrily compiled without your INT_TBE
problems (it uses both INT_RDA and TBE). Try forcing a clean rebuild.
I did put the memory size in as 0800, don't know if it might need the
four digits.
Hopefully CCS will fix that early next week, but a worthwhile warning.
newguy



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

PostPosted: Sun May 01, 2022 11:55 am     Reply with quote

Code:
*** Error 108 "C:\workspace\...\init.c" Line 166(20,28): Invalid parameters to built in function  :: Not a valid interrupt


This is the error I get when change the RAM size to 800 or 0800. It points to:
Code:
clear_interrupt(INT_TBE);

Something about my system isn't quite kosher. When this pops up I have to reinstall the compiler.

I'm pretty sure they'll send me a fix tomorrow. They're always really good about little fixes like this. In the meantime I need to put my FW on a RAM diet so that when I do get the fix, I can count on fitting the program into the chip.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun May 01, 2022 12:18 pm     Reply with quote

maybe it needs to be...

0X800 or 0X0800 ???
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sun May 01, 2022 12:53 pm     Reply with quote

No Jay, the sizes in the device editor, are in hex, but don't have to have
the 0x.
It is weird. I'm getting it running fine with the file changed. The actual reported percentage in the hex, goes up to 72% with 1476 bytes used.

I'll have a play in the morning and see if I can generate the error.
I'm using 5.108.
newguy



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

PostPosted: Sun May 01, 2022 1:15 pm     Reply with quote

I think the problem might lay with the way my computer was originally configured by our IT people. Originally, all files on my C drive were actually 'virtualised'....they were automatically mirrored to our server. Mirrored is a bit of a misnomer as the files didn't actually exist on my c drive, but they appeared to be.

This caused no end of issues not only with the compiler but also with Altium, so I eventually had them make this a "normal" machine (that is, I could save to my C drive and the file would actually be where I saved it). I strongly suspect that there are some original artifacts of the mirroring feature which is causing me grief.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun May 01, 2022 1:24 pm     Reply with quote

NG...
wonder what happens it you TRULY disconnect your PC from the 'rest of the world' ??
newguy



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

PostPosted: Sun May 01, 2022 2:48 pm     Reply with quote

Jay, I would love to but I unfortunately am beholden to some site-wide policies that I cannot bypass.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun May 01, 2022 3:13 pm     Reply with quote

gee, what if the ethernet cable just 'happened' to come unplugged while you were 'adjusting ' the monitor..... ??? Wink Wink
newguy



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

PostPosted: Sun May 01, 2022 4:18 pm     Reply with quote

Update: used the chipedit feature on my personal PC and version 5.093 (the latest I own). I can merrily edit the RAM for the 18F45K42 and it happily compiles. It's obvious that the reason it doesn't work on my work machine is the haphazard setup that was performed on it....
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun May 01, 2022 4:29 pm     Reply with quote

grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
as least YOU found it !!!

I'd still sever the cable or charge 2x overtime for the 'nonsense' you've had to deal with.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Mon May 02, 2022 1:37 am     Reply with quote

Ouch.

It makes total sense.
It is a problem that sometimes 'virtualised' things do not behave the same
as the physical versions. Sad
Glad you have found what is wrong.
Could you install a modern compiler on your 'home' machine. Then edit the
device database, and copy this back to the work machine?.

A double 'whammy'. A CCS problem, and then the simple fix is prevented
from working by the system configuration.
newguy



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

PostPosted: Mon May 02, 2022 10:38 am     Reply with quote

Update: received a new devices5.dat file from CCS this morning. It solved the problem.

Excellent support, as always.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Mon May 02, 2022 11:14 am     Reply with quote

Good.
They are very quick on this type of thing. Very Happy
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