simplisity studio debug mode problem

Thread Starter

yef smith

Joined Aug 2, 2020
240
Hello I have written a code for getting data from Si7021 sensor.I see on my scope I2C transmition on SDA and SCL .
As you can see in the photo bellow i2c_rxBuffer is the array where the data is being recieved.
But as you can see bellow in the debuf mode there is no i2c_rxBuffer variable. Where can i see it?
Thanks.
Code:
#include "stddef.h"
#include "em_system.h"
#include "em_device.h"
#include "em_chip.h"
#include "em_cmu.h"
#include "em_emu.h"
#include "em_gpio.h"
#include "i2cspm.h"
#include "si7013.h"
#include "sl_sleeptimer.h"
#include "graphics.h"
#include "em_adc.h"
#include "bspconfig.h"


uint8_t com1[1] = {0xE3};
uint8_t i2c_rxBuffer[3];
int main(void)
{
    I2C_TransferSeq_TypeDef i2cTransfer;
    I2C_TransferReturn_TypeDef result;

  I2CSPM_Init_TypeDef i2cInit = I2CSPM_INIT_DEFAULT;


  /* Chip errata */
  CHIP_Init();

  // Enabling clock to the I2C, GPIO, LE
  CMU_ClockEnable(cmuClock_I2C0, true);
  CMU_ClockEnable(cmuClock_GPIO, true);
  CMU_ClockEnable(cmuClock_HFLE, true);

  // Starting LFXO and waiting until it is stable
  CMU_OscillatorEnable(cmuOsc_LFXO, true, true);

  I2CSPM_Init(&i2cInit);
 // In order to enable the I2C0_SCL function in PC10 you need to use ROUTE 14
 // In order to enable the I2C0_SDA function in PC11 you need to use ROUTE 16
 //Also note that there's a GPIO pin PD15 that need to be set to high in order to route the signals to the sensor,
  // Using PC10 (SCL) and PC11 (SDA)
    GPIO_PinModeSet(gpioPortC, 10, gpioModeWiredAndPullUp, 1);
    GPIO_PinModeSet(gpioPortC, 11, gpioModeWiredAndPullUp, 1);

    //Si7021 switch on
    GPIO_PinModeSet(gpioPortD, 15, gpioModePushPull, 1);

    // Enable pins at location 15 as specified in datasheet
    I2C0->ROUTEPEN = I2C_ROUTEPEN_SDAPEN | I2C_ROUTEPEN_SCLPEN;
    I2C0->ROUTELOC0 = (I2C0->ROUTELOC0 & (~_I2C_ROUTELOC0_SDALOC_MASK)) | I2C_ROUTELOC0_SDALOC_LOC16;
    I2C0->ROUTELOC0 = (I2C0->ROUTELOC0 & (~_I2C_ROUTELOC0_SCLLOC_MASK)) | I2C_ROUTELOC0_SCLLOC_LOC14;
    i2cTransfer.flags=I2C_FLAG_WRITE_READ;
    i2cTransfer.addr=0x80;//address with write
    i2cTransfer.buf[0].data=com1[0];   // Measure Temperature, Hold Master Mode
    i2cTransfer.buf[0].len=2;       //2 bytes length

    i2cTransfer.buf[1].data=i2c_rxBuffer;
    i2cTransfer.buf[1].len=3;       //LS MS checksum
while(1)
{
    result=I2C_TransferInit(I2C0,&i2cTransfer);

    // Sending data
     while (result == i2cTransferInProgress)
     {
       result = I2C_Transfer(I2C0);
     }
}

  }
1605876280651.png
 
Top