Discussion Forum

C code class info

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Jeff Eigner
Posted
4-Sep-2001 23:14 GMT
Toolset
C166
New! 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
Read-Only
Author
Jeff Eigner
Posted
5-Sep-2001 16:45 GMT
Toolset
C166
New! RE: C code class info
Ok, I found the answer in technical support (yet to be verified)

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

Jeff
Read-Only
Author
Douglas Hewett\
Posted
24-Jan-2002 20:24 GMT
Toolset
C166
New! RE: C code class info
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 ===


Read-Only
Author
Jeff Eigner
Posted
25-Jan-2002 04:11 GMT
Toolset
C166
New! RE: C code class info
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


Next Thread | Thread List | Previous Thread Start a Thread | Settings