2013-05-10 01:52 PM
I am getting the following error when using the simulator to debug code that seems to be working on the actual target. '' stopped on write protection at 0x801'' The chip is stm8s105c6 and code is written in C using Raisonnance compiler. I looked at help inside STVD and it mentions looking at the memory mapping under MCU configuration but I cannot seem to locate this dialog and there is no mention on how to navigate to this dialog. Has anyone else encountered this problem? Can anyone help me to solve this issue? Thanks
#stvd-write-protection-simulator2013-05-10 09:35 PM
Hello Michael!
stm8s105c6 RAM is mapped at addresses 0x0 - 0x7FF, so 0x801 is an invalid RAM address. When the simulator is running your code, it therefore stops when it access an undefined RAM location. When this happens, the instruction that caused the error is highlighted in the disassembler window. A ''real'' stm8s105c6 doesn't check if an instruction reads or writes a reserved RAM location. If a code runs on a ''real'' stm8s105c6, it may still contain errors as your case shows. The simulator is a powerful debug tool, so I suggest to use it as much as possible to discover some bugs that may conceal themselves somewhere and show up when a deadline is expiring... Regards, EtaPhi