Flash

Non-volatile flash memory on C2000 devices is primarily used as program memory for the core and also as static data memory. During application development, application executable can be programmed in to the flash memory using Code Composer Studio (CCS). When CCS identifies that the code is mapped in to the flash memory for a given application, it will automatically invoke CCS On-Chip Flash Plugin to load the executable in to the flash memory. Flash Plugin GUI is available at CCS Debug view -> Tools -> On-chip Flash. By default, the on-chip Flash Plugin erases the flash before programming, generates ECC for the executable and programs it along with the main array flash content and verifies the programmed content. If needed, users can enable blank check - CPU verification to confirm that flash is erased before programming. All of the USER OTP fields (DCSM and boot settings) can be programmed as well using the CCS On-chip Flash Plugin. Checksum calculation feature is also available within the Plugin GUI. Performance of the CCS flash programming is best when using high performance debug probes (XDS200 is suggested).

TI also provides UniFlash, a standalone JTAG based flash programming tool. This has a smaller footprint compared to that of CCS, since it does not include debug support. Users can create device-specific UniFlash package to further reduce the tool size (See Standalone Command Line window in UniFlash after installation). UniFlash offers all the GUI operations that CCS Flash Plugin does.

If the application safety standard requires the ECC generator and the verifier unit to be different, users can use the –ecc options provided in the link step in CCS. This when enabled, linker will generate the ECC image for the flash application and append it at the end of the executable. TI flash tools (CCS and UniFlash) are capable of programming this appended ECC image instead of the default generated Auto ECC. When using the linker ECC option, Auto ECC Generation provided in the TI flash tools should be disabled. Please refer to TMS320C28x Assembly Language Tools guide for more information. Note that TI flash tools do not support programming linker generated ECC for TMS320F28M3x, TMS320F2837x and TMS320F2807x devices.

Customers may also refer to 3rd party programmers like CodeSkin, DATA IO etc. to get flash programming support via serial peripherals like SCI, CAN etc. Elprotronic offers JTAG based C2000 GANG programmers.

TI flash tools and 3rd party flash programmers use Flash API library to perform flash erase and program operations. Flash API library and reference guide for each device are available in C2000Ware at /libraries/flash_api. Flash API library has functions to do flash operations like erase, blank check, program flash and corresponding ECC, program verify, suspend an erase or program operation, resume an erase or program operation, ECC calculation, checksum calculation, remap an ECC address to corresponding main array address etc. Note that ECC is not available for some C2000 devices. Please check Datasheet and TRM for the details. Applications that require erase or program flash at runtime can embed Flash API library to accomplish the same. An example to use Flash API library is provided in C2000Ware (e.g. C2000Ware_x_xx_xx_xx\driverlib\f2838x\examples\c28x\flash\flashapi_ex1_programming).

C2000Ware contains examples to illustrate flash kernels. Flash kernels are used by C2000 devices to provide firmware updates to a system, with a mechanism to switchover to the new firmware through a device reset. C2000Ware examples for flash kernels illustrate how to provide firmware updates over SCI, CAN [DCAN] and MCAN [CAN-FD] peripherals. For example, the C2000Ware flash kernels for the F28003x device can be found in the /driverlib/f28003x/examples/flash sub-directory of the C2000Ware installation. For example, at this path the flash_kernel_ex3_boot.c and flash_kernel_ex3_sci_flash_kernel.c refer to the SCI flash kernel example, flash_kernel_ex4_boot.c and flash_kernel_ex4_can_flash_kernel.c refer to the MCAN (CAN-FD) flash kernel example, flash_kernel_ex5_boot.c and flash_kernel_ex5_dcan_flash_kernel.c refer to the CAN (DCAN) flash kernel example. For more device examples, refer to the device specific paths given in the application note.

Flash kernel user guides centered around these examples are available at SPRABV4, and SPRAD51.

C2000Ware also contains an example to demonstrate EEPROM Emulation using the On-Chip Flash of some Gen 3 C2000 MCUs (F28P65x, F280013x, F280015x). This example allows for EEPROM Emulation, including Read, Write, and Erase. The example provides both Single-Unit and Ping-Pong (between two EEPROM units) implementation models with several user-configurable aspects. For example, the EEPROM Emulation Example for F28P65x can be found in the /driverlib/f28p65x/examples/c28x/flash sub-directory of the C2000Ware installation. There is a separate project for the Single-Unit and Ping-Pong implementation.

An application note detailing the EEPROM Emulation driver is also available at SPRADE8.

Note

TI does not normally distribute the flash API source code nor support development, or modifications, of the flash API by customers. Programming and erase of the flash must be done in a very specific manner. Testing the flash API library involves special test modes accessed by the device during automatic test equipment (ATE). Testing of the library is accomplished by using it in TI development, device testing, write erase cycle qualification, and by all flash programming tools. Modification or rebuilding the API library will not benefit from this testing and thus the restrictions.

In situations where the application is military, aviation, or medical in nature and the user has a justifiable and legitimate need for the source code for certification purposes, it can be provided under a signed license agreement with TI. If users fall into this category, contact your TI sales or distribution representative or post in the TI E2E forum for assistance.