This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Properly adding startup.a51

Hi everyone.
So far I've only done some rather small 8051 projects, mostly with variants that had less than or equal to 64k memory.
Now I have a project which includes fairly large amounts of code-data running on SiLabs' C8051F12x, which has 128k.
Since inherently only 64k are accessible, I need to use code banking.
However, once - as noted in the application notes - I include STARTUP.A51 and the L51_BANK.A51, my application throws an Module Name Not Unique Warning for C_STARTUP.
In the KEIL Knowledge Base, I found the suggestion to rename C_STARTUP to C_STARTUP_MAIN to resolve the issue.
I did so, but then I got a code overlap warning at 0000H to 0002H.
I never had to deal with an overlap I didn't actually cause myself (manually) before, so I'm not sure how to resolve it.
In the M51, I found ...
C:0000H PUBLIC ?C_STARTUP_MAIN
(and, further down)
C:0000H LINE# 85.

I assume those are the overlapping segments, no?
I'm not sure how to progress in resolving the warning, could anybody shed some light on this for me?
Thanks alot!
Steven

Parents
  • the easy way:

    use the chip as if it is a 64k chip, have the semi-permanent data in the upper 64 k access them as follows:

    I give you the read, figure out the erase and write

    ////////////////////////////////////////////////////////////
    //
    //
    // FUNCTION U8 ReadFlashChar (U8 code *  RFSaddr)
    //
    // read high flash
    //
    
    U8 ReadFlashChar (U8 code *  RFSaddr)
    {
    U8 RFCintsav;
    U8 RFCdata;
    
      RFCintsav = SG_IE;
      SG_IE = 0;
      SG_SFRPAGE = 0;
      if (RFSaddr > 0x7fff)
      {
        SG_PSBANK = 0x30;
      }
      else
      {
        SG_PSBANK = 0x20;
        RFSaddr   += 0x8000   ;
      }
      RFCdata = *RFSaddr;
      SG_PSBANK = 0x10      ;
      SG_IE = RFCintsav;
      return (RFCdata) ;
    }
    

    Erik

Reply
  • the easy way:

    use the chip as if it is a 64k chip, have the semi-permanent data in the upper 64 k access them as follows:

    I give you the read, figure out the erase and write

    ////////////////////////////////////////////////////////////
    //
    //
    // FUNCTION U8 ReadFlashChar (U8 code *  RFSaddr)
    //
    // read high flash
    //
    
    U8 ReadFlashChar (U8 code *  RFSaddr)
    {
    U8 RFCintsav;
    U8 RFCdata;
    
      RFCintsav = SG_IE;
      SG_IE = 0;
      SG_SFRPAGE = 0;
      if (RFSaddr > 0x7fff)
      {
        SG_PSBANK = 0x30;
      }
      else
      {
        SG_PSBANK = 0x20;
        RFSaddr   += 0x8000   ;
      }
      RFCdata = *RFSaddr;
      SG_PSBANK = 0x10      ;
      SG_IE = RFCintsav;
      return (RFCdata) ;
    }
    

    Erik

Children