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.
I ported a sector erase (in C) from 1.31 to uVision 2.20a using ap note 138 (etc.). (C161O, flash 0x0 - 0x3FFFF, ram 0x80000-0x8FFFF; 16 MHz.) After entering main() and before enabling interrupts, we erase a sector and then continue with initialization, and enabling interrupts, and the application. When I run the simulator, I can step through the code to verify that I am passing parameters to the erase function and that the function returns properly. However, running the target, the app gets lost. I examine the flash in the prom programmer and can verify that the application has erased the sector as expected. Did ap note 138 omit to describe any options (for example: NOFIXDPP) in Options-C166-Misc Controls or Options-L166 Misc?
The program I wrote using App138 worked fine using default settings. However, the actual erase/programming modules were written in assembly to avoid having 'C' casts and promotions, which the compiler does using functions sometimes (these functions will not be in the relocated code space and may be in the flash being erased/programmed). DPP usage for nconst is also an issue. See thread; http://www.keil.com/forum/msgpage.asp?MsgID=4783 Best luck Scott