Skip to content

Commit b5583ba

Browse files
committed
fix(tools): update snagboot documentation
update snagboot documentaion with latest additions to the installer and github repo for yaml-configs update accpet.txt with snagboot vocabulary. Signed-off-by: Mahammed Sadik Shaik <s-sadik@ti.com>
1 parent b217c7b commit b5583ba

2 files changed

Lines changed: 124 additions & 48 deletions

File tree

‎.github/styles/config/vocabularies/PSDK/accept.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Zink
3131
[Kk]irkstone
3232
[Mm]ulticast
3333
[Ss]carthgap
34+
[Ss]nagboot
3435
[Tt]oolchain
3536
balenaEtcher
3637
bdebstrap

‎source/linux/Foundational_Components/Tools/Flash_via_Fastboot.rst‎

Lines changed: 123 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,94 @@ enviroment.
1818
Installing Snagfactory
1919
**********************
2020

21+
Install using the SDK installer (recommended)
22+
=============================================
23+
24+
The Linux SDK installer includes a setup script that installs Snagboot and
25+
configures udev rules automatically.
26+
27+
.. code-block:: console
28+
29+
$ cd <sdk_install_dir>
30+
$ ./bin/setup-snagboot.sh
31+
32+
To also install the optional Snagfactory GUI:
33+
34+
.. code-block:: console
35+
36+
$ ./bin/setup-snagboot.sh --gui
37+
38+
The script installs Snagboot by using pip, sets up udev rules so USB access works
39+
without root, and verifies the installation. If pip installs the tools to
40+
:file:`~/.local/bin` but that directory is not on ``PATH``, add the following to :file:`~/.bashrc`:
41+
42+
.. code-block:: console
43+
44+
$ export PATH="$HOME/.local/bin:$PATH"
45+
46+
Manual installation
47+
===================
48+
49+
If the SDK installer is not available, install Snagboot directly by using pip:
50+
2151
* Snagfactory tool is hosted here `Snagfactory <https://github.com/bootlin/snagboot>`__.
2252
* More info about installation can be found in `Snagfactory Readme <https://github.com/bootlin/snagboot/blob/main/README.md>`__.
23-
* Snagfactory also is available on pip.
2453

2554
.. code-block:: console
2655
2756
$ python3 -m pip install --user snagboot
2857
$ python3 -m pip install --user snagboot[gui]
2958
30-
.. note::
59+
After installation, set up udev rules so USB access works without root:
3160

32-
At the time of 11.2 release, the corresponding Snagfactory version was v2.5.
61+
.. code-block:: console
3362
34-
.. ifconfig:: CONFIG_part_variant in ('AM62DX')
63+
$ python3 -m snagrecover --udev | sudo tee /etc/udev/rules.d/80-snagboot.rules
64+
$ sudo udevadm control --reload-rules && sudo udevadm trigger
65+
66+
***************************************
67+
Build boot loader binaries for recovery
68+
***************************************
3569

36-
.. note::
70+
For Snagrecover, boot loader images must support Device Firmware Upgrade (DFU) boot
71+
and fastboot download. The u-boot build requires the USB DFU fragment config to enable
72+
DFU boot. It also requires the additional fragment config
73+
:file:`am6x_a53_snagfactory.config`, that enables fastboot support in U-Boot and other
74+
required configs for :command:`snagfactory`.
3775

38-
AM62DX support was added after v2.3. Refer this `commit <https://github.com/bootlin/snagboot/commit/d5a691b1916207ee674e99620c63cc3a6c3b3a28>`__.
76+
Build using the SDK installer (recommended)
77+
===========================================
3978

40-
*****************************************
41-
Building bootloader binaries for Recovery
42-
*****************************************
79+
The Linux SDK installer includes a dedicated Makefile target that builds
80+
boot loader images with all the required DFU and Fastboot configuration
81+
fragments applied automatically.
4382

44-
For Snagrecover, bootloader images must support DFU boot and fastboot download.
45-
In addition to USB DFU fragment config (which enables DFU boot) for the u-boot
46-
build, an additional fragment config :file:`am6x_a53_snagfactory.config` needs to be
47-
used, which enables fastboot support in U-Boot and other required configs for
48-
snagfactory.
83+
From the top level of the Linux SDK installer:
84+
85+
.. code-block:: console
4986
50-
To build bootloader images for recovery using SDK, following change is needed
51-
in :file:`Rules.make` file present in the top level of Linux SDK Installer.
87+
$ make u-boot-snagboot_clean
88+
$ make u-boot-snagboot
89+
$ make u-boot-snagboot_stage
90+
91+
The build places the staged boot loader images in
92+
:file:`board-support/built-images/snagboot/`. The directory contains:
93+
94+
* :file:`tiboot3.bin` (R5 Secondary Program Loader (SPL), or A53 SPL for AM62L)
95+
* :file:`tispl.bin` (A53 SPL with DFU and fastboot support)
96+
* :file:`u-boot.img` (U-Boot with fastboot support)
97+
98+
.. note::
99+
100+
For AM62L, only the A53 build is needed. The ``u-boot-snagboot`` target
101+
handles this automatically.
102+
103+
Manual build
104+
============
105+
106+
If the SDK installer is not available, apply the required config fragments
107+
manually by editing :file:`Rules.make` in the top level of the Linux SDK and
108+
then running the standard u-boot build.
52109

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

@@ -108,18 +165,15 @@ in :file:`Rules.make` file present in the top level of Linux SDK Installer.
108165
109166
UBOOT_MACHINE=am62lx_evm_defconfig am62x_a53_usbdfu.config am6x_a53_snagfactory.config
110167
111-
Generate the bootloader images using top-level makefile by running following
112-
commands on the terminal from the top-level of the Linux SDK installer.
168+
Then build using the top-level makefile:
113169

114170
.. code-block:: console
115171
116172
$ make u-boot_clean
117173
$ make u-boot
118174
$ make u-boot_stage
119175
120-
Save the bootloader binaries generated in a separate directory. These bootloader
121-
images will be used for recovery and to start flashing the images. The bootloader
122-
images after make can be found in :file:`board-support/built-images`.
176+
The boot loader images are placed in :file:`board-support/built-images`.
123177

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

@@ -183,16 +237,37 @@ Connections
183237
SW3 - BOOTMODE[8:15] = 00000000
184238
185239
* Power on the board.
186-
* Optionally you can also connect host PC to board via UART to read the console logs.
240+
* Optionally you can also connect host PC to board by using UART to read the console logs.
187241

188242
How to use Snagfactory
189-
**********************
243+
======================
190244

191245
Comprehensive instructions for installation of the Snagfactory tool are here:
192246

193247
* `Snagfactory doc <https://github.com/bootlin/snagboot/blob/main/docs/snagfactory.md>`__.
194248
* `Snagfactory config doc <https://github.com/bootlin/snagboot/blob/main/docs/snagfactory_config.md>`__.
195249

250+
YAML configuration files
251+
=========================
252+
253+
Ready-to-use YAML configuration files for all supported platforms are bundled
254+
with the SDK installer under:
255+
256+
.. code-block:: text
257+
258+
<sdk_install_dir>/bin/snagboot_flash/yaml/<board>/
259+
260+
The same configuration files are also available from the TI GitHub repository:
261+
262+
`snagfactory-configs <https://github.com/TexasInstruments/snagfactory-configs>`__
263+
264+
Before using a YAML file, replace the two path placeholders with actual paths
265+
to your binaries:
266+
267+
* ``<path_to_snagboot_binaries>/`` — recovery boot loader images built with
268+
``u-boot-snagboot`` (placed in :file:`board-support/built-images/snagboot/`)
269+
* ``<path_to_flash_binaries>/`` — production images to be written to the
270+
target non-volatile memory
196271

197272
**SnagFactory GUI Tool Configuration and Device Flashing Procedure**
198273

@@ -217,22 +292,22 @@ the SnagFactory GUI tool.
217292
218293
$ snagfactory
219294
220-
**Step 2: Select Configuration File Option**
295+
**Step 2: Select configuration file option**
221296

222297
* Upon launch, the SnagFactory GUI tool will present the option to add a configuration file.
223298
Select the conf option to proceed with loading the configuration file.
224299

225-
**Step 3: Load YAML Configuration File**
300+
**Step 3: Load YAML configuration file**
226301

227302
* Load the YAML configuration file for the platform. This file has the necessary settings
228303
and parameters for the device flashing process.
229304

230-
**Step 4: Flash the Device**
305+
**Step 4: Flash the device**
231306

232307
* Once you load the YAML configuration file, the SnagFactory GUI tool will flash the device with
233308
the specified configuration.
234309

235-
The following table outline the board names for snagfactory yaml configuration.
310+
The following table outlines the board names for :command:`snagfactory` YAML configuration.
236311

237312
.. list-table::
238313
:header-rows: 1
@@ -269,18 +344,18 @@ The example configuration files for **emmc** and **ospi-nand** and **ospi-nor**
269344

270345
For reference, the :file:`ospi-nor.yaml` file for **am62p** platform can be as follows:
271346

272-
.. code-block:: text
347+
.. code-block:: yaml
273348
274349
boards:
275350
0451:6165: am62p
276351
soc-models:
277352
am62p-firmware:
278353
tiboot3:
279-
path: "<path_to_boot_binaries>/tiboot3.bin"
354+
path: "<path_to_snagboot_binaries>/tiboot3.bin"
280355
tispl:
281-
path: "<path_to_boot_binaries>/tispl.bin"
356+
path: "<path_to_snagboot_binaries>/tispl.bin"
282357
u-boot:
283-
path: "<path_to_boot_binaries>/u-boot.img"
358+
path: "<path_to_snagboot_binaries>/u-boot.img"
284359
am62p-tasks:
285360
- eraseblk-size: 0x40000
286361
fb-buffer-addr: 0x82000000
@@ -309,18 +384,18 @@ For reference, the :file:`ospi-nor.yaml` file for **am62p** platform can be as f
309384
310385
For reference, the :file:`ospi-nand.yaml` file for **am62xx-lp** platform can be as follows:
311386

312-
.. code-block:: text
387+
.. code-block:: yaml
313388
314389
boards:
315390
0451:6165: am625
316391
soc-models:
317392
am625-firmware:
318393
tiboot3:
319-
path: "<path_to_boot_binaries>/tiboot3.bin"
394+
path: "<path_to_snagboot_binaries>/tiboot3.bin"
320395
tispl:
321-
path: "<path_to_boot_binaries>/tispl.bin"
396+
path: "<path_to_snagboot_binaries>/tispl.bin"
322397
u-boot:
323-
path: "<path_to_boot_binaries>/u-boot.img"
398+
path: "<path_to_snagboot_binaries>/u-boot.img"
324399
am625-tasks:
325400
- eraseblk-size: 0x40000
326401
fb-buffer-addr: 0x82000000
@@ -357,20 +432,20 @@ For reference, the :file:`ospi-nand.yaml` file for **am62xx-lp** platform can be
357432
- image: "<path_to_flash_binaries>/u-boot.img"
358433
part: ospi_nand.u-boot
359434
360-
For reference, the :file:`emmc.yaml` file for **am62p** platform can be as follows:
435+
For reference, the :file:`emmc.yaml` file for **am62p** platform can be as follows:
361436

362-
.. code-block:: text
437+
.. code-block:: yaml
363438
364439
boards:
365440
"0451:6165": "am62p"
366441
soc-models:
367442
am62p-firmware:
368443
tiboot3:
369-
path: "<path_to_boot_binaries>/tiboot3.bin"
444+
path: "<path_to_snagboot_binaries>/tiboot3.bin"
370445
tispl:
371-
path: "<path_to_boot_binaries>/tispl.bin"
446+
path: "<path_to_snagboot_binaries>/tispl.bin"
372447
u-boot:
373-
path: "<path_to_boot_binaries>/u-boot.img"
448+
path: "<path_to_snagboot_binaries>/u-boot.img"
374449
am62p-tasks:
375450
- target-device: mmc0
376451
fb-buffer-addr: 0x82000000
@@ -394,21 +469,21 @@ For reference, the :file:`emmc.yaml` file for **am62p** platform can be as foll
394469
- image: "<path_to_flash_binaries>/rootfs.ext4"
395470
part: "rootfs"
396471
397-
For reference, the :file:`emmc.yaml` file for **am62l** platform can be as follows:
472+
For reference, the :file:`emmc.yaml` file for **am62l** platform can be as follows:
398473

399-
.. code-block:: text
474+
.. code-block:: yaml
400475
401476
boards:
402477
"0451:6165": "am62l3"
403478
404479
soc-models:
405480
am62l3-firmware:
406481
tiboot3:
407-
path: "<path_to_boot_binaries>/tiboot3.bin"
482+
path: "<path_to_snagboot_binaries>/tiboot3.bin"
408483
tispl:
409-
path: "<path_to_boot_binaries>/tispl.bin"
484+
path: "<path_to_snagboot_binaries>/tispl.bin"
410485
u-boot:
411-
path: "<path_to_boot_binaries>/u-boot.img"
486+
path: "<path_to_snagboot_binaries>/u-boot.img"
412487
413488
am62l3-tasks:
414489
- target-device: mmc0
@@ -438,15 +513,15 @@ For reference, the :file:`emmc.yaml` file for **am62l** platform can be as foll
438513
439514
For eMMC boot configuration, refer :ref:`emmc_boot_config`
440515

441-
**Snagboot Command-line Configuration and Device Flashing Procedure**
516+
**Snagboot command-line configuration and device flashing procedure**
442517

443518
Snagrecover uses vendor-specific ROM code mechanisms to initialize external RAM and run U-Boot, without modifying any non-volatile memories.
444519

445520
.. code-block:: console
446521
447522
$ snagrecover -s am625 -F "{'tiboot3': {'path': 'tiboot3.bin'}}" -F "{'tispl': {'path': 'tispl.bin'}}" -F "{'u-boot': {'path': 'u-boot.img'}}"
448523
449-
* Comprehensive instructions for using snagrecover command line are here:
524+
* Comprehensive instructions for using :command:`snagrecover` command line are here:
450525
`Snagrecover command line <https://github.com/bootlin/snagboot/blob/main/docs/snagrecover.md>`__.
451526

452527
Snagflash communicates with U-Boot to flash system images to non-volatile memories, using either DFU, UMS or Fastboot.
@@ -455,5 +530,5 @@ Snagflash communicates with U-Boot to flash system images to non-volatile memori
455530
456531
$ snagflash -P fastboot-uboot -p 0451:6165 -i
457532
458-
* Comprehensive instructions for using snagflash command line are here:
533+
* Comprehensive instructions for using :command:`snagflash` command line are here:
459534
`Snagflash command line <https://github.com/bootlin/snagboot/blob/main/docs/snagflash.md>`__.

0 commit comments

Comments
 (0)