cancel
Showing results for 
Search instead for 
Did you mean: 

STVD7 Query

sjo
Associate II
Posted on July 30, 2003 at 10:22

STVD7 Query

7 REPLIES 7
sjo
Associate II
Posted on June 20, 2003 at 08:20

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

SJO

shreya
Associate II
Posted on June 27, 2003 at 10:49

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..
kr
Associate II
Posted on June 27, 2003 at 13:13

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 regards

sjo
Associate II
Posted on July 01, 2003 at 06:46

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

SJO
kr
Associate II
Posted on July 02, 2003 at 10:28

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.

thanks
sjo
Associate II
Posted on July 04, 2003 at 07:00

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

SJO
alain2399
Associate II
Posted on July 30, 2003 at 10:22

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.