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.

TMDSCNCD28388D: Routine migration

Part Number: TMDSCNCD28388D
Other Parts Discussed in Thread: C2000WARE,

The purchased development board has an SD card slot.
However, there is no driver routine.
It is found that 28377D has a corresponding SD routine.
The current idea is to transplant 28377D routines into 28388D applicable routines.
Please tell me if there is a professional guide for the transplantation process.

Looking forward to your reply!

thank!

  • By the way, when can 28388D SD read and write driver routines be updated to C2000 WARE?

  • I don't know of a guide for porting this. The code can be ported. I would expect copying the .C file and maybe a few of the support files is all you need. I would recommend starting with an SPI F28388D example and modifying it.

    The devices have somewhat different clocking schemes, but are otherwise very similar. Call the correct F28388D functions and it should work pretty well.

    I do not expect these SD routines to be updated and put in C2000Ware anytime soon. Its not a use case that many customers use.

    Regards,
    Cody 

  • HI, Cody Watkins 

    The InitSysCtrl() function in F28377D is equivalent to Device_init(); in F28388D, right?

    DINT;
    IER = 0x0000;
    IFR = 0x0000;
    InitPieVectTable();
    Are the above four statements equivalent to the following two statements?
    Interrupt_initModule();
    Interrupt_initVectorTable();


    There are the following two statements in 28377D,
    InitSpiaGpio();
    spi_initialization();


    void InitSpiaGpio()
    {

    EALLOW;

    /* Enable internal pull-up for the selected pins */
    // Pull-ups can be enabled or disabled by the user.
    // This will enable the pullups for the specified pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAPUD.bit.GPIO16 = 0; // Enable pull-up on GPIO16 (SPISIMOA)
    // GpioCtrlRegs.GPAPUD.bit.GPIO5 = 0; // Enable pull-up on GPIO5 (SPISIMOA)
    GpioCtrlRegs.GPAPUD.bit.GPIO17 = 0; // Enable pull-up on GPIO17 (SPISOMIA)
    // GpioCtrlRegs.GPAPUD.bit.GPIO3 = 0; // Enable pull-up on GPIO3 (SPISOMIA)
    GpioCtrlRegs.GPAPUD.bit.GPIO18 = 0; // Enable pull-up on GPIO18 (SPICLKA)
    GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0; // Enable pull-up on GPIO19 (SPISTEA)

    /* Set qualification for selected pins to asynch only */
    // This will select asynch (no qualification) for the selected pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAQSEL2.bit.GPIO16 = 3; // Asynch input GPIO16 (SPISIMOA)
    // GpioCtrlRegs.GPAQSEL1.bit.GPIO5 = 3; // Asynch input GPIO5 (SPISIMOA)
    GpioCtrlRegs.GPAQSEL2.bit.GPIO17 = 3; // Asynch input GPIO17 (SPISOMIA)
    // GpioCtrlRegs.GPAQSEL1.bit.GPIO3 = 3; // Asynch input GPIO3 (SPISOMIA)
    GpioCtrlRegs.GPAQSEL2.bit.GPIO18 = 3; // Asynch input GPIO18 (SPICLKA)
    GpioCtrlRegs.GPAQSEL2.bit.GPIO19 = 3; // Asynch input GPIO19 (SPISTEA)

    /* Configure SPI-A pins using GPIO regs*/
    // This specifies which of the possible GPIO pins will be SPI functional pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 1; // Configure GPIO16 as SPISIMOA
    // GpioCtrlRegs.GPAMUX1.bit.GPIO5 = 2; // Configure GPIO5 as SPISIMOA
    GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 1; // Configure GPIO17 as SPISOMIA
    // GpioCtrlRegs.GPAMUX1.bit.GPIO3 = 2; // Configure GPIO3 as SPISOMIA
    GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 1; // Configure GPIO18 as SPICLKA
    GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 1; // Configure GPIO19 as SPISTEA

    EDIS;
    }

    void spi_initialization()
    {
    SpiaRegs.SPICCR.all =0x0007; //Reset off, rising edge, 8-bit char bits
    SpiaRegs.SPICTL.all =0x000E; //Enable master mode, delayed phase,
    //enable talk, and SPI int disabled.
    SpiaRegs.SPIBRR.all =0x0063;
    SpiaRegs.SPICCR.all =0x0087; //Relinquish SPI from Reset
    SpiaRegs.SPIPRI.bit.FREE = 1; //Transmission not affected by emulator
    }


    In 28388D, replace InitSpiaGpio() with initSPI(void) in spi_ex6_eeprom.c routine?
    void initSPI()
    {
    GPIO_setMasterCore(100, GPIO_CORE_CPU1);
    GPIO_setPinConfig(GPIO_100_SPIC_SIMO);
    GPIO_setPadConfig(100, GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(100, GPIO_QUAL_ASYNC);

    GPIO_setMasterCore(101, GPIO_CORE_CPU1);
    GPIO_setPinConfig(GPIO_101_SPIC_SOMI);
    GPIO_setPadConfig(101, GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(101, GPIO_QUAL_ASYNC);

    GPIO_setMasterCore(102, GPIO_CORE_CPU1);
    GPIO_setPinConfig(GPIO_102_SPIC_CLK);
    GPIO_setPadConfig(102, GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(102, GPIO_QUAL_ASYNC);

    GPIO_setMasterCore(103, GPIO_CORE_CPU1);
    GPIO_setPinConfig(GPIO_103_GPIO103);
    GPIO_setPadConfig(103, GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(103, GPIO_QUAL_ASYNC);
    GPIO_setDirectionMode(103, GPIO_DIR_MODE_OUT);

    // Must put SPI into reset before configuring it.
    //
    SPI_disableModule(SPIC_BASE);

    // SPI configuration. Use a 2MHz SPICLK and 8-bit word size.
    //
    SPI_setConfig(SPIC_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA1,
    SPI_MODE_MASTER, 1000000, 8);

    // Configuration complete. Enable the module.
    //
    SPI_enableModule(SPIC_BASE);
    }


    So, what should spi_initialization() replace?

    Looking forward to your reply
    Thank you!

    VINCE

  • HI, Cody Watkins

    The routine sd_card_cpu01 of 28377D in C2000 WARE.
    The routine contains functions f_unlink, f_open, f_read, f_write,,,,,,,
    These functions are in the ff.c file in the routine.

    If you want to use the above function in 28388D, how do you do it?
    Is the ff.c file copied to 28377D for use?

    Looking forward to your reply.
    thank!

    vince

  • Vince,

    the code will likely not map 1:1 and function for function, and will take a bit of digging and investigation to make work.

    As for the FF.c file you can find the F28388D version of this utility here: C:\ti\c2000\C2000Ware_3_04_00_00\utilities\third_party\f2838x\fatfs

    Yes, parts of the ff.c file is executed on the device.

    Regards,
    Cody 

  • HI, Cody Watkins

    In my opinion, the SD read and write driver routines should be updated in C2000 WARE.
    After all, the purchased product TMDSCNCD28388D has an SD card slot onboard.
    TI is obliged to provide driver routines.

    thanks

    vince

  • thanks for your help.

  • Vince,

    the purpose of the controlCARD is to allow access to peripherals, every use case is not supported with example software. Please remember that this is a evaluation module enabling access for SW and HW development, it is not intended to be provide an end system or software.

    Nevertheless I have submitted a request for the SW to be developed or ported from the existing example. This will not be resolved quickly however.

    Regards,
    Cody 

  • thank you very much!
    Looking forward to the support of the company.