Pumpkin User Forums
  PICmicro MCUs
  PICC18 bss limitations and mem.c

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   PICC18 bss limitations and mem.c
aek
Moderator
posted November 27, 2002 20:44     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
OK, now I think I understand how PICC places large arrays in memory ... so, it looks like to avoid any problems with large numbers of tasks, events, etc., you'll need to create mem2.c, mem3.c, etc. each with just a single Salvo array in it (e.g. mem2.c has OStcbArea[], mem3.c has OSecbArea[], etc.). This should enable the compiler to place any arrays larger than 256 bytes into the bigbss psect.

Note that with this arrangement, you do have to be careful when new versions of Salvo are released, in case mem.c has been changed ... maybe there's an elegant way for us to provide a set of mem2.c, mem3.c, etc. that one could use in these cases in place of the current mem.c ...

Regards,

------------------

IP: 63.203.232.106

jtemples
Member
posted November 27, 2002 20:40     Click Here to See the Profile for jtemples     Edit/Delete Message   Reply w/Quote
quote:

In that FAQ there is also mention of a bigbss psect -- can you put the whole of the original mem.o in there?

I'm guessing that's not possible, since they don't suggest it as a workaround in the FAQ.

quote:

O/wise the limit is that neither the tcb array nor the ecb array can exceed 256 bytes

My understanding is that if a single object exceeds 256 bytes, it is automatically placed in bigbss. So if all of the Salvo arrays were encapsulated in a single structure, for example, this problem wouldn't come up.

IP: 209.239.242.114

aek
Moderator
posted November 27, 2002 20:33     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
In that FAQ there is also mention of a bigbss psect -- can you put the whole of the original mem.o in there?

If placing mem.o into bigbss is possible, then there is no real limit to the number of tasks and events with PICC-18. O/wise the limit is that neither the tcb array nor the ecb array can exceed 256 bytes ...

------------------

IP: 63.203.232.106

aek
Moderator
posted November 27, 2002 20:22     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
quote:
I have worked around this by creating a "mem2.c" and moving OStcbArea from mem.c to mem2.c. I'm not sure if this is valid, given the comments in mem.c related to OScTcbP.
Since the PIC18's RAM space is essentially a linearly addressed one (despite banking), I don't think it's an issue. Also, since the only qualifier (by default) for OSLOC_ALL is persistent, that means that 16-bit pointers are used as data pointers, and again, there's only one RAM location with address 0. So I don't think you have anything to worry about ...

------------------

IP: 63.203.232.106

jtemples
Member
posted November 27, 2002 20:15     Click Here to See the Profile for jtemples     Edit/Delete Message   Reply w/Quote
Source build.

IP: 209.239.242.114

aek
Moderator
posted November 27, 2002 20:14     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
Library or source-code build?

IP: 63.203.232.106

jtemples
Member
posted November 27, 2002 19:42     Click Here to See the Profile for jtemples     Edit/Delete Message   Reply w/Quote
I just added a 15th task to my project, and got a "couldn't find xxx words for segment bss" linker error from PICC18 8.20PL2, though I have several hundred bytes of free RAM. I remembered item 97 from Hi-Tech's FAQ, which was the problem: one module can have no more than 256 bytes of bss, and mem.c was violating this requirement.

I have worked around this by creating a "mem2.c" and moving OStcbArea from mem.c to mem2.c. I'm not sure if this is valid, given the comments in mem.c related to OScTcbP.

I think mem.c will have to be split up into many files in order to be used with large projects.

IP: 209.239.242.114

All times are ET

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Pumpkin Home Page

©2000-2008 Pumpkin, Inc. All Rights Reserved. Pumpkin and the Pumpkin logo, Salvo and the Salvo logo, The RTOS that runs in tiny places, CubeSat Kit and the CubeSat Kit logo are all trademarks of Pumpkin, Inc. All other trademarks are the properties of their respective owners.


Ultimate Bulletin Board 5.46a