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.

Compiler/DRA829V: SPI Configuration Verification

Part Number: DRA829V

Tool/software: TI C/C++ Compiler

Hi,

We are trying to configuration for  MCU_SPI0  in J7-DRA829 

We need to know how to set the baud rate as 1 Mbps.

Our basic configuration is trailing edge and MSB first 
is that hw unit CSIB0 is mapped to MCU_SPI0?
can you please verify our configuration.SPI CFG file.zip
Please find the configuration file in the attachment 
  • Hi,

    Please find the reply below for your queries.

    Is that hw unit CSIB0 is mapped to MCU_SPI0?

    >> Yes. Please refer mcusw/mcal_drv/docs/drv_docs/modules.html for more details.

    How to set 1 Mbps?

    >> Please program SpiExtDeviceClockDivider to 47 in the configurator to achieve 1 MHz clock. Please refer SpiExtDeviceClockDivider description in GUI for more details.

    Regards,

    Sunil Kumar M S

  • Hi Sunil,

    Thanks for your information,

    In the EB Tresos Configurator,  I did not see more information regarding SpiExtDeviceClockDivider .

    May i know How 47 will be relates to 1 MHz. 

    did you verify the configuration file. ?

    we are facing one more issue like, when we change the HW_Unit to 1 - Getting redefined compilation error . May i Know what could be the problem for this parameter ?

    Spi_Cfg.h

  • Hi Muthushankar,

    The value you configure in SpiExtDeviceClockDivider  acts as 12 bit clock divider + 1.

    SpiExtDeviceClockDivider internally split into 4 bit LSB bit will be programmed to CLKD register and remaining 8 bits to EXTCLK register. Together concatenated acts as 12 bit programmable divider. In the driver, clock granularity is set to 1 clock cycle. Please refer TRM for more details. 

    By default Spi runs at 48 MHZ.

    So 47(0x2F) as a 12 bit divider split into  000000101111 i.e 32 +15 + 1 = 48. (48 MHZ / 48 = 1 MHZ) I hope this answered your question.

    Regarding redefined compilation error, please let me know what error you getting?

    Regards,

    Sunil Kumar M S

     

  • Hi Sunil,

    Thanks a lot for your detailed information,

    shared details are enough for me to proceed further,

    For compilation error happen due to below two parameters, if the value as 7 I did not get the error.

    But we configured  value as 2, i am getting below error.

    can you please share some information regarding this.

    is this problem with our configuration or those parameter are depends on other parameters?


    /**
    * \brief Maximum HW unit - This should match the sum for the below units ISR
    * which are ON.
    */
    #define SPI_MAX_HW_UNIT (7)

    /**
    * \brief Maximum external device cfg
    */
    #define SPI_MAX_EXT_DEV (7)

    Compilation error:

    error: symbol "Spi_DrvObj" redefined: first defined in "<whole-program>";
    redefined in
    "/home/user/GCP/psdk_rtos_auto_j7_06_02_00_21/mcusw/binary/mcal/Spi/lib/j721
    e/r5f/release/spi.aer5f<Spi.oer5f>"
    error: symbol "Spi_DrvStatus" redefined: first defined in "<whole-program>";
    redefined in
    "/home/user/GCP/psdk_rtos_auto_j7_06_02_00_21/mcusw/binary/mcal/Spi/lib/j721
    e/r5f/release/spi.aer5f<Spi.oer5f>"
    error: symbol "Spi_getHwUnitBaseAddr" redefined: first defined in
    "<whole-program>"; redefined in
    "/home/user/GCP/psdk_rtos_auto_j7_06_02_00_21/mcusw/binary/mcal/Spi/lib/j721
    e/r5f/release/spi.aer5f<Spi_Priv.oer5f>

  • Hi Muthushankar,

    Please configure via EB Tresos instead of hardcoding it, because there will be dependency on other parameters so.

    Regards,

    Sunil Kumar M S

  • Thanks a lot for Sunil for your support