Skip to content

Commit

Permalink
feat!: Update tools document for 10.1 release
Browse files Browse the repository at this point in the history
- Add a new doc for flashing via fastboot using Snagfactory tool.
- Update Flash via Uart doc. This tool will not be packaged in Linux SDK
  and can be picked from MCU PLUS SDK installer.
- DFU tool will not be supported in 10.1 SDK. Remove the doc from configs.

Signed-off-by: Paresh Bhagat <[email protected]>
  • Loading branch information
paresh-bhagat12 authored and jeevantelukula committed Dec 11, 2024
1 parent 9b6b2fc commit 2d3d6de
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 115 deletions.
2 changes: 1 addition & 1 deletion configs/AM62AX/AM62AX_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ linux/Foundational_Components_Filesystem
linux/Foundational_Components_Tools
linux/Foundational_Components/Tools/Development_Tools
linux/Foundational_Components/Tools/Pin_Mux_Tools
linux/Foundational_Components/Tools/Flash_via_DFU
linux/Foundational_Components/Tools/Flash_via_Fastboot
linux/Foundational_Components/Tools/Flash_via_UART
linux/Foundational_Components_IPC62ax
linux/Foundational_Components_Edge_AI
Expand Down
2 changes: 1 addition & 1 deletion configs/AM62PX/AM62PX_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ linux/Foundational_Components_Filesystem
linux/Foundational_Components_Tools
linux/Foundational_Components/Tools/Development_Tools
linux/Foundational_Components/Tools/Pin_Mux_Tools
linux/Foundational_Components/Tools/Flash_via_DFU
linux/Foundational_Components/Tools/Flash_via_Fastboot
linux/Foundational_Components/Tools/Flash_via_Ethernet
linux/Foundational_Components/Tools/Flash_via_UART
linux/Foundational_Components/Tools/GPIO_Tools
Expand Down
2 changes: 1 addition & 1 deletion configs/AM62X/AM62X_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ linux/Foundational_Components_Filesystem
linux/Foundational_Components_Tools
linux/Foundational_Components/Tools/Development_Tools
linux/Foundational_Components/Tools/Pin_Mux_Tools
linux/Foundational_Components/Tools/Flash_via_DFU
linux/Foundational_Components/Tools/Flash_via_Fastboot
linux/Foundational_Components/Tools/Flash_via_Ethernet
linux/Foundational_Components/Tools/Flash_via_UART
linux/Foundational_Components_IPC62x
Expand Down
2 changes: 1 addition & 1 deletion configs/AM64X/AM64X_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ linux/Foundational_Components_Migration_Guide
linux/Foundational_Components_Secure_Boot
linux/Foundational_Components_Filesystem
linux/Foundational_Components_Tools
linux/Foundational_Components/Tools/Flash_via_DFU
linux/Foundational_Components/Tools/Flash_via_Fastboot
linux/Foundational_Components/Tools/Flash_via_Ethernet
linux/Foundational_Components/Tools/Flash_via_UART
linux/Foundational_Components_IPC64x
Expand Down
126 changes: 126 additions & 0 deletions source/linux/Foundational_Components/Tools/Flash_via_Fastboot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
.. include:: /_replacevars.rst

##################
Flash via Fastboot
##################

This application note provides instructions on using Snagfactory tool for flashing.

The Snagfactory tool has two main operations:

* Snagrecover: Boots the board (recovery) using USB DFU.
* Snagflash: Flashes binaries to the on-board memory using the Fastboot protocol.

This tool supports flashing multiple boards simultaneously, enhancing efficiency in producion
enviroment.

********
Get Tool
********

* Snagfactory tool is hosted here `Snagfactory <https://github.com/bootlin/snagboot>`__.
* More info about installation can be found in `Snagfactory Readme <https://github.com/bootlin/snagboot/blob/main/README.md>`__.
* Snagfactory also is available on pip.

.. code-block:: python
python3 -m pip install --user snagboot
*****************************************
Building bootloader binaries for Recovery
*****************************************

For Snagrecover, bootloader images must support DFU boot and fastboot download.
In addition to USB DFU fragment config (which enables DFU boot) for the u-boot
build, an additional fragment config *am6x_a53_snagfactory.config* needs to be
used, which enables fastboot support in U-Boot and other required configs for
snagfactory.

To build bootloader images for recovery using SDK, following change is needed
in :file:`Rules.make` file present in the top level of Linux SDK Installer.

.. ifconfig:: CONFIG_part_variant in ('AM62X')

.. code-block:: make
UBOOT_MACHINE_R5=am62x_evm_r5_defconfig am62x_r5_usbdfu.config
UBOOT_MACHINE_A53=am62x_evm_r5_defconfig am62x_a53_usbdfu.config am6x_a53_snagfactory.config
# For AM62X LP
UBOOT_MACHINE_R5=am62x_lpsk_r5_defconfig am62x_r5_usbdfu.config
UBOOT_MACHINE_A53=am62x_lpsk_a53_defconfig am62x_a53_usbdfu.config am6x_a53_snagfactory.config
# For AM62X SIP
UBOOT_MACHINE_R5=am62xsip_evm_r5_defconfig am62x_r5_usbdfu.config
UBOOT_MACHINE_A53=am62xsip_evm_a53_defconfig am62x_a53_usbdfu.config am6x_a53_snagfactory.config
.. ifconfig:: CONFIG_part_variant in ('AM64X')

.. code-block:: make
UBOOT_MACHINE_R5=am64x_evm_r5_defconfig
UBOOT_MACHINE_A53=am64x_evm_a53_defconfig am6x_a53_snagfactory.config
.. ifconfig:: CONFIG_part_variant in ('AM62AX')

.. code-block:: make
UBOOT_MACHINE_R5=am62ax_evm_r5_defconfig am62x_r5_usbdfu.config
UBOOT_MACHINE_A53=am62ax_evm_a53_defconfig am62x_a53_usbdfu.config am6x_a53_snagfactory.config
.. ifconfig:: CONFIG_part_variant in ('AM62PX')

.. code-block:: make
UBOOT_MACHINE_R5=am62px_evm_r5_defconfig am62x_r5_usbdfu.config
BOOT_MACHINE_A53=am62px_evm_a53_defconfig am62x_a53_usbdfu.config am6x_a53_snagfactory.config
Generate the bootloader images using top-level makefile by running following
commands on the terminal from the top-level of the Linux SDK installer.

.. code-block:: console
$ make u-boot_clean
$ make u-boot
Save the bootloader binaries generated in a separate directory. These bootloader
images will be used for recovery and to start flashing the images. The bootloader
images after make will be generated in the following path.


* :file:`board-support/u-boot_build/r5/tiboot3.bin`
* :file:`board-support/u-boot_build/a53/tispl.bin`
* :file:`board-support/u-boot_build/a53/u-boot.img`

For more details regarding USB DFU refer :ref:`usb-device-firmware-upgrade-label`.

***********
Connections
***********

Power off the EVM and set up the boot mode switches to boot from USB DFU

.. code-block:: text
SW2-11001100
SW3-00000000
Power on the board.

Optionally you can also connect host PC to board via UART to read the console logs.

How to use Snagfactory
**********************

Comprehensive instructions for using the Snagfactory tool can be found here.

* `Snagfactory doc <https://github.com/bootlin/snagboot/blob/main/docs/snagfactory.md>`__.
* `Snagfactory config doc <https://github.com/bootlin/snagboot/blob/main/docs/snagfactory_config.md>`__.
118 changes: 7 additions & 111 deletions source/linux/Foundational_Components/Tools/Flash_via_UART.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,124 +2,20 @@
Flash via UART
##############

UART is used as the transport or interface to send the file to flash to the EVM.
This tool uses UART as the transport or interface to send the file to flash to the EVM.

***************
Important files
***************
The UART Flash tool is part of MCU+SDK installer and can be downloaded from |__SDK_DOWNLOAD_URL__|.

:file:`uart_uniflash.py` is located at :file:`<TI_SDK_PATH>/bin/uart_uniflash/uart_uniflash.py`

Flashing application and example flash configuration files for GP, HS-FS and HS
are located at

.. ifconfig:: CONFIG_part_variant in ('AM64X')

:file:`<TI_SDK_PATH>/bin/uart_uniflash/bin/am64xx-evm/`
Detailed instructions on using the tool can be found in MCU+SDK docs.

.. ifconfig:: CONFIG_part_variant in ('AM62X')

:file:`<TI_SDK_PATH>/bin/uart_uniflash/bin/am62xx-evm/`,
:file:`<TI_SDK_PATH>/bin/uart_uniflash/bin/am62xx-lp-evm/`,
:file:`<TI_SDK_PATH>/bin/uart_uniflash/bin/am62xxsip-evm/`
`MCU+SDK Flash Tools Documentation <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/latest/exports/docs/api_guide_am62x/TOOLS_FLASH.html>`__.

.. ifconfig:: CONFIG_part_variant in ('AM62AX')
.. ifconfig:: CONFIG_part_variant in ('AM64X')

:file:`<TI_SDK_PATH>/bin/uart_uniflash/bin/am62axx-evm/`
`MCU+SDK Flash Tools Documentation <https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am62x/TOOLS_FLASH.html>`__.

.. ifconfig:: CONFIG_part_variant in ('AM62PX')

:file:`<TI_SDK_PATH>/bin/uart_uniflash/bin/am62pxx-evm/`

***********************
Requirements on Host PC
***********************

The tool is implemented using python and needs python version 3.x on Linux host.

The tool uses additional python packages as listed below.

* pyserial for UART access on PC
* xmodem for the file transfer protocol
* tqdm for progress bar when the tool is run

**********************
Getting ready to flash
**********************

Make sure the flashing application and binaries you want to flash is built for the EVM.

Make sure you have installed python version 3.x and additional packages.

Make sure you have identified the UART port on the EVM.

************************
Flash configuration file
************************

Create a flash configuration file, using the example flash configuration file.

The flashing application (1 or 2 stage) needs to be flashed before flashing the
binaries. Refer the flash configuration files for number of stages needed. Also
modify the flash configuration to specify the correct path. Ex. for HS-FS

.. code-block:: text
--flash-writer=<enter path to file>/sbl_uart_uniflash_stage1.release.hs_fs.tiimage
Now edit or add path to your binaries in the flash configuration file and also the offset to be flashed at.
Example.

.. code-block:: text
--file=<path to file>/tiboot3.bin --operation=flash --flash-offset=0x0
.. ifconfig:: CONFIG_part_variant in ('AM62X','AM64X','AM62PX')

**Flash configuration file for flashing to OSPI NOR**

Create a flash configuration file. Refer to :file:`example_sbl_ospi_linux.cfg` for GP
devices, :file:`example_sbl_ospi_linux_hs.cfg` for HS and :file:`example_sbl_ospi_linux_hs_fs.cfg`
for HS-FS.

Specify the paths of flashing application and files to be flashed at which
offset in the flash configuration file.

.. ifconfig:: CONFIG_part_variant in ('AM62AX')

**Flash configuration file for flashing to OSPI NAND**

Create a flash configuration file. Refer to :file:`example_sbl_ospi_nand_linux.cfg`
for GP devices, :file:`example_sbl_ospi_nand_linux_hs.cfg` for HS and :file:`example_sbl_ospi_nand_linux_hs_fs.cfg`
for HS-FS.

Specify the paths of flashing application and files to be flashed at which
offset in the flash configuration file.

******************
Flashing the files
******************

Set EVM in UART BOOT MODE and power on the EVM.

Run below python command on the Windows command prompt (cmd.exe) or Linux bash
shell to flash the files

.. code-block:: console
cd <TI_SDK_PATH>/bin/uart_uniflash/
python uart_uniflash.py -p {name of your UART com port} --cfg={path to your edited config file}
At each step in the flashing your will see success or error messages, including
progress as the file is being transferred.

******************
Flash tool options
******************

Type below to see all the possible options with the flashing tool

.. code-block:: console
cd <TI_SDK_PATH>/bin/uart_uniflash/
python uart_uniflash.py --help
`MCU+SDK Flash Tools Documentation <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/latest/exports/docs/api_guide_am62x/TOOLS_FLASH.html>`__.
1 change: 1 addition & 0 deletions source/linux/Foundational_Components_Tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ find a variety of help on this page.
Foundational_Components/Tools/Pin_Mux_Tools
Foundational_Components/Tools/Code_Composer_Studio
Foundational_Components/Tools/SysConfig_Tools
Foundational_Components/Tools/Flash_via_Fastboot
Foundational_Components/Tools/Flash_via_DFU
Foundational_Components/Tools/Flash_via_Ethernet
Foundational_Components/Tools/Flash_via_UART
Expand Down

0 comments on commit 2d3d6de

Please sign in to comment.