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.

TMS320F28335 flash controller

Other Parts Discussed in Thread: TMS320F28335

Hello all,

I'm writing here hoping somebody can help me.

I'm working on an application that involve the in circuit programming of a TMS320F28335 device and I'm looking for a documentation describing the internal flash controller registers. 

I found only the documentation about the API flash library but I cannot use it.

Can you help me?

Thanks in advance!!!

Alberto Zinzi

  • Hi Alberto,

    Flash registers description is mentioned in "SysCtrl & Interrupts" User Guide in Device Website.

    Regards,
    Gautam
  • Alberto,

    Alberto Zinzi said:

    I'm working on an application that involve the in circuit programming of a TMS320F28335 device and I'm looking for a documentation describing the internal flash controller registers. 

    I found only the documentation about the API flash library but I cannot use it.

    When you say in-circuit programming, you mean you need to develop your own custom programming method?  Why can't you use the flash APIs?

    The flash control registers (for programming) are not documented.  Instead, TI provides the API library.  We've done all the difficult work in the APIs, so there is no need to have information on the flash control registers.  All you need to do is call the erase(), program(), or verify() functions.

    Why do you say you cannot use the API library?

    Regards,

    David

  • I work in SPEA (Volpiano-Italy) and we produce In-Circuit Test Systems on which we provide also a complete functional test. During the functional test phase we do also specific programming of devices following customer’s requirements using our hardware on the system. We do not build stand-alone programmers because it is not our business.

    Now we have to program a TMS320F28335 device for an our costumer.
    We tried to use the APIs without success but other actions in the firmware are executed correctly.
    So would try to program the device directly with the flash controller.

    Could you please help us?

    Regards

    Alberto
  • Alberto,

    The flash APIs should do what you need. There is nothing you're going to gain by directly trying to program the flash controller registers (which aren't documented anyway, as you noticed). The APIs already take care of the flash controller for you.

    What access port do you plan to use to gain access to the device (e.g., JTAG, serial port)? What you need to do with the flash APIs is write a program using them that manages the data flow from the access port, and programs it into the flash. You would simply download this program into the device RAM and run it. Then on the host (e.g., PC) side you need to stream in the data and let your code in the device program it into flash. That's a very high level description.

    JTAG is a complicated access port, and unless you already know what you're doing with it it's not the way to go. The JTAG port is not documented either, and really only available to 3rd parties that make emulators and stuff like that. What most people will do is use the ROM bootloader in the device and one of the bootloader supported serial ports (e.g, SCI). They'll use that port to download and run the flash program, and also to stream in the data for the flash.

    I hope this helps you.

    Regards,
    David

  • David,

    We are able to run firmware by JTAG port, but we got some trouble when the code reaches any API instruction.
    For example the code arrives to: rErrCode = Flash_Erase(SECTOR_F28335, &Status);
    and then the device doesn't execute any other instruction (seems stuck in some address).

    Any other instruction is executed normally (we did a BlankCheck istruction and seems working).
    All the code is placed in RAML0 (from address 0x8000) while APIs are in RAML1 (0x9000).
    Consulting the generated code, i see the APIs code starts from 0x9544 and not from 0x9000.

    Could you please support by email, so we can send you the code to understand the problem in a better way?

    Regards,

    Alberto
  • Alberto,

    I wrote you a very simple example that programs an small array into flash. It is attached. You can compare with your code.

    This is a fully self-contained CCS project, and leaves all the GPIO pins as inputs so you can run it on your board. It does expect a 30 MHz input clock (PLL x5, giving 150 MHz). If you do not have a 30 MHz clock on your board, you will need to modify the flash API file Flash2833x_API_Config.h to reflect your clock setup.

    The code programs the small array x[10] into flash sector H. Nothing else is linked to sector H, so it is free to use here (I can erase it, etc.). I did not know which version of CCS you have nor compiler version. I used a slightly older version of each so you could easily import the project. It is a CCS v5.5.0.00077 project using compiler v6.2.7. That CCS or later will import it just fine.

    Import the project into CCS, and build the project. Then, connect to your F28335 target and load the project (flash it). Set a breakpoint on the NOP in the main loop of main(). Open a memory window to address 0x30_0000 (start fo sector H). Right now, it should be all 0xFFFF (erased). Run to the breakpoint. You will see the x[] array 0,1,2,3,4,5,6,7,8,9 in sector H:

    After doing this, you can do Run->Restart, and set a breakpoint on the call to Flash_Program() line. Run to there. You'll see sector H is again erased. Hit Run again and hit the breakpoint in the main loop, and you'll see the x array again in sector H.

    You may not be able to set both breakpoints I described at the same time, depending on the options you have selected in your CCS setup.

    - David

    F28335_FlashAPI_example_2015Jan09.zip

  • Thanks David,

    Now it's working but the Flash_Erase takes about 100 seconds to be executed.

    Do you think that it is correct?

    Regards,
  • 100 sconds is too long. Should take maybe 5 - 10 seconds. For my example program (which I assume is what you are running), when I hit RUN it takes about 5 seconds to hit the breakpoint in the main loop. This is mostly for the erasure of sector H I assume.

    If you use CCS to erase sector H, how long does it take? (go to tools menu, then Flash Programmer, something like that).

    Have you tried more than one board?

    Is your board clock 30 MHz, as I said was needed for my example?

    - David
  • Now it is fast.

    I disabled the PLL for test.

    Thank so much for your support!