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

C code class info

I am trying to use app note 138 with one exception, I want to relocate C code, not assembly ....

I believe my source file name "sram_x.c" defines the section name as SRAM_X, my problem is defining the class name. Anyone know how to do this?

Jeff

  • Ok, I found the answer in technical support (yet to be verified)

    check out:
    http://www.keil.com/support/docs/942.htm

    Jeff

  • Have you solved this yet?

    My first step was to try to re-build the example flash.uv2 but I get compiler errors with respect to:
    === paste begin ===
    compiling Srom.c...
    C:\KEIL\C166\INC\REG167.H(370): error C155: 'DP8': invalid base address
    C:\KEIL\C166\INC\REG167.H(381): error C155: 'P8': invalid base address
    C:\KEIL\C166\INC\REG167.H(386): error C155: 'ODP8': invalid base address
    assembling Pflash.a66...
    Target not created
    === paste end ===


  • My source looked like this

    #include <reg161.h> /* special function register C161 */
    #include <srom.h> /* allows code relocation to SRAM */
    #include <intrins.h>

    #pragma LARGE
    #pragma RENAMECLASS(FCODE=SRAM_CODE)

    void wait (void) { /* wait function */
    }

    void sram_code(void) {
    unsigned int i;
    while (1) {
    for (i=0;i<=0x40000;i++) {
    wait();
    }
    }
    }

    I remember seeing the error you posted and as I recall the port was not present on the C161, so I commented it out. Hope that helps.

    Jeff