cancel
Showing results for 
Search instead for 
Did you mean: 

ST10F269 IRAM gets corrupted

neil2399
Associate II
Posted on November 10, 2004 at 04:40

ST10F269 IRAM gets corrupted

4 REPLIES 4
neil2399
Associate II
Posted on November 02, 2004 at 08:39

Hi.

I run a ST10F269 programmed in Keil’s C environment and have a puzzling problem. I’ve set up PECC0 to do one data transfer when CC15 gets interrupted, before activating the interrupt service routine. It writes the value of T0 into a variable called ttic1. CC15 gets interrupted every couple of 100us.

Now, when I have ttic1 declared as sdata, after a variable amount of time, all my idata declared variables corrupts to 0x00. However when I declare ttic1 as idata this does not happen and everything works fine. I cannot however consider this problem as fixed until I understand why this happens. Here is my set-up code for CC15 and PECC0.

CC15IE = 1;

CC15IC |= 0x38; // Set CC15 Interrupt level 14

CC15IC &= 0xFC; // Set CC15 Group level 0

PECC0 |= 0x01 ;

SRCP0 = (uint16_t) &T0 ;

DSTP0 = _sof_( &ttic1 ) ;

Does anyone have any ideas?

Thanks.

maxime2399
Associate II
Posted on November 02, 2004 at 11:03

As the PEC pointers are located in RAM, sometimes the compiler uses their location to store variables. In this case the variables/PEC pointers get corrupted and the application has a strange behavior.

As your problem is memory model dependent, I suspect this is what is happening to you.

could you verify?
neil2399
Associate II
Posted on November 02, 2004 at 11:19

Max.

I have checked PECC0 in 0xFEC0, DSTP0 in 0xFCE2 and SRCP0 in 0xFCE0 and they all retain their values.

Even if this was the problem, how would it explain the fact that moving my variable ttic1 to idata seemed to have solved the problem? This is what is bothering me most.

Any other ideas I could try?

Thanks.
neil2399
Associate II
Posted on November 08, 2004 at 13:59

Okay. More information. In regst10f269.h SRCP0 and DSTP0 are defined as #define SRCP0 (*((unsigned int volatile sdata *) 0xFCE0)) and #define DSTP0 (*((unsigned int volatile sdata *) 0xFCE2)).

Now, as I understand it 0xFCxx is in idata (IRAM). Why then, are the pointers defined as sdata?

And monitoring these addresses showed that they don’t get corrupted during my crash. I’m therefore not to sure if this has any bearing on my problem. Can someone however, explain why the pointers are declared as sdata when they live in idata, or am I misunderstanding the whole idata/sdata thing?

Thanks