2003-07-30 01:22 AM
2003-06-19 11:20 PM
Hi all,
I have been writing a simple RTOS for the st7 and using the STVD7 similator (v2.4 for initial debugging, all was well until I upgraded to any version higher than 2.48 (including the latest 2.52). I now get the message at my context switch: Error: read access out of range. To make sure it wasn't my code I have also tried the same with ucos and embos, both with exactly the same message. Zap and Hiwave work ok. As soon as I switch back to v2.48 all is well. I just thought I would mention it, possibly could be fixed in a later release? Regards SJO2003-06-27 01:49 AM
Hello,
Please could you provide us with the following information : 1) The device that you have chosen in MCU configuration. 2) What you mean by ''context switch''? rgds..2003-06-27 04:13 AM
Quote:
On 2003-06-27 14:19, dasg wrote: Hello, Please could you provide us with the following information : 1) The device that you have chosen in MCU configuration. 2) What you mean by ''context switch''? rgds.. /quote] Please let me know about the following things 1. did you allot any RAM for StackPointer? 2. if yes, is it same for all your tasks in RTOS 3. What is your Stack depth at worst case ? with thanks and regards2003-06-30 09:46 PM
I am currently using a ST72C254G2.
What I mean by context switch is the point where the rtos kernel switches from the active task to the next pending task, eg. save stack for current task and restore stack for pending task. I know the problem is not down to my rtos because I get exactly the same problem with ucos or seggar within the simulator. As I said all is ok with version 2.48 and real silicon. Regards SJO2003-07-02 01:28 AM
Hello,
Can you send me the following details 1. Are you using any Pointers to access the memory 2. At which address you are getting this Error if we access any reserved area, that will show '' Stopped on Read Protection Access at '' (address belongs to the reserved area) in version 2.5.X but not in 2.4.8. thanks2003-07-03 10:00 PM
I know it is not a problem with addresses/code etc, because it works in Zap and Hiwave. Also I get no problems when using the DVP with Visual Debug.
I have traced the problem down to the simulator. Regards SJO2003-07-30 01:22 AM
The problem comes from the IRET instruction used to switch tasks.
When reconstructing the stack prior to the IRET instruction your code reassigns the value 0x00 to the status register. According to the ST7 specification it should be 0xC0. The simulator up to version 2.4.8 was not taking this bit into account (as the real silicon) when restoring the status register. From 2.5.x and on it seems that you must write 0xC0, it will also work with the real silicon as in fact this bit cannot be written to. It is a bug in the simulator which does not behave as the silicon.