View previous topic :: View next topic |
Author |
Message |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
Warning: Total RAM of 18F45K42 wrong |
Posted: Sat Apr 30, 2022 2:54 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19358
|
|
Posted: Sun May 01, 2022 2:21 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Sun May 01, 2022 11:55 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9168 Location: Greensville,Ontario
|
|
Posted: Sun May 01, 2022 12:18 pm |
|
|
maybe it needs to be...
0X800 or 0X0800 ??? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19358
|
|
Posted: Sun May 01, 2022 12:53 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Sun May 01, 2022 1:15 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9168 Location: Greensville,Ontario
|
|
Posted: Sun May 01, 2022 1:24 pm |
|
|
NG...
wonder what happens it you TRULY disconnect your PC from the 'rest of the world' ?? |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Sun May 01, 2022 2:48 pm |
|
|
Jay, I would love to but I unfortunately am beholden to some site-wide policies that I cannot bypass. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9168 Location: Greensville,Ontario
|
|
Posted: Sun May 01, 2022 3:13 pm |
|
|
gee, what if the ethernet cable just 'happened' to come unplugged while you were 'adjusting ' the monitor..... ??? ![Wink](images/smiles/icon_wink.gif) |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Sun May 01, 2022 4:18 pm |
|
|
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.... |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9168 Location: Greensville,Ontario
|
|
Posted: Sun May 01, 2022 4:29 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19358
|
|
Posted: Mon May 02, 2022 1:37 am |
|
|
Ouch.
It makes total sense.
It is a problem that sometimes 'virtualised' things do not behave the same
as the physical versions.
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. |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Mon May 02, 2022 10:38 am |
|
|
Update: received a new devices5.dat file from CCS this morning. It solved the problem.
Excellent support, as always. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19358
|
|
Posted: Mon May 02, 2022 11:14 am |
|
|
Good.
They are very quick on this type of thing. ![Very Happy](images/smiles/icon_biggrin.gif) |
|
![](templates/subSilver/images/spacer.gif) |
|