software never makes it to main

  • bsd_mike

    bsd_mike - 2008-07-06

    I have a silicon labs C8051F410DK that I am trying to use SDCC with.

    This part has 2048 bytes defined as XRAM, 32kb of flash.

    I have 4 16 byte unsigned char arrays that I need to pass pointers to functions which will
    manipulate them.

    If I setup to use the --model-large, I never seem to get out of initialization and to main().

    If I use the small model, I make to main, but I crash right off the bat.

    Any ideas?


    • Jesus Calvino-Fraga

      Is the Watch Dog Timer disabled?  The WDT needs to be disabled right away or it will kick in while the crt initialization code is running.  This can be achieved using _sdcc_external_startup:

      char _sdcc_external_startup (void)
         PCA0MD&=(~0x40) ; // DISABLE WDT: clear Watchdog Enable bit
         //[more hardware initialization code here]
         return 0;

      Disabling the WDT in main() may or may not work depending on how long the crt initialization takes...


Log in to post a comment.