Open JuPrgn opened 3 years ago
Changing INIT_5()
register on previous C example :
STATIC void INIT_5(void)
{
_T2IE = 1; // enable interrupt
}
to
STATIC void INIT_5(void)
{
_T3IE = 1; // enable interrupt
}
Output :
test_DebugInit.c:50:test_DebugInit_1:PASS
test_DebugInit.c:57:test_DebugInit_2:PASS
test_DebugInit.c:64:test_DebugInit_3:PASS
test_DebugInit.c:71:test_DebugInit_4:PASS
test_DebugInit.c:82:test_DebugInit_5:FAIL: Expected 1 Was 0
test_DebugInit.c:85:test_DebugInit_6:PASS
test_DebugInit.c:92:test_DebugInit_7:PASS
-----------------------
7 Tests 1 Failures 0 Ignored
FAIL
Please note T2IE
and T3IE
are on the same register :
#define IEC0 IEC0
extern volatile uint16_t IEC0 __attribute__((__sfr__));
typedef struct tagIEC0BITS {
uint16_t INT0IE:1;
uint16_t IC1IE:1;
uint16_t OC1IE:1;
uint16_t T1IE:1;
uint16_t DMA0IE:1;
uint16_t IC2IE:1;
uint16_t OC2IE:1;
uint16_t T2IE:1;
uint16_t T3IE:1;
uint16_t SPI1EIE:1;
uint16_t SPI1IE:1;
uint16_t U1RXIE:1;
uint16_t U1TXIE:1;
uint16_t AD1IE:1;
uint16_t DMA1IE:1;
} IEC0BITS;
extern volatile IEC0BITS IEC0bits __attribute__((__sfr__));
This seems to be related to memory sometimes this is on TIMER 2 (T2CON, PR2...) registers and when I modify the code the problem move to another register.
Still present on latest versions : MPLAB X v5.45 and XC16 v1.70
Hi
I'm having strange behavior while testing a particular simple function that interacts with micro registers.
My setup is XC16 compiler running on the mdb simulator.
Simple test crash :
C :
H :
TEST :
Output :
Something crash the simulator before the end, could this be related to memory ? After many attempts, the output stops at the same character for the same code but changes depending on the code being tested.
Any hint would be appreciated.
Tests run fine on GCC using a custom PIC header that define register as :
volatile uint16_t TMR2;
...Config details
Some sections from my project.yml (I can post full config if required) :
sim_test_fixture.rb :
sim_instructions.txt :