lỗi ccsc v4.033 khi viết chương trình lớn hơn 50% rom

Collapse
X
 
  • Giờ
  • Show
Clear All
new posts
  • tdm
    Đệ tử 7 túi
    • May 2005
    • 258

    #1

    lỗi ccsc v4.033 khi viết chương trình lớn hơn 50% rom

    mình dùng ccsc v4.033 khi dịch nếu chương trình nhỏ hơn 50% rom thì OK.
    lớn hơn 50% rom thì nó báo lỗi.có cách nào khắc phục không ,nhờ các bạn chỉ giúp cho.
    Attached Files
    viết chương trình cho vdk chạy ổn định là cả một vấn đề.
  • lybao_huy
    Đệ tử 5 túi
    • Jan 2008
    • 97

    #2
    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.
    Last edited by lybao_huy; 04-08-2010, 10:38 AM.

    Comment

    • tdm
      Đệ tử 7 túi
      • May 2005
      • 258

      #3
      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 đề.

      Comment

      • tdm
        Đệ tử 7 túi
        • May 2005
        • 258

        #4
        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.
        lỗi nó ở chỗ này:
        while(1)
        {
        if(a==0)
        {
        }
        else if(a==1)
        {
        tại đây mình viết quá nhiều code
        }
        else
        {
        }
        }
        viết chương trình cho vdk chạy ổn định là cả một vấn đề.

        Comment

        • quangdiemhp
          Nhập môn đệ tử
          • Jan 2012
          • 5

          #5
          Sao của mình nó cũng cứ báo out of rom ở cái đoạn chương trình con này nhỉ
          void read_rom()
          {
          k=read_eeprom(4);
          for (j=0;j<k;j++){
          e=e*10;
          e=e+read_eeprom(j);}
          }
          //int16 e; trong CSS
          //Mình lưu e0 vào vị trí 1, e1 vào vị trí 2, ....e3 vào vị trí 3, còn vị trí 4 lưu giá trị của i (tức là số có 4 chữ số). Cái hàm k=read_eeprom(4); là đọc giá trị của i (i=4).=> tính ra số e để gán trở lại giá trị value duty cho pwn.

          Comment

          Working...