View Single Post
Old 04-08-2010, 12:04 PM   #3
tdm
Đệ tử 7 túi
 
Tham gia ngày: May 2005
Bài gửi: 258
:
Trích:
Nguyên văn bởi lybao_huy View Post
Vấn đề này là do trong 1 hàm nào đó của bạn chứa qua nhiều code, nhưng nếu bạn tách các đoạn code trong hàm ra làm nhiều hàm nhỏ hơn, sau đó gọi nó thì ok, còn không là bị lỗi. Bạn coi trong Errors Messages trong Help của CCS.
**Out of ROM, A segment or the program is too large

A function and all of the INLINE functions it calls must fit into one segment (a hardware code page). For example, on the PIC16 chip a code page is 512 instructions. If a program has only one function and that function is 600 instructions long, you will get this error even though the chip has plenty of ROM left. The function needs to be split into at least two smaller functions. Even after this is done, this error may occur since the new function may be only called once and the linker might automatically INLINE it. This is easily determined by reviewing the call tree. If this error is caused by too many functions being automatically INLINED by the linker, simply add a #SEPARATE before a function to force the function to be SEPARATE. Separate functions can be allocated on any page that has room. The best way to understand the cause of this error is to review the call tree.
cảm ơn bạn. mình sẽ thử lại.
__________________
viết chương trình cho vdk chạy ổn định là cả một vấn đề.
tdm vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn