Discussion Forum

In circuit programming on C166, change to newer toolset.

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

DetailsMessage
Read-Only
Author
Douglas Hewett
Posted
10-Nov-2000 19:04 GMT
Toolset
C166
New! In circuit programming on C166, change to newer toolset.
Our C166 system works executes properly when erasing a flash sector. (we copy the code (that erases or writes to the flash) from flash to ram, call the ram location, and we're done.
(this was done using the 'older' toolset from uVision and the compiler from Bitware, 1.31.)

However...
Using the same code and building with the newer Keil uVision 2, the code crashed.

Inspection of the LST file shows that the two compilers did not compile to identical ASM code.

Commenting out the line of code that makes the call to the routine in RAM allows the code to run.

I suspect a problem with how the boot routine is compiled or linked.

Any ideas?

Thanks.
Read-Only
Author
Jon Young
Posted
10-Nov-2000 19:49 GMT
Toolset
C166
New! RE: In circuit programming on C166, change to newer toolset.
Are you compilinge with the "Common tail merging" optimization. It may be inserting calls or jumps to code that you are not copying over.
Read-Only
Author
Keil Support
Posted
12-Nov-2000 02:25 GMT
Toolset
C166
New! RE: In circuit programming on C166, change to newer toolset.
If you write a function that lives at address xxxx and you move it to address yyyy for execution, you may have trouble if there are any absolute references in the code (or if the code is not relocatable).

There is no way to guarantee that the object code generated IS relocatable.

However, there is a feature of the Keil C166 tools that allow you to compile a function for execution at one address (in RAM) and store it at a different address (for EPROM or FLASH MEMORY).

Refer to http://www.keil.com/appnotes/docs/apnt_138.asp for more details.

Refer to http://www.keil.com/support/docs/942.htm to relocate your C functions to RAM.

Keil Support

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