J-Link Ultra+ ARM Cortex R4 Target connection lost
Hello Everyone,
I have find a strange Issue debugging with Eclipse Luna Service Release 2 (4.4.2) and J-Link Ultra+ for ARM Cortex R4 Target in C.
Common C projects right debug, but in this, I have a nested structure whose pointer is to procedures sended.
typedef struct temperatureReg_s
{
int8_t integerPart; //MSB (Write/Read first)
uint8_t fractionalPart; // LSB
} temperatureReg_t;
typedef struct tempLimits_s{
temperatureReg_t lowLimit;
temperatureReg_t highLimit;
}tempLimits_t;
typedef struct pRegister_s
{
int8_t tempRegister; //= 0x00; Temperature pointer Register
int8_t configReg; //= 0x01;
int8_t tLowReg; //= 0x02;
int8_t tHighReg; // = 0x03;
} PointerRegister_t;
typedef struct temperatureSensor_s
{
const int8_t i2CAddress; //= 0x4A; //Without the eighth (R/W) bit
const int8_t genCallAdd; //= 0x00;
const PointerRegister_t pReg;
int16_t nBytesData; //nBytes2send/endbyte for each data type
int16_t currentByte;
uint8_t *data;
}tSens_t;
I said strange, because when I set two breakpoints bettwen the calls to procedures, work without problems:
void tSDrv_writeValues(tSens_t *tSens, const int8_t *pointReg, int16_t nBytesData)
{
/*1*/ i2c_setBusIdle(50020000);
/*2*/ i2c_startCommand(1300);
--->(breakpoint here) /*3*/ if(pointReg != &tSens->genCallAdd) tSDrv_sendChipAdMode(tSens, I2C_WRITE);
--->(breakpoint here) /*4*/ tSDrv_sendRegisterAD(tSens, pointReg);
/*5*/ tsDrv_sendData(tSens, nBytesData);
i2c_stop(50020000);
}
But without thems, I get the following error:
Target connection lost
Failed to execute MI command:
-data-disassemble -s 0 -e 132 -- 3
Error message from debugger back end:
Cannot access memory at address 0x0
Greetings and thansk in advance.
I saw the Failed to execute MI command occasionally, but never been able to properly diagnose it.
It would be useful to also test in exactly the same environment, but with the J-Link GDB server started manually, and the standard GNU Hardware Debugging plug-in instead of my J-Link plug-in.
I also suggest you enable the gdb tracing (Properties -> C/C++ -> Debug -> GDB), perhaps you can spot something unusual.
you can also try a debug session with the SEGGER Oxygen standalone debugger.