C2000 MCU prompts “flash is not available on this device” error solution

When using C2000™ MCU products, it is possible that the emulator will report “flash is not available on this device” after the emulator is connected to the target board. The detailed error message is as follows. In fact, the chip itself has Flash.

Author: JOHNSON CHEN

When using C2000™ MCU products, it is possible that the emulator will report “flash is not available on this device” after the emulator is connected to the target board. The detailed error message is as follows. In fact, the chip itself has Flash.

C28xx_CPU1: GEL Output:

RAM initialization done
C28xx_CPU1: GEL Output:
Memory Map Initialization Complete
C28xx_CPU1: GEL Output: … DCSM Initialization Start …
C28xx_CPU1: GEL Output: … DCSM Initialization Done …
C28xx_CPU1: Error initializing flash programming: Interface returned from dll, but flash is not available on this device.

At this time, all operations on the chip Flash (erase, program, verify, read) will report the error shown in Figure 1.

C2000 MCU prompts “flash is not available on this device” error solution
Figure 1

The reason for this may be that the code of the chip Flash is incomplete or has errors, which causes the CPU to work abnormally. Although the emulator can be connected, the chip information read by the emulator may be wrong, resulting in the above error.

If there is no effective way to solve this error, all operations on the chip Flash will be invalid, and only by changing the chip can the board work normally.

This article will take the C2000 F28002x series and CCS11 as examples to introduce two solutions to the “flash is not available on this device” problem. Other C2000 series chips such as F28003x/F28004x/F2837x/F2838x encounter this problem, and you can also use this method to solve this problem.

Method 1: Change the boot mode.

As shown in Figure 2, the boot mode pin jumper is set to Wait Boot Mode, so that the CPU will stay in the internal BOOT ROM area of ​​the chip when powered on, and will not enter the user’s own Flash code.


Figure II

At this time, when the emulator is connected, the chip information can be read normally, and the previous error will not be reported. Next, as shown in Figure 3, we select “Entire Flash” in “Erase Settings” through “ToolsàOn-Chip Flash”, Then click “Erase Flash” to erase the entire Flash of the chip, and the chip will become an empty chip.


Figure 3

Method 2: Change the XML file.

Step 1: Generate CCS logs file.

1a. As shown in Figure 4, click “Help” and then select “CCS Support”.


Figure 4

1b. As shown in Figure 5, select “Debug Server Log”, and then click “Properties”.


Figure 5

1c. As shown in Figure 6, check “Enable Debug Server Logging”, then select the path to store the log file and name it, for example, test.log, then click OK.


Figure 6

1d. Start the CCS simulation, and a log file will be generated.

1f. Open the log file with CCS or a text editor, as shown in Figure 7, find the Device ID, and write down the ID number, such as (0x771923).


Figure 7

Step 2: Change the xml file.

2a. Locate the TMS320F28002x.xml file in the following path. It is recommended to back up this file first, and then use this backup file later.

C: iccs1100ccsccs_basec2000 owFlashconfigs

2b. Open the TMS320F28002x.xml file with a text editor or CCS, as shown in Figure 8, search for DeviceId, and replace the Device ID number recorded in step 1f with the DeviceId value in the TMS320F28002x.xml file. That is, change 0x771973 to 0x771923. Then save the changes and close CCS (remember to close CCS, because the xml changes will only take effect the next time CCS starts).


Figure 8

Step 3: Start CCS and enter the simulation interface.

At this time, CCS no longer reports the previous error, and the Flash can operate normally. Next, we use “ToolsàOn-Chip Flash”, select “Entire Flash” in “Erase Settings”, and then click “Erase Flash” to erase the entire FLASH of the chip, and the chip will become an empty chip.

Step 4: Restore the xml file.

You can restore the TMS320F28002x.xml file backed up in step 2a, or change the DeviceId in the existing TMS320F28002x.xml from 0x771923 to 0x771973.

So far, the chip can operate the Flash normally, and the problem has been solved. Compared with the first method, the advantage of the second method is that it does not require hardware jumpers, which is more convenient for the actual operation of the customer. Also, if the first method doesn’t work, you can also try the second method.

The Links:   LJ640U80 FS100R12KE3