I am using the Keil Monitor to debug my program on a ST10F269. Until recently I used the default monitor configuration for my hardware (Phycore 167HSE, 1MB ROM, 2X 512kB RAM), which is included by Keil in it's development software: (uVision3 V3.02) However, when I make certain changes in the address-window configuration (Startup.a66 file in my project), the monitor program crashes. This is my previous working hardware configuration: CS1 0x0-0x80000 (512kB RAM, for monitor) CS2 0x1000-0x2000 (4kB for an external UART) CS0 controlls the ROM-chip (1MB), which is not used when the monitor is active. The compiler only uses a fragment of the available RAM-space for my program. This space is located after the CS2-window (now at 0x10000 = 64kB), so no code gets overwritten. When I change the address window size for CS2 to 8kB or greater (e.g. 0x1000-0x3000 for a 8kB window), The monitor crashes. According to ST's uP-manual, it is permitted for CS2 to overlap CS1. After some experimenting I found out that when the size before the CS2-window (0x0 -> CS2-window start) is >= the size of the CS2-window all is OK, when it is smaller than the CS2-window things go wrong... I also tried to change the ADDRSEL/BUSCON configuration of the monitor. I entered the same windows in the Config.inc file as mentioned before. This gives similar results: 1) CS2: 0x1000 - 0x2000 (4kB) This works fine 2) CS2: 0x1000 - 0x3000 (8kB) With the following settings, the Monitor loads properly, and proceeds with the loading of the user program, but when almost finished loading, is gives the error messages:
*** MONITOR ERROR 3: CANNOT WRITE TO ADDRESS 000003 ... (etc.) *** MONITOR ERROR 3: CANNOT WRITE TO ADDRESS 0000D3
00000000 FA01E203 JMPS ?C_STARTUP(0x103E2) 00000004 E6E6E6E6 MOV P6,#0xE6E6 00000008 E6E6E6E6 MOV P6,#0xE6E6 0000000C E6E6E6E6 MOV P6,#0xE6E6 00000010 E6E6E6E6 MOV P6,#0xE6E6 00000014 E6E6E6E6 MOV P6,#0xE6E6 00000018 E6E6E6E6 MOV P6,#0xE6E6 ... (etc.)