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.

TMS320F28379D: Write and read variable on LAUNCHXL-F28379D flash memory using Simulink blocks

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hello,

We are programming the TMS320F28379D Launchap using Simulink.

We would like to use the flash memory of 512kB (per core) to save some variables even when the power supply of the board is interrupted. We have created a variable using Data Store Memory blocks, but the signal class tic2000demospkg only allows to use the EMIF. We do not want to use the EMIF because if I am not wrong some changes have to be done in the GPIOs, and we want to use them for other tasks. 

  • So, is there any way to write and read a variable in the on-board flash of 512kB using Simulink blocks? (always using the same address).
  • Or it can only be done using CCS or another platform of lower level programming? If this is the case, how can we do it?

Thank you for your support,

Borja

  • Borja,

    I found the below memory blocks in the embedded coder support package.  I beleive that the tools understand the flash vs RAM address range and will invoke the flash API accordingly.  If not, then we can certainly pull a block out of code from the C2000Ware flash example if needed.

  • Hello Matthew, thank you for your fast response,

    We have considered this option of using the memory copy block. With it, we are able to save one value in the flash memory, in the address 00080000 as it is shown in the document about the TMS320F2837xD Architecture.

    We write the value we want in this address and then read it. We are using the serial comunication to verify the writen value. As the following image shows:

    As the image shows we are using the same sample time for both write and read operations. So, here we have our first problem. If we put different sample times, for example 2x slower the read block than the write block, we are not able to see the writen value. Our final objective is not only to have different sample times but to have unsynchronised write and read blocks, inside triggered subsystems for example.

    • Is there another option we have to check inside the block for this? ¿Can they be used inside triggered subsystems (one for write and another one for read)?

    We have another problem when saving a data buffer instead of a single value. From the diagram shown before we change the buffer size to 10 for example, and the writen elements to 10 (inside the blocks). Even changing the ‘stride’ option to 2 or 4 (we are using int16) we are not able to write and read the buffer data. We make sure that the write operation sample time is slower than the output of the buffer.

    • Can we save a data buffer of X elements at once in the flash?

    We are using CPU2 of the board for this operation.

    Thanks for your time and support,

    Borja

  • Borja,

    I'm reaching out to the MW team that supports C2000 to get their comment.

    Best,

    Matthew

  • Hi,

    One blocker to save one parameter in flash dynamically is the fact that you have to erase an entire flash section, just to save 1 parameter. People usually use an EEPROM to dynamically save calibration parameters. I've seen many interfaced via SPI and accessed with the SPI blocks, that's probably the best solution.