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.

CCS/AWR1443BOOST: Errors while trying to add SPI functionality to the mmw demo

Part Number: AWR1443BOOST
Other Parts Discussed in Thread: AWR1443

Tool/software: Code Composer Studio

Previously i tried to use the power optimisation/level sensing demo to transfer range values across SPI to an MSP432. However, i found out the demo was inaccurate at short distances as it doesn't do an initial dc calibration and is made for low power application. Therefore, im using the mmw demo and now want to transfer the range values over SPI but everytime i add in SPI functionality i get this error:

Master_R4: Trouble Writing Memory Block at 0x180d0 on Page 0 of Length 0x7ff0: (Error -1065 @ 0x0) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.576.0)
Master_R4: File Loader: Verification failed: Target failed to write 0x000180D0
Master_R4: GEL: File: C:\Users\saady\workspace_v7\mmwNew\Debug\xwr14xx_mmwNew_mss.xer4f: Load failed.

I tried upping the program memory to 0x0002FF00 using the R4F linker cmd and it worked until i added SPI.

Any help would be appreciated.

  • Hello Ahmad,

    Can you confirm which instance of SPI you are using for your development?

    -Raghu
  • Hi,

    Im using 3 PIN MODE SPI using TI RTOS.

    nt32_t Init_SPI(void){
    
        SPI_Params spiParams;
        SPI_Handle spiHandle;
        int32_t      errCode;
    
    
        /* Setup the PINMUX to bring out the MibSpiA */
        Pinmux_Set_OverrideCtrl(SOC_XWR14XX_PINR8_PADAD, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
        Pinmux_Set_FuncSel(SOC_XWR14XX_PINR8_PADAD, SOC_XWR14XX_PINR8_PADAD_SPIA_MOSI);
    
        Pinmux_Set_OverrideCtrl(SOC_XWR14XX_PINP5_PADAE, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
        Pinmux_Set_FuncSel(SOC_XWR14XX_PINP5_PADAE, SOC_XWR14XX_PINP5_PADAE_SPIA_MISO);
    
        Pinmux_Set_OverrideCtrl(SOC_XWR14XX_PINR9_PADAF, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
        Pinmux_Set_FuncSel(SOC_XWR14XX_PINR9_PADAF, SOC_XWR14XX_PINR9_PADAF_SPIA_CLK);
    
        Pinmux_Set_OverrideCtrl(SOC_XWR14XX_PINR7_PADAG, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
        Pinmux_Set_FuncSel(SOC_XWR14XX_PINR7_PADAG, SOC_XWR14XX_PINR7_PADAG_SPIA_CS);
    
        Pinmux_Set_OverrideCtrl(SOC_XWR14XX_PINP6_PADAA, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
        Pinmux_Set_FuncSel(SOC_XWR14XX_PINP6_PADAA, SOC_XWR14XX_PINP6_PADAA_SPI_HOST1_INTR);
    
        /* Initialize the SPI */
        SPI_init();
    
        if (SOC_SPIOutputCtrl(socHandle, 0, 1, &errCode) < 0)
        {
          /* Debug Message: */
          System_printf("Debug: SOC_SPIOutputCtrl failed with Error [%d]\n", errCode);
          return(0);
        }
    
        /* Setup the default SPI Parameters */
        SPI_Params_init(&spiParams);
    
    #ifdef IR_SPI_MASTER
      spiParams.mode = SPI_MASTER;
      spiParams.u.masterParams.bitRate = 1000000;
      spiParams.u.masterParams.numSlaves = 1;
      spiParams.u.masterParams.slaveProf[0].chipSelect = 0;
      spiParams.u.masterParams.slaveProf[0].ramBufLen = sizeof(Xvalue)*2; //MIBSPI_RAM_MAX_ELEM;
      spiParams.u.masterParams.slaveProf[0].dmaCfg.txDmaChanNum = 1U;
      spiParams.u.masterParams.slaveProf[0].dmaCfg.rxDmaChanNum = 0U;
      spiParams.frameFormat = SPI_POL0_PHA0;
      spiParams.shiftFormat = SPI_MSB_FIRST;
    #else
      spiParams.mode = SPI_SLAVE;
      spiParams.frameFormat = SPI_POL0_PHA0;
      spiParams.u.slaveParams.dmaCfg.txDmaChanNum = 1U;
      spiParams.u.slaveParams.dmaCfg.rxDmaChanNum = 0U;
    #endif
    
      /* Enable DMA and set DMA channels */
      spiParams.dmaEnable = 1;
      spiParams.dmaHandle = dmaHandle;
      spiParams.shiftFormat = SPI_MSB_FIRST;
      spiParams.pinMode   = SPI_PINMODE_3PIN;
      spiParams.eccEnable = 1;
    
      //default datasize (set in SPI_Params_init) is 16 bits
      //    params.dataSize = 8;
    
        spiHandle = SPI_open(0, &spiParams);
        if (spiHandle == NULL)
        {
            System_printf("Error: Unable to open the SPI Instance\n");
            return(0);
        }
    
        return(1);
    
    }

    Thanks

  • Hello,

    AWR1443 has program memory of size 128KB. Till you add SPI, program size is less than 128KB so it works and when you add SPI to the application it goes beyond 128KB of program memory and in that case, while downloading image over JTAG it'll try to write beyond memory limit hence fails.

    To make it work as one option you can follow to move const section to L3 memory of AWR1443.

    /* r4f_linker.cmd */

    .const   : {} > L3_RAM

    /* mmw\main.c */

    /*! L3 RAM buffer */

    uint8_t gMmwL3[SOC_XWR14XX_MSS_L3RAM_SIZE - Size_Of_Const];
    #pragma DATA_SECTION(gMmwL3, ".l3ram");

    In above change, you need to take care L3 memory heap size what demo requires to do the processing (which is based on your profile configuration), remaining you can use for Size_Of_Const  to allocate your .const section.

    Regards,

    Jitendra Gupta

  • Hi,

    How would i know what size to allocate for Size_Of_Const?

    Thanks