2004-11-09 07:40 PM
2004-11-01 11:39 PM
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.2004-11-02 02:03 AM
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?2004-11-02 02:19 AM
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.2004-11-08 04:59 AM
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