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.

[FAQ] AM263P4: How to perform flash verification in AM263P.

Part Number: AM263P4
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

It is not only enough to flash images but to verify them is also necessary. Verification allows the user to know if flashing has been done properly.

There are two methods to do this.

1. Using UART flasher. Please visit this link to know more about UART flashing. Refer UART Uniflash section. This program will flash images and verify them as well. 

This method won't be viable as UART peripheral migh not be available in a custom board. Also, this mode would require the user to keep the system in UART boot mode and then shift to OSPI boot mode on subsequent bootup.

2. Using SBL_JTAG_UNIFLASH example.

To perform flashing and verification, the sbl_jtag_uniflash project under examples/drivers/boot/sbl_jtag_uniflash can be used. Using this project the user can flash in both DevBoot mode and OSPI boot mode and perform verification as well.


1. Flashing in Dev Boot Mode using SBL_JTAG_UNIFLASH

The following method can be used to flash the SBL(.tiimage) and application image(.appimage). For demonstration purpose, I have flashed the hello world example's application image.

a. Open the sbl_jtag_uniflash application in Code Composer Studio.

b. Keep the device in Dev Boot mode.

c. Build the application and load the same.

d. The following output can be seen in the console window of code composer studio.

e. Enter 2, and it prompt to enter the filename prefixed with the file path.

d. Press Enter. It will prompt the user to enter the file offset. For application, it would be 0x81000. For SBL, this would be 0x0.

e. After entering the offset and upon pressing enter, a new command will be generated. This command needs to be copied and pasted in scripting console.

f. To open the scripting console, Go to view > other > scripting console.

g. Open the scripting console and paste the generated command.

h. Press enter and return to the console. In console, enter 1 and press enter button.

 .

We can see that application flashing has been successful. 

To perform flash verification, 

i. Enter option 3.

j. The console will ask for the file path and the offset for the application. Once that is done, it will generated a command.

k. Copy and paste the generated command in the scripting console like in step g.

l. In the console, enter 1. The verification message will appear.

j. Now put the device in OSPI boot mode and restart it. The hello world message appears. Thus flashing and verification have been successful.

NOTE: The user is required to flash both the SBL and Application image this way. The offset for SBL is 0x0.

Offset Value - SBL (hex) 0x0
Offset Value - Application(hex) 0x81000

2. Flashing in OSPI Boot Mode using SBL_JTAG_UNIFLASH

Some times it might not be viable to change the boot mode pins. The device might be in OSPI boot mode only. Method 1 is possible because of dev boot mode. In this mode, the GEL scripts will be loaded and required hardware initializations would be done. 

Steps for OSPI boot mode remains largely similar. But the initial steps are different.

it is required to run the load_sbl.js file in tools\ccs_load\am263px in the scripting console. For this

a. Add the mcu_plus_sdk_am263px installation path as an environment variable.

b. Build the sbl_null project in examples/drivers/boot/sbl_null. The script will fetch the sbl_null output files from its path.

c. Now launch a target configuration with no gels. Use the default target configuration of the sbl_jtag_uniflash project. Target configuration window can be opened from View > Other > Target Configurations

          

d. To remove gels, open the target configuration by double clicking on it. Go to the source tab. Select Cortex_R5_0 core and the initialization script text box.

Save the configuration file.

e. Now launch the target configuration. Do not connect to the core.

f. After launching the target configuration, open the scripting console and type the following command below. Once this is done, the following message would be printed in the scripting console

loadJSFile "<load_sbl.js file path>"
For example, 
loadJSFile "C:/ti/mcu_plus_sdk_am263px_10_01_00_34/tools/ccs_load/am263px/load_sbl.js"


g.Once this is done, the following message would be printed in the scripting console

As stated in the image, the SBL has been loaded in RAM.

h. Once loaded, pause the execution by pressing the suspend button(Alt + F8). Do a CPU reset (Alt + Shift +R).


i. Now load the program from Run > Load > Load Program (Cntrl + Alt + L).



j. Now we can see that the program is loaded. It can started by pressing the resume button.



From this point the steps in 1 can be followed. The user is required to boot both the bootloader and application images.



Thus flash verification and flashing of images can be done without changing any boot mode by using the sbl_jtag_uniflash project.