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.

TMS320F28388D: How can I read/write internal flash memory?

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hi, I'm always getting a lot of help this forums.

Today also I have a question.

I am using Cortex-M4 in TMS320F28388D.

I want to write and read the internal flash memory.

Because, we have to save our tuning parameters, but we don't have external memory.

So I tried to find an example of this problem, but I couldn't.

Can I know how to solve this problem?

I want to write some values for CMBANK0_SECTOR13.

The area is not being used.

I look forward to your response.

Thank you.

  • Meili,

    Did you already try the flash programming example given in the C2000Ware?

    Thanks and regards,

    Vamsi

  • Did you already try the flash programming example given in the C2000Ware?

    Of course, but all the examples I found were for external memory and CPU1.

    Can I know the location of the example for internal memory?

    I use C2000Ware_3_04_00_00.

  • Did you already try the flash programming example given in the C2000Ware?

    Can I test the internal flash memory write using the 'i2c_ex2_eeprom' project?

    I tried it, but the function I2C_isBusBusy returns ERROR_BUS_BUSY.(line 23~26)

    //
    // writeData - Function to send the data that is to be written to the EEPROM
    //
    uint16_t
    writeData(struct I2CMsg *msg)
    {
        uint16_t i;
    
        //
        // Wait until the STP bit is cleared from any previous master
        // communication. Clearing of this bit by the module is delayed until after
        // the SCD bit is set. If this bit is not checked prior to initiating a new
        // message, the I2C could get confused.
        //
        if(I2C_getStopConditionStatus(I2CA_BASE))
        {
            return(ERROR_STOP_NOT_READY);
        }
    
        //
        // Check if bus busy
        //
        if(I2C_isBusBusy(I2CA_BASE)) // <--An error occurs here!
        {
            return(ERROR_BUS_BUSY);
        }
    
        //
        // Setup number of bytes to send msgBuffer and address
        //
        I2C_setDataCount(I2CA_BASE, (msg->numBytes + 2));
    
        //
        // Setup data to send
        //
        I2C_putData(I2CA_BASE, msg->memoryHighAddr);
        I2C_putData(I2CA_BASE, msg->memoryLowAddr);
    
        for (i = 0; i < msg->numBytes; i++)
        {
            I2C_putData(I2CA_BASE, msg->msgBuffer[i]);
        }
    
        //
        // Send start as master transmitter
        //
        I2C_setConfig(I2CA_BASE, I2C_MASTER_SEND_MODE);
        I2C_sendStartCondition(I2CA_BASE);
        I2C_sendStopCondition(I2CA_BASE);
    
        return(SUCCESS);
    }

  • Melli,

    In C2000Ware 4.00.00.00, you can use below example to program the flash.

    C2000Ware_4_xx_xx_xx\driverlib\f2838x\examples\cm\flash

    Thanks and regards,
    Vamsi