This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1120EM-420-470-RD: run CC1120 Tx/Rx test on STM32G071RB

Part Number: CC1120EM-420-470-RD
Other Parts Discussed in Thread: CC1120

I've ported code to Arduino UNO and that can run Tx/Rx test successfully.

I would like to porting firmware to STM32G071RB board and run the same initial register setting value as Arduino UNO.

after issue STX command that can't run well, because the TX FIFO can't be cleared even wait for GPIO2 feedback or wait 500ms(at least) on the STM32 Tx part.

 

Note: I don't have TrxEB board to be evaluated. that's why I set cc1120 to Arduino first.

 

my Arduino register setting as below:

CC112X_IOCFG3 b0
CC112X_IOCFG2 6
CC112X_IOCFG1 b0
CC112X_IOCFG0 40
CC112X_SYNC_CFG1 b
CC112X_DCFILT_CFG 1c
CC112X_PREAMBLE_CFG1 18
CC112X_IQIC c6
CC112X_CHAN_BW 8
CC112X_MDMCFG0 5
CC112X_AGC_REF 20
CC112X_AGC_CS_THR 19
CC112X_AGC_CFG1 a9
CC112X_AGC_CFG0 cf
CC112X_FIFO_CFG 0
CC112X_SETTLING_CFG 3
CC112X_FS_CFG 12
CC112X_PKT_CFG0 20
CC112X_PA_CFG2 77
CC112X_PKT_LEN ff
CC112X_IF_MIX_CFG 0
CC112X_FREQOFF_CFG 22
CC112X_FREQ2 72
CC112X_FREQ1 60
CC112X_FS_DIG1 0
CC112X_FS_DIG0 5f
CC112X_FS_CAL1 40
CC112X_FS_CAL0 e
CC112X_FS_DIVTWO 3
CC112X_FS_DSM0 33
CC112X_FS_DVC0 17
CC112X_FS_PFD 50
CC112X_FS_PRE 6e
CC112X_FS_REG_DIV_CML 14
CC112X_FS_SPARE ac
CC112X_FS_VCO0 b4
CC112X_XOSC5 e
CC112X_XOSC1 3
CC112X_PARTNUMBER 48
CC112X_SYNC3 93
CC112X_SYNC2 b
CC112X_SYNC1 51
CC112X_SYNC0 de

----------------------------------------------------------------------------------------------------------

the following code is my STM32 Tx procedure:

while (1)
  {
      trxSpiCmdStrobe(CC112X_SFTX);
      set_idle();

      cc112xSpiReadReg(CC112X_NUM_TXBYTES, &v, 1);
      reg = "NUM_TXBYTES(Before) ";
      print_register_value(reg, v);

      cc112xSpiWriteTxFifo(sendData, strlen(sendData));

      trxSpiCmdStrobe(CC112X_STX);

      while (!HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1)); //GDO0 PIN
      while (HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1)); //GDO0 PIN

      cc112xSpiReadReg(CC112X_NUM_TXBYTES, &v, 1);
      reg = "CC112X_NUM_TXBYTES(After Sending) ";
      print_register_value(reg, v);
      HAL_Delay(500);
  }

void set_idle()
{
    uint8_t marcstate;
    trxSpiCmdStrobe(CC112X_SIDLE);          //sets to idle first. must be in

    do {
        cc112xSpiReadReg(CC112X_MARCSTATE, &marcstate, 1);
    } while (marcstate != 0x41);
}

before initial register, I've run trxSpiCmdStrobe(CC112X_SRES) first.

I can wirte/read command via SPI on STM32, just wonder why the same register can run on Arduino but fail on STM32? Do I miss any setting on cc1120?

  • Hi, 

    Assigning an expert to comment. 

    Thanks, 
    Elin

  • your settings are for 1.2 kbps and 915 MHz.

    You are not enabling autocal of the synth, CC112X_SETTLING_CFG is 0x03 so you will need to perform a manual calibration, or enable autocal (CC112X_SETTLING_CFG = 0x00B. Please see the errata note as there is a bug related to the calibration on some revisions.

    Also, you are polling GPIO0 after strobing STX, but I guess that what you want to do is to poll GPIO2.

    BR

    Siri