AM263Px MCU+ SDK: SBL JTAG Uniflash

| AM263Px MCU+ SDK 26.00.00 |

SBL JTAG Uniflash

# Introduction

This is a flash-writer example which uses JTAG to write files or erase flash and thereby removes UART dependency. Although it is not strictly a bootloader, it uses flash APIs to be able to flash binaries to the OSPI/QSPI flash. This example performs the following operations.

- Flash the received file at the given offset
- Verify if the data in the received file is present at the given offset
- Erase the entire flash.

Once the example starts running it displays a following menu.

1: Erase Complete Flash
2: Write Application File to Flash and Verify
3: Write XIP File to Flash and Verify
4: Verify Application file in Flash
5: Verify XIP file in Flash
x: Exit
Enter Choice:

After the file is written, verified or flash is erased, an acknowledgment is sent back to the console and the loop continues. This example is more or less like a flashing server, and will terminate until user does not enter 'x'.

# Supported Combinations

Parameter | Value
--- | ---
CPU + OS | r5fss0-0 nortos
Toolchain | ti-arm-clang
Boards | am263px-cc, am263px-lp
Example folder | examples/drivers/boot/sbl_jtag_uniflash

# Steps to Run the Example

- When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
- When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
- Launch a CCS debug session and run the executable sbl_jtag using gels, please refer SOC Initialization Using CCS Scripting
- The example can also be run via CCS with the board in OSPI bootmode. Make sure gel files are disabled while connecting to target. This method can be used when changing bootmode pins is not preferred.

# See Also

BOOTLOADER

# Sample Output

==================
JTAG Uniflash Menu
==================
1: Erase Complete Flash
2: Write Application File to Flash and Verify
3: Write XIP File to Flash and Verify
4: Verify Application file in Flash
5: Verify XIP file in Flash
x: Exit
Enter Choice: 1
[FLASH WRITER] Erasing complete flash ...
[FLASH WRITER] This can take few minutes, so please wait ...
[FLASH WRITER] Erasing complete flash ... SUCCESS !!!
==================
JTAG Uniflash Menu
==================
1: Erase Complete Flash
2: Write Application File to Flash and Verify
3: Write XIP File to Flash and Verify
4: Verify Application file in Flash
5: Verify XIP file in Flash
x: Exit
Enter Choice: 2
Enter file name along with path to write or verify : C:\ti\mcu_plus_sdk_10_02_00\tools\boot\sbl_prebuilt\am263px-cc\sbl_null.release.tiimage
Enter flash offset (in hex format) : 0x0
Enter below command in CCS scripting console to load the file data to memory.
AFTER the file load is done, enter '1' to continue ...\
For CCS Theia, run the below 2 commands
Cortex_R5_0: ___________________________________________________________________________________
Cortex_R5_0: const session=initScripting().openSession(".*")
Cortex_R5_0: session.memory.loadBinary(0x70040020,"C:/sbl_null.release.tiimage");
Cortex_R5_0: ___________________________________________________________________________________
Cortex_R5_0:
Cortex_R5_0:
Cortex_R5_0: For CCS Eclipse, run the below command
Cortex_R5_0: loadRaw(0x70040020, 0, "C:/sbl_null.release.tiimage", 32, false);
1
Cortex_R5_0: [FLASH WRITER] Flashing success!!...
==================
JTAG Uniflash Menu
==================
1: Erase Complete Flash
2: Write Application File to Flash and Verify
3: Write XIP File to Flash and Verify
4: Verify Application file in Flash
5: Verify XIP file in Flash
x: Exit
Enter Choice: 3
Enter file name along with path to write or verify : C:\ti\mcu_plus_sdk_10_02_00\tools\boot\sbl_prebuilt\am263px-cc\sbl_null.release.tiimage
Enter flash offset (in hex format) : 0x0
Enter below command in CCS scripting console to load the file data to memory.
AFTER the file load is done, enter '1' to continue ...\
For CCS Theia, run the below 2 commands
Cortex_R5_0: ___________________________________________________________________________________
Cortex_R5_0: const session=initScripting().openSession(".*")
Cortex_R5_0: session.memory.loadBinary(0x70040020,"C:/sbl_null.release.tiimage");
Cortex_R5_0: ___________________________________________________________________________________
Cortex_R5_0:
Cortex_R5_0:
Cortex_R5_0: For CCS Eclipse, run the below command
Cortex_R5_0: loadRaw(0x70040020, 0, "C:/sbl_null.release.tiimage", 32, false);
1
Cortex_R5_0: [FLASH WRITER] Verifying success!!...
==================
JTAG Uniflash Menu
==================
1: Erase Complete Flash
2: Write Application File to Flash and Verify
3: Write XIP File to Flash and Verify
4: Verify Application file in Flash
5: Verify XIP file in Flash
x: Exit
Enter Choice: x
[FLASH WRITER] Application exited !!!
All tests have passed!!