We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
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