├── .github └── workflows │ └── flowzone.yml ├── .gitignore ├── .versionbot └── CHANGELOG.yml ├── AGX_Orin └── bootloader │ └── uefi_jetson.bin ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── Orin_Flash ├── Dockerfile ├── agx_orin_emulation.md ├── build_and_run.sh ├── flash_orin.sh └── uefi │ └── jetson-orin │ └── uefi_jetson.bin ├── README.md ├── Tegra_Software_License_Agreement-Tegra-Linux.txt ├── assets ├── cbo │ └── cbo.dtb ├── jetson-agx-orin-devkit-assets │ ├── resinOS-flash.xml │ └── resinOS.patch ├── jetson-nano-2gb-devkit-assets │ └── resinOS-flash.xml ├── jetson-nano-emmc-assets │ └── resinOS-flash.xml ├── jetson-nano-qspi-sd-assets │ └── resinOS-flash.xml ├── jetson-tx2-4GB-assets │ └── resinOS-flash.xml ├── jetson-tx2-assets │ └── resinOS-flash.xml ├── jetson-xavier-assets │ └── resinOS-flash.xml ├── jetson-xavier-nx-devkit-assets │ └── resinOS-flash.xml ├── jetson-xavier-nx-devkit-emmc-assets │ └── resinOS-flash.xml └── jetson-xavier-nx-devkit-tx2-nx-assets │ └── resinOS-flash.xml ├── bin └── cmd.js ├── build.sh ├── docker-compose.yml ├── docs ├── cnx100-xavier-nx.md ├── images │ ├── jetson-agx-orin-devkit-64gb.jpg │ ├── jetson-agx-orin-devkit-64gb_recovery.jpg │ ├── jetson-nano-2gb-devkit.png │ ├── jetson-nano-2gb-devkit_rec.png │ ├── jetson-nano-emmc.jpg │ ├── jetson-nano.png │ ├── jetson-nano_rec.png │ ├── jetson-orin-nano-seeed-j3010.jpg │ ├── jetson-orin-nx-seeed-j4012.png │ ├── jetson-orin-nx-seeed-j4012_recovery.jpg │ ├── jetson-orin-nx-xavier-nx-devkit.jpg │ ├── jetson-tx2-nx-devkit.png │ ├── jetson-tx2.png │ ├── jetson-tx2_rec.png │ └── jetson-xavier.jpg ├── jetson-agx-orin-devkit-64gb.md ├── jetson-agx-orin-devkit.md ├── jetson-nano-2gb-devkit.md ├── jetson-nano-emmc.md ├── jetson-nano.md ├── jetson-orin-nano-devkit-nvme.md ├── jetson-orin-nano-seeed-j3010.md ├── jetson-orin-nx-seeed-j4012.md ├── jetson-orin-nx-xavier-nx-devkit.md ├── jetson-tx2-nx-devkit.md ├── jetson-tx2.md ├── jetson-xavier-nx-devkit-emmc.md ├── jetson-xavier-nx-devkit.md ├── jetson-xavier.md ├── jn30b-nano.md ├── photon-nano.md ├── photon-tx2-nx.md └── photon-xavier-nx.md ├── flash.jpg ├── lib ├── resin-jetson-flash.js └── utils.js ├── package.json ├── run_http_server.sh ├── scripts └── resin-image-flasher-unwrap.js └── tests ├── cleanup.js └── index.js /.github/workflows/flowzone.yml: -------------------------------------------------------------------------------- 1 | name: Flowzone 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, closed] 6 | branches: 7 | - "main" 8 | - "master" 9 | - '20[0-9][0-9].[0-1]?[1470].x' 10 | pull_request_target: 11 | types: [opened, synchronize, closed] 12 | branches: 13 | - "main" 14 | - "master" 15 | - '20[0-9][0-9].[0-1]?[1470].x' 16 | 17 | jobs: 18 | flowzone: 19 | name: Flowzone 20 | uses: product-os/flowzone/.github/workflows/flowzone.yml@master 21 | # prevent duplicate workflow executions for pull_request and pull_request_target 22 | if: | 23 | ( 24 | github.event.pull_request.head.repo.full_name == github.repository && 25 | github.event_name == 'pull_request' 26 | ) || ( 27 | github.event.pull_request.head.repo.full_name != github.repository && 28 | github.event_name == 'pull_request_target' 29 | ) 30 | secrets: inherit 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | .nyc_output -------------------------------------------------------------------------------- /AGX_Orin/bootloader/uefi_jetson.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/AGX_Orin/bootloader/uefi_jetson.bin -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file 4 | automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! 5 | This project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | # v0.5.87 8 | ## (2025-03-18) 9 | 10 | * Update all devices to L4T 36.4.3 - JP6 [Alexandru Costache] 11 | 12 | # v0.5.86 13 | ## (2025-02-21) 14 | 15 | * package: Bump ext2fs and balena-image-fs [Alexandru Costache] 16 | 17 | # v0.5.85 18 | ## (2025-01-13) 19 | 20 | * docs: Add flashing instructions for community supported boards [Alexandru Costache] 21 | * jetson-nano: Fix BSP machine in docs [Alexandru Costache] 22 | 23 | # v0.5.84 24 | ## (2024-12-02) 25 | 26 | * flash_orin: Add flag for QSPI direct writing [Alexandru] 27 | 28 | # v0.5.83 29 | ## (2024-11-20) 30 | 31 | * patch: Move all docs to a flat directory structure [Vipul Gupta (@vipulgupta2048)] 32 | 33 | # v0.5.82 34 | ## (2024-10-29) 35 | 36 | * patch: Replace absolute README links with relative [Vipul Gupta (@vipulgupta2048)] 37 | 38 | # v0.5.81 39 | ## (2024-10-25) 40 | 41 | * Update Orin links in various pages [Alan Boris] 42 | 43 | # v0.5.80 44 | ## (2024-10-24) 45 | 46 | * Create device type specific docs for jetson flash [Alan Boris] 47 | 48 | # v0.5.79 49 | ## (2024-10-15) 50 | 51 | * Orin_Flash: Set cvb_eeprom_read_size to 0 prior rcm-boot [Alexandru Costache] 52 | 53 | # v0.5.78 54 | ## (2024-09-23) 55 | 56 | * Update README for non-Docker lz4 package requirement [Ken Bannister] 57 | 58 | # v0.5.77 59 | ## (2024-08-09) 60 | 61 | * README: Update AGX Orin 64GB machine name [Alexandru] 62 | 63 | # v0.5.76 64 | ## (2024-08-09) 65 | 66 | * Add Jetson AGX Orin 64GB Devkit provisioning support [Alexandru Costache] 67 | 68 | # v0.5.75 69 | ## (2024-08-06) 70 | 71 | * README: Update L4T version for Seeed reComputer J3010 and J4012 [Alexandru Costache] 72 | 73 | # v0.5.74 74 | ## (2024-07-16) 75 | 76 | * README: Mention extracted BSP cache path [Alexandru] 77 | 78 | # v0.5.73 79 | ## (2024-07-08) 80 | 81 | * README: Add important note on versions used for production vs draft releases [Alexandru Costache] 82 | * Orin provisioning container: Update Orin NX Devkit and Orin Nano devkit to L4T 36.3 [Alexandru Costache] 83 | 84 | # v0.5.72 85 | ## (2024-06-13) 86 | 87 | * README: Use jetson-flash-image for container tag [Alexandru] 88 | 89 | # v0.5.71 90 | ## (2024-06-11) 91 | 92 | * README: Improve description for Orin Nano/Orin NX flashing [Alexandru] 93 | 94 | # v0.5.70 95 | ## (2024-06-11) 96 | 97 | * README: Clarify USB provisioning method on Jetson TX2 [Alexandru] 98 | 99 | # v0.5.69 100 | ## (2024-06-08) 101 | 102 | * build.sh: Update AGX Orin Devkit BSP URL [Alexandru Costache] 103 | 104 | # v0.5.68 105 | ## (2024-06-06) 106 | 107 | * README: Update L4T version to 35.5.0 in documentation [Alexandru Costache] 108 | * AGX Orin: Use updated QSPI portion of XML [Alexandru Costache] 109 | * lib/resin-jetson-flash: Update AGX Orin 32GB to L4T 35.5.0 [Alexandru Costache] 110 | * Orin Nano/NX: Update BSP to L4T 35.5.0 for flashing [Alexandru Costache] 111 | 112 | # v0.5.67 113 | ## (2024-06-03) 114 | 115 | * Add Seeed reComputer J3010 provisioning support and instruction [Alex Suykov] 116 | 117 | # v0.5.66 118 | ## (2024-05-20) 119 | 120 | * README.md: Fix typo and add VMWare notes [Alexandru] 121 | 122 | # v0.5.65 123 | ## (2024-04-12) 124 | 125 | * AGX Orin: Disable network boot in uefi_jetson.bin [Alexandru Costache] 126 | 127 | # v0.5.64 128 | ## (2024-04-02) 129 | 130 | * Dockerfile: Install lz4 [Alexandru Costache] 131 | 132 | # v0.5.63 133 | ## (2024-02-02) 134 | 135 | * add cache flag to node app [rcooke-warwick] 136 | 137 | # v0.5.62 138 | ## (2024-01-10) 139 | 140 | * README: Clarify provisioning command line for Orin Devices [Alexandru Costache] 141 | 142 | # v0.5.61 143 | ## (2024-01-10) 144 | 145 | * Add Seeed reComputer J4012 provisioning support and instruction [Alexandru Costache] 146 | 147 | # v0.5.60 148 | ## (2023-12-12) 149 | 150 | * remove run command from build script [rcooke-warwick] 151 | * jetson-flash: Pre-fetch BSP archive based on device-type [Alexandru Costache] 152 | 153 | # v0.5.59 154 | ## (2023-11-24) 155 | 156 | * Update README.md [Alexandru Costache] 157 | 158 | # v0.5.58 159 | ## (2023-11-22) 160 | 161 | * Orin NX/Nano: Update to L4T 35.4.1 [Alexandru Costache] 162 | 163 | # v0.5.57 164 | ## (2023-11-16) 165 | 166 | * AGX Orin Devkit: Update to L4T 35.4.1 [Alexandru Costache] 167 | 168 | # v0.5.56 169 | ## (2023-10-09) 170 | 171 | * Orin_Nx_Nano_NVME: Use yocto built uefi firmware for Orin Nano [Alexandru Costache] 172 | 173 | # v0.5.55 174 | ## (2023-10-06) 175 | 176 | * scripts: Copy dispatcher.d scripts for flasher types [Alexandru Costache] 177 | 178 | # v0.5.54 179 | ## (2023-09-20) 180 | 181 | * lib/resin-jetson-flash: Update Xavier NX eMMC to L4T 32.7.3 [Alexandru Costache] 182 | 183 | # v0.5.53 184 | ## (2023-09-20) 185 | 186 | * jetson-nano: Update SD-CARD module to L4T 32.7.3 [Alexandru Costache] 187 | 188 | # v0.5.52 189 | ## (2023-09-19) 190 | 191 | * assets: enable pre expansion of resin-data partition on Nano DTs [Alexandru Costache] 192 | 193 | # v0.5.51 194 | ## (2023-08-14) 195 | 196 | * agx-orin-devkit: Set boot,esp flags for resin-boot partition [Alexandru Costache] 197 | 198 | # v0.5.50 199 | ## (2023-08-07) 200 | 201 | * Orin: Update Orin NX in Xavier NX Devkit to L4T 35.3.1 [Alexandru Costache] 202 | 203 | # v0.5.49 204 | ## (2023-07-31) 205 | 206 | * README: Update Xavier AGX to L4T 32.7.3 [Alexandru Costache] 207 | 208 | # v0.5.48 209 | ## (2023-07-12) 210 | 211 | * README: Update and add Jetson Orin Nano Devkit NVME instructions [Alexandru Costache] 212 | 213 | # v0.5.47 214 | ## (2023-06-02) 215 | 216 | * Update Dockerfile [Eugeny Shcheglov] 217 | 218 | # v0.5.46 219 | ## (2023-06-02) 220 | 221 | * flowzone: Update flowzone.yml [Alexandru Costache] 222 | 223 | # v0.5.45 224 | ## (2023-05-30) 225 | 226 | * Orin NX NVME: Print Tegra BSP License Agreement before entering rcm-boot mode [Alexandru Costache] 227 | * bin/cmd: Include Software License Agreement [Alexandru Costache] 228 | 229 | # v0.5.44 230 | ## (2023-05-05) 231 | 232 | * jetson-agx-orin-devkit: Update to L4T 35.2.1 [Alexandru Costache] 233 | 234 | # v0.5.43 235 | ## (2023-04-07) 236 | 237 | * Orin NX: Add Dockerfile and scripts for provisioning the Orin NX in Xavier NX Devkit NVME [Alexandru Costache] 238 | 239 | # v0.5.42 240 | ## (2023-03-27) 241 | 242 | * README: Remove node 12 references [Alexandru Costache] 243 | 244 | # v0.5.41 245 | ## (2023-03-27) 246 | 247 | * post-test cleanup of artifacts [rcooke-warwick] 248 | * add simple test for artifact generation [rcooke-warwick] 249 | 250 | # v0.5.40 251 | ## (2023-03-24) 252 | 253 | * use local repo content in dockerfile [rcooke-warwick] 254 | * add node 16+ as supported engines in package.json [rcooke-warwick] 255 | * make compatible with node 18 [rcooke-warwick] 256 | 257 | # v0.5.39 258 | ## (2023-03-18) 259 | 260 | * lib: Update TX2 NX Devkit to L4T 32.7.3 [Alexandru Costache] 261 | 262 | # v0.5.38 263 | ## (2023-03-17) 264 | 265 | * lib: Update Jetson Nano eMMC to L4T 32.7.3 [Alexandru Costache] 266 | 267 | # v0.5.37 268 | ## (2023-01-30) 269 | 270 | * Updated README, added Docker folder [alanb128] 271 | 272 | # v0.5.36 273 | ## (2023-01-13) 274 | 275 | * lib: Update Jetson Xavier NX Devkit SD-CARD to L4T 32.7.3 [Alexandru Costache] 276 | 277 | # v0.5.35 278 | ## (2023-01-03) 279 | 280 | * jetson-tx2: Update to L4T 32.7.3 [Alexandru Costache] 281 | 282 | # v0.5.34 283 | ## (2022-12-22) 284 | 285 | * Switch from balenaCI to flowzone [Alexandru Costache] 286 | * lib: Update Jetson Xavier NX Devkit and NX Devkit eMMC to L4T 32.7.2 [Alexandru Costache] 287 | 288 | # v0.5.33 289 | ## (2022-11-17) 290 | 291 | * lib: Update Jetson TX2 to L4T 32.7.2 [Alexandru Costache] 292 | 293 | # v0.5.32 294 | ## (2022-11-09) 295 | 296 | * assets: Set AGX Orin device specific size and partition sizes [Alexandru Costache] 297 | 298 | # v0.5.31 299 | ## (2022-10-25) 300 | 301 | * agx-orin: Add support for flashing Jetson AGX Orin Devkit [Alexandru Costache] 302 | 303 | # v0.5.30 304 | ## (2022-10-20) 305 | 306 | * Document that Tegra flash requires python2 [Felipe Lalanne] 307 | 308 | # v0.5.29 309 | ## (2022-09-29) 310 | 311 | * lib: Update TX2 NX Devkit to 32.7.2 [Alexandru Costache] 312 | * lib: Update Jetson Nano eMMC to L4T 32.7.2 [Alexandru Costache] 313 | 314 | # v0.5.28 315 | ## (2022-07-25) 316 | 317 | * README: Improve provisioning instructions and details [Alexandru Costache] 318 | 319 | # v0.5.27 320 | ## (2022-07-06) 321 | 322 | * lib: Update TX2 to L4T 32.7.1 [Alexandru Costache] 323 | 324 | # v0.5.26 325 | ## (2022-06-13) 326 | 327 | * lib/resin-jetson-flash: Always boot from balenaOS supported mediums [Alexandru Costache] 328 | 329 | # v0.5.25 330 | ## (2022-06-08) 331 | 332 | * lib: Fix typo in Xavier AGX BSP link [Alexandru Costache] 333 | 334 | # v0.5.24 335 | ## (2022-06-05) 336 | 337 | * lib: Update Xavier NX SD-CARD and Xavier NX eMMC to L4T 32.7.1 [Alexandru Costache] 338 | 339 | # v0.5.23 340 | ## (2022-05-21) 341 | 342 | * Update Xavier AGX to L4T 32.7.1 [Alexandru Costache] 343 | 344 | # v0.5.22 345 | ## (2022-05-10) 346 | 347 | * lib/resin-jetson-flash: Update BSP to 32.7.1 for current released boards [Alexandru Costache] 348 | 349 | # v0.5.21 350 | ## (2022-03-22) 351 | 352 | * Update list of devices using L4T 32.6.1 [rmorillo24] 353 | 354 | # v0.5.20 355 | ## (2022-02-16) 356 | 357 | * lib: Update BSP for TX2 32.6.1 [Alexandru Costache] 358 | 359 | # v0.5.19 360 | ## (2022-02-11) 361 | 362 | * lib: Update Xavier AGX BSP to 32.6.1 [Alexandru Costache] 363 | 364 | # v0.5.18 365 | ## (2022-02-07) 366 | 367 | * lib: Update Xavier NX SD and eMMC to L4T 32.6.1 [Alexandru Costache] 368 | 369 | # v0.5.17 370 | ## (2022-01-25) 371 | 372 | * jetson-tx2: Allow specifying odmdata value [Alexandru Costache] 373 | 374 | # v0.5.16 375 | ## (2022-01-19) 376 | 377 | * Xavier AGX: Use bpmp-fw-dtb from the image instead of the default one [Alexandru Costache] 378 | 379 | # v0.5.15 380 | ## (2021-12-17) 381 | 382 | * Update Nano 2GB Devkit to L4T 32.6.1 [Alexandru Costache] 383 | 384 | # v0.5.14 385 | ## (2021-12-16) 386 | 387 | * Update Nano SD, Nano eMMC and TX2 NX to L4T 32.6.1 [Alexandru Costache] 388 | 389 | # v0.5.13 390 | ## (2021-10-08) 391 | 392 | * Nano 2GB Devkit: Add support for writing cloud image to this device type [Alexandru Costache] 393 | * jetson-nano-qspi-sd: Fix flashing Nano SD-CARD [Alexandru Costache] 394 | 395 | # v0.5.12 396 | ## (2021-08-12) 397 | 398 | * Update README [Alexandru Costache] 399 | 400 | # v0.5.11 401 | ## (2021-08-05) 402 | 403 | * Add support for flashing L4T 32.5.1 [Alexandru Costache] 404 | 405 | # v0.5.10 406 | ## (2021-06-01) 407 | 408 | * Add support for TX2 4GB device. [Andrew C. Smith] 409 | 410 | # v0.5.9 411 | ## (2021-04-26) 412 | 413 | * package: Update versions for dependencies [Alexandru Costache] 414 | 415 | # v0.5.8 416 | ## (2021-03-30) 417 | 418 | * scripts: Adapt to renamed flasher images [Alexandru Costache] 419 | 420 | # v0.5.7 421 | ## (2021-03-16) 422 | 423 | * Allow flashing preloaded images [Alexandru Costache] 424 | 425 | # v0.5.6 426 | ## (2021-03-05) 427 | 428 | * Update TX2 based devices to L4T 32.4.4 [Alexandru Costache] 429 | 430 | # v0.5.5 431 | ## (2021-02-22) 432 | 433 | * assets: don't extend last partition [Alexandru Costache] 434 | 435 | # v0.5.4 436 | ## (2021-02-08) 437 | 438 | * Update Xavier based devices to L4T 32.4.4 [Alexandru Costache] 439 | 440 | # v0.5.3 441 | ## (2021-01-28) 442 | 443 | * lib: Update BSP archive fo nano sd and emmc variants to 32.4.4 [Alexandru Costache] 444 | 445 | # v0.5.2 446 | ## (2020-10-28) 447 | 448 | * README: Update devices list [Alexandru Costache] 449 | 450 | # v0.5.1 451 | ## (2020-08-28) 452 | 453 | * balena: Remove resin to balena in README, copyright and console logs [Alexandru Costache] 454 | 455 | # v0.5.0 456 | ## (2020-06-10) 457 | 458 | * jetson: Add flashing support for L4T 32.4.2 [Alexandru Costache] 459 | 460 | ## 0.4.1 - 2020-03-03 461 | 462 | * README: Update with TX2 L4T version notice [Alexandru Costache] 463 | 464 | ## 0.4.0 - 2020-02-03 465 | 466 | * README: Specify supported device types [Alexandru Costache] 467 | * Jetson-tx2: Remove GPTs from assets [Alexandru Costache] 468 | * Jetson-tx2: Add flashing support for L4T 32.2 [Alexandru Costache] 469 | 470 | ## 0.3.0 - 2019-11-14 471 | 472 | * Jetson-nano: Use image RP1 dtb and BMP [Alexandru Costache] 473 | 474 | ## 0.2.0 - 2019-10-03 475 | 476 | * Jetson-xavier: Use image BMP partitions [Alexandru Costache] 477 | * Support Jetson Xavier [Alexandru Costache] 478 | 479 | ## 0.1.0 - 2019-09-25 480 | 481 | * Replicate jetson-nano sd-card layout offsets [Alexandru Costache] 482 | * Support the Nano machine [Theodor Gherzan] 483 | * Only adjust runtime flag's value if it is actually passed to script [Gergely Imreh] 484 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM balenalib/amd64-ubuntu:focal-run-20221210 2 | 3 | WORKDIR /usr/src/app/jetson-flash 4 | 5 | 6 | ARG DEBIAN_FRONTEND=noninteractive 7 | RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && \ 8 | apt-get -yqq install python2 \ 9 | python3 \ 10 | python3-pip \ 11 | usbutils \ 12 | lbzip2 \ 13 | git \ 14 | wget \ 15 | unzip \ 16 | e2fsprogs \ 17 | dosfstools \ 18 | libxml2-utils \ 19 | nodejs \ 20 | xxd \ 21 | lz4 && \ 22 | update-alternatives --install /usr/bin/python python /usr/bin/python2 1 && \ 23 | pip3 install pyyaml 24 | 25 | ARG bsp_url 26 | ARG device_type 27 | COPY . /usr/src/app/jetson-flash 28 | 29 | RUN npm install 30 | 31 | RUN wget "$bsp_url" -O "/tmp/Linux_for_Tegra.tbz2" && tar -xvf "/tmp/Linux_for_Tegra.tbz2" -C "/tmp/" && rm /tmp/Linux_for_Tegra.tbz2 32 | 33 | CMD ["./run_http_server.sh"] 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Orin_Flash/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM balenalib/amd64-ubuntu:focal-run-20221210 2 | 3 | ENV DEBIAN_FRONTEND noninteractive 4 | WORKDIR /usr/src/app/orin-flash 5 | 6 | # Install dependencies 7 | RUN \ 8 | apt update && apt install -y python2 python3 python3-pip usbutils curl lbzip2 git wget unzip e2fsprogs dosfstools libxml2-utils && \ 9 | update-alternatives --install /usr/bin/python python /usr/bin/python2 1 && \ 10 | pip3 install pyyaml 11 | 12 | # Unpack BSP archive used for balenaOS kernel rcmboot 13 | RUN echo "Downloading BSP archive" && mkdir orin && wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.3/release/Jetson_Linux_r36.4.3_aarch64.tbz2 -O orin/jetson_linux_r36.4.3_aarch64.tbz2 && cd orin && tar xf jetson_linux_r36.4.3_aarch64.tbz2 && \ 14 | cd Linux_for_Tegra/ && ./tools/l4t_flash_prerequisites.sh 15 | 16 | COPY ./uefi/jetson-orin/uefi_jetson.bin /usr/src/app/orin-flash/orin/Linux_for_Tegra/bootloader/uefi_jetson.bin 17 | # Copy rcmboot script inside the Docker image 18 | COPY ./flash_orin.sh /usr/src/app/orin-flash/ 19 | RUN chmod +x /usr/src/app/orin-flash/flash_orin.sh 20 | 21 | CMD ["sleep", "infinity"] 22 | -------------------------------------------------------------------------------- /Orin_Flash/agx_orin_emulation.md: -------------------------------------------------------------------------------- 1 | ## Emulation with the Jetson AGX Orin Development Kit 2 | 3 | The Orin NX 8GB and 16GB can be emulated during flashing of the Jetson AGX Orin Devkit using this jetson-flash branch: [https://github.com/balena-os/jetson-flash/commits/orin_nx_emulation_on_agx_orin_devkit](https://github.com/balena-os/jetson-flash/commits/orin_nx_emulation_on_agx_orin_devkit) 4 | 5 | An example command for flashing the emulated configuration is: 6 | ``` 7 | sudo bin/cmd.js -m jetson-agx-orin-devkit-as-nx-16gb -f 8 | ``` 9 | 10 | Important notes on Orin NX emulation: 11 | 12 | - The same Balena AGX Orin Devkit image is used while flashing an emulated Orin NX, thus the cloud will report a Jetson AGX Orin Devkit device type. However, lscpu will report different numbers of CPUs for the emulated devices. Similarly, `cat /proc/device-tree/nvidia,dtsfilename` will report a different device-tree for each configuration. 13 | - For the Orin NX 8GB emulation, after flashing is completed, it's necessary to edit the file /mnt/sysroot/active/current/boot/extlinux/extlinux.conf and add "mem=8G" (unquoted) to the APPEND element, for example: " ... sdhci_tegra.en_boot_part_access=1 rootwait mem=8G". Once the extlinux.conf file is modified and saved, the device should be rebooted for the available RAM configuration to take effect. 14 | - The emulated configuration is used only during provisioning and is not preserved after a host operating system OTA update. 15 | - These configurations should be used for testing purposes only, and they should never be used to provision production devices 16 | - Cloud support for Orin NX machines can only be evaluated after the hardware is available and the upstream Yocto BSP (meta-tegra) adds support for them. 17 | 18 | Depending on the device used, the machine used will be one of: 19 | - jetson-agx-orin-devkit-64-nvme 20 | - jetson-orin-nx-xavier-nx-devkit 21 | - jetson-orin-nano-devkit-nvme 22 | - jetson-orin-nx-seeed-j4012 23 | - jetson-orin-nano-seeed-j3010 24 | -------------------------------------------------------------------------------- /Orin_Flash/build_and_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Build Dockerfile 4 | docker build -t orin-image . 5 | 6 | # Run resulting Docker image. The balenaOS image downloaded from balena-cloud is expected to exist in the HOST, inside ~/images. That directory will be bind-mounted inside the running container in /data/images/ 7 | docker container run --rm -it --privileged -v /dev/:/dev/ -v ~/images:/data/images orin-image /bin/bash 8 | -------------------------------------------------------------------------------- /Orin_Flash/flash_orin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | balena_image_flasher_root_mnt="/tmp/flash-rootA" 6 | balena_image_loop_dev="" 7 | lt_dir="Linux_for_Tegra" 8 | device_dir="orin/" 9 | work_dir="/usr/src/app/orin-flash/" 10 | accept_license="" 11 | 12 | function log { 13 | case $1 in 14 | ERROR) 15 | loglevel=ERROR 16 | shift 17 | ;; 18 | WARN) 19 | loglevel=WARNING 20 | shift 21 | ;; 22 | *) 23 | loglevel=LOG 24 | ;; 25 | esac 26 | printf "%s%s\n" "[$loglevel] " "$1" 27 | if [ "$loglevel" == "ERROR" ]; then 28 | exit 1 29 | fi 30 | } 31 | 32 | function help() { 33 | echo "Provisioning can be started by typing:" 34 | echo " $ ./flash_orin.sh -f /data/images/ -m --accept-license yes" 35 | echo "where can be one of" 36 | echo " jetson-agx-orin-devkit-64gb" 37 | echo " jetson-orin-nx-xavier-nx-devkit" 38 | echo " jetson-orin-nano-devkit-nvme" 39 | echo " jetson-orin-nano-seeed-j3010" 40 | echo " jetson-orin-nx-seeed-j4012" 41 | } 42 | 43 | # Parse arguments 44 | while [[ $# -gt 0 ]]; do 45 | arg="$1" 46 | case $arg in 47 | -h|--help) 48 | help 49 | exit 0 50 | ;; 51 | -m|--machine) 52 | if [ -z "$2" ]; then 53 | log ERROR "\"$1\" argument needs a value." 54 | fi 55 | balena_device_name=$2 56 | shift 57 | ;; 58 | -f|--balena-image-flasher) 59 | if [ -z "$2" ]; then 60 | log ERROR "\"$1\" argument needs a value." 61 | fi 62 | balena_image_flasher=$2 63 | shift 64 | ;; 65 | -l|--accept-license) 66 | if [ -z "$2" ]; then 67 | log ERROR "\"$1\" argument needs a value, which can be 'yes' or 'no'" 68 | fi 69 | accept_license=$2 70 | shift 71 | ;; 72 | *) 73 | echo "Unrecognized option $1." 74 | help 75 | exit 1 76 | ;; 77 | esac 78 | shift 79 | done 80 | 81 | 82 | if [[ $balena_device_name = "jetson-orin-nano-devkit-nvme" ]]; then 83 | device_type="jetson-orin-nano-devkit" 84 | device_dtb="tegra234-p3768-0000+p3767-0005-nv-super.dtb" 85 | elif [[ $balena_device_name = "jetson-orin-nano-seeed-j3010" ]]; then 86 | device_type="jetson-orin-nano-devkit-super" 87 | device_dtb="tegra234-p3768-0000+p3767-0004-nv-super.dtb" 88 | elif [[ $balena_device_name = "jetson-orin-nx-xavier-nx-devkit" ]] || [[ $balena_device_name = "jetson-orin-nx-seeed-j4012" ]]; then 89 | device_type="p3509-a02-p3767-0000" 90 | device_dtb="tegra234-p3768-0000+p3767-0000-nv.dtb" 91 | elif [[ $balena_device_name = "jetson-agx-orin-devkit-64gb" ]]; then 92 | device_type="jetson-agx-orin-devkit" 93 | device_dtb="tegra234-p3737-0000+p3701-0005.dtb" 94 | else 95 | log ERROR "Unknown or unspecified device-type!" 96 | fi 97 | 98 | cleanup () { 99 | exit_code=$? 100 | umount $balena_image_flasher_root_mnt > /dev/null 2>&1 || true 101 | losetup -d $balena_image_flasher_loop_dev > /dev/null 2>&1 || true 102 | losetup -D 103 | if [[ $exit_code -eq 0 ]]; then 104 | log "Once the device's fan starts spinning USB provisioning is started." 105 | log "The internal flashing process takes around 5-10 minutes as the internal QSPI memory is flashed, please wait for the device to finish provisioning and to power itself off." 106 | log "Once power LED turns off, remove the force recovery jumper if applicable as well as the provisioning USB KEY, then power on the device." 107 | fi 108 | } 109 | 110 | # Minimal changes needed to boot balenaOS kernel with the BSP flasher tools. 111 | # Once the kernel starts running, it will boot the flasher image on the USB stick plugged in the Orin NX and Orin Nano. 112 | function setup_orin_rcmboot() { 113 | echo "" > "${device_dir}${lt_dir}/bootloader/l4t_initrd.img" 114 | echo "" > "${device_dir}${lt_dir}/tools/ota_tools/version_upgrade/recovery_copy_binlist.txt" 115 | echo "" > "${device_dir}${lt_dir}/tools/ota_tools/version_upgrade/ota_make_recovery_img_dtb.sh" 116 | cp "${device_dir}${lt_dir}/kernel/dtb/${device_dtb}" "${device_dir}${lt_dir}/bootloader/${device_dtb}.rec" 117 | echo " " > "${device_dir}${lt_dir}/bootloader/recovery.img" 118 | mkdir -p "${device_dir}${lt_dir}/rootfs/boot/extlinux/" 119 | echo " " > "${device_dir}${lt_dir}/rootfs/boot/extlinux/extlinux.conf" 120 | sed -i 's/console=tty0/root=LABEL=flash-rootA flasher rootdelay=1 debug loglevel=7 roottimeout=360 jf_rcm_boot=1 /g' "${device_dir}${lt_dir}/p3767.conf.common" 121 | sed -i 's/console=tty0/root=LABEL=flash-rootA flasher rootdelay=1 debug loglevel=7 roottimeout=360 jf_rcm_boot=1 /g' "${device_dir}${lt_dir}/p3701.conf.common" 122 | # tegra234-mb2-bct-common.dtsi for AGX Orin and tegra234-mb2-bct-misc-p3767-0000.dts for Orin NX/Nano carrier boards which don't have eeproms 123 | sed -i 's/cvb_eeprom_read_size = <0x100>/cvb_eeprom_read_size = <0x0>/g' "${device_dir}${lt_dir}/bootloader/tegra234-mb2-bct-common.dtsi" 124 | sed -i 's/cvb_eeprom_read_size = <0x100>/cvb_eeprom_read_size = <0x0>/g' "${device_dir}${lt_dir}/bootloader/generic/BCT/tegra234-mb2-bct-misc-p3767-0000.dts" 125 | if [[ $balena_device_name = "jetson-orin-nx-xavier-nx-devkit" ]] || [[ $balena_device_name = "jetson-orin-nx-seeed-j4012" ]] || [[ $balena_device_name = "jetson-orin-nano-seeed-j3010" ]]; then 126 | sed -i 's/flash_t234_qspi_sd.xml/flash_t234_qspi.xml/g' "${device_dir}${lt_dir}/p3768-0000-p3767-0000-a0.conf" 127 | fi 128 | } 129 | 130 | trap cleanup EXIT SIGHUP SIGINT SIGTERM 131 | 132 | # Unpack BSP archive if the Linux_for_Tegra has been removed 133 | if [ ! -d ${work_dir}/${device_dir}/${lt_dir} ]; then 134 | tar xf *.tbz2 135 | fi 136 | 137 | cat "${work_dir}/${device_dir}/${lt_dir}/Tegra_Software_License_Agreement-Tegra-Linux.txt" 138 | log "Above license agreement can be consulted at https://developer.download.nvidia.com/embedded/L4T/r36_Release_v4.3/release/Tegra_Software_License_Agreement-Tegra-Linux.txt?t=eyJscyI6ImdzZW8iLCJsc2QiOiJodHRwczovL3d3dy5nb29nbGUuY29tLyJ9" 139 | 140 | if [ "$accept_license" != "yes" ]; then 141 | echo "Accept the above License Agreement? Type yes/no:" 142 | read accept_license 143 | if [ "$accept_license" != "yes" ]; then 144 | log ERROR "License agreement must be accepted to use this tool" 145 | fi 146 | fi 147 | 148 | # Extract balenaOS kernel from the flasher image and place it inside the BSP folder to be loaded by tegra rcmboot 149 | balena_image_flasher_loop_dev="$(losetup -fP --show "$balena_image_flasher")" 150 | mkdir -p $balena_image_flasher_root_mnt > /dev/null 2>&1 || true 151 | mount "${balena_image_flasher_loop_dev}p2" "$balena_image_flasher_root_mnt" #> /dev/null 2>&1 152 | rm "${work_dir}/${device_dir}${lt_dir}/bootloader/boot0.img" || true 153 | cp "${balena_image_flasher_root_mnt}/boot/Image" "${device_dir}/${lt_dir}/kernel/Image" 154 | log "Kernel image has been extracted and the BSP kernel has been replaced with the one in balenaOS" 155 | 156 | setup_orin_rcmboot 157 | 158 | # Prepare boot binaries. We use mmcblk0p1 as a dummy root to make the flash.sh script happy. This argument is not used during actual flashing. 159 | # p3509-a02+p3767-0000 is the machine name used for the Orin NX in Xavier NX Devkit carrier board. 160 | cd "${work_dir}/${device_dir}${lt_dir}" 161 | sudo ./flash.sh --no-flash $device_type mmcblk0p1 162 | sudo ./flash.sh --rcm-boot $device_type mmcblk0p1 163 | -------------------------------------------------------------------------------- /Orin_Flash/uefi/jetson-orin/uefi_jetson.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/Orin_Flash/uefi/jetson-orin/uefi_jetson.bin -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jetson-flash 2 | A set of tools that allows users to flash balenaOS on supported Jetson devices. 3 | 4 | 5 | 6 | ## About 7 | Jetson Flash will extract the balenaOS image from a downloaded provisioned image (such as from balenaCloud) and then flash that image to a Jetson board connected to a host PC via USB. 8 | 9 | This tool invokes NVIDIA’s proprietary software to properly partition the boot media (such as eMMC) and place the required balenaOS software in the necessary location to make it bootable. Even on Jetson boards without eMMC, this tool may be necessary to initially flash balenaOS because of the way JetPack uses onboard QSPI flash memory for the bootloader. (In those cases, this tool can write to the QSPI so the device will be able to boot balenaOS from the SD card.) 10 | 11 | ## Instructions 12 | 13 | Choose your device from the list below for step-by-step instructions: 14 | 15 | |Device | Current L4T version | 16 | |-------|---------------------| 17 | |[Auvidea CNX100 Xavier NX](./docs/cnx100-xavier-nx.md) | L4T 32.5.1 | 18 | |[Auvidea JN30B Nano](./docs/jn30b-nano.md) | L4T 32.7.2 | 19 | |[CTI Photon Nano](./docs/photon-nano.md) | L4T 32.7.3 | 20 | |[CTI Photon TX2 NX](./docs/photon-tx2-nx.md) | L4T 32.7.2 | 21 | |[CTI Photon Xavier NX](./docs/photon-xavier-nx.md) | L4T 32.7.3 | 22 | |[Jetson Nano eMMC](./docs/jetson-nano-emmc.md) | L4T 32.7.3 | 23 | |[Jetson Nano SD-CARD Devkit](./docs/jetson-nano.md) | L4T 32.7.3 | 24 | |[Jetson Nano 2GB Devkit](./docs/jetson-nano-2gb-devkit.md) | L4T 32.7.1 | 25 | |[Jetson TX2](./docs/jetson-tx2.md) | L4T 32.7.3 | 26 | |[Jetson TX2 NX (in Jetson Xavier NX Devkit)](./docs/jetson-tx2-nx-devkit.md) | L4T 32.7.3 | 27 | |[Jetson AGX Xavier](./docs/jetson-xavier.md) | L4T 32.7.3 | 28 | |[Jetson Xavier NX Devkit eMMC](./docs/jetson-xavier-nx-devkit-emmc.md) | L4T 32.7.3 | 29 | |[Jetson Xavier NX Devkit SD-CARD](./docs/jetson-xavier-nx-devkit.md) | L4T 32.7.3 | 30 | |[Jetson AGX Orin Devkit 32GB](./docs/jetson-agx-orin-devkit.md) | L4T 36.4.3 | 31 | |[Jetson AGX Orin Devkit 64GB](./docs/jetson-agx-orin-devkit-64gb.md) | L4T 36.4.3 | 32 | |[Jetson Orin Nano 8GB (SD) Devkit NVME](./docs/jetson-orin-nano-devkit-nvme.md) | L4T 36.4.3 | 33 | |[Jetson Orin NX in Xavier NX Devkit NVME](./docs/jetson-orin-nx-xavier-nx-devkit.md) | L4T 36.4.3 | 34 | |[Seeed reComputer J3010 4GB](./docs/jetson-orin-nano-seeed-j3010.md) | L4T 36.4.3 | 35 | |[Seeed reComputer J4012 16GB](./docs/jetson-orin-nx-seeed-j4012.md) | L4T 36.4.3 | 36 | 37 | **Don't see your device listed?** 38 | - Use the closest match above to the Jetson module on your carrier board 39 | - Reach out to us on the [balena Forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) 40 | 41 | License 42 | ------- 43 | 44 | The project is licensed under the Apache 2.0 license. 45 | 46 | Photo by Mélody P on Unsplash 47 | 48 | -------------------------------------------------------------------------------- /Tegra_Software_License_Agreement-Tegra-Linux.txt: -------------------------------------------------------------------------------- 1 | License For Customer Use of NVIDIA Software 2 | 3 | 4 | IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of 5 | NVIDIA Software ("LICENSE") is the agreement which governs use of 6 | the software of NVIDIA Corporation and its subsidiaries ("NVIDIA") 7 | downloadable herefrom, including computer software and associated 8 | printed materials ("SOFTWARE"). By downloading, installing, copying, 9 | or otherwise using the SOFTWARE, you agree to be bound by the terms 10 | of this LICENSE. If you do not agree to the terms of this LICENSE, 11 | do not download the SOFTWARE. 12 | 13 | RECITALS 14 | 15 | Use of NVIDIA's products requires three elements: the SOFTWARE, the 16 | hardware on a graphics controller board, and a personal computer. The 17 | SOFTWARE is protected by copyright laws and international copyright 18 | treaties, as well as other intellectual property laws and treaties. 19 | The SOFTWARE is not sold, and instead is only licensed for use, 20 | strictly in accordance with this document. The hardware is protected 21 | by various patents, and is sold, but this agreement does not cover 22 | that sale, since it may not necessarily be sold as a package with 23 | the SOFTWARE. This agreement sets forth the terms and conditions 24 | of the SOFTWARE LICENSE only. 25 | 26 | 1. DEFINITIONS 27 | 28 | 1.1 Customer. Customer means the entity or individual that 29 | downloads the SOFTWARE. 30 | 31 | 2. GRANT OF LICENSE 32 | 33 | 2.1 Rights and Limitations of Grant. NVIDIA hereby grants Customer 34 | the following non-exclusive, non-transferable right to use the 35 | SOFTWARE, with the following limitations: 36 | 37 | 2.1.1 Rights. Customer may install and use multiple copies of the 38 | SOFTWARE on a shared computer or concurrently on different computers, 39 | and make multiple back-up copies of the SOFTWARE, solely for Customer's 40 | use within Customer's Enterprise. "Enterprise" shall mean individual use 41 | by Customer or any legal entity (such as a corporation or university) 42 | and the subsidiaries it owns by more than fifty percent (50%). 43 | 44 | 2.1.2 Linux/FreeBSD Exception. Notwithstanding the foregoing terms 45 | of Section 2.1.1, SOFTWARE designed exclusively for use on the Linux or 46 | FreeBSD operating systems, or other operating systems derived from the 47 | source code to these operating systems, may be copied and redistributed, 48 | provided that the binary files thereof are not modified in any way 49 | (except for unzipping of compressed files). 50 | 51 | 2.1.3 Limitations. 52 | 53 | No Reverse Engineering. Customer may not reverse engineer, 54 | decompile, or disassemble the SOFTWARE, nor attempt in any other 55 | manner to obtain the source code. 56 | 57 | No Separation of Components. The SOFTWARE is licensed as a 58 | single product. Its component parts may not be separated for use 59 | on more than one computer, nor otherwise used separately from the 60 | other parts. 61 | 62 | No Rental. Customer may not rent or lease the SOFTWARE to someone 63 | else. 64 | 65 | 3. TERMINATION 66 | 67 | This LICENSE will automatically terminate if Customer fails to 68 | comply with any of the terms and conditions hereof. In such event, 69 | Customer must destroy all copies of the SOFTWARE and all of its 70 | component parts. 71 | 72 | Defensive Suspension. If Customer commences or participates in any legal 73 | proceeding against NVIDIA, then NVIDIA may, in its sole discretion, 74 | suspend or terminate all license grants and any other rights provided 75 | under this LICENSE during the pendency of such legal proceedings. 76 | 77 | 4. COPYRIGHT 78 | 79 | All title and copyrights in and to the SOFTWARE (including but 80 | not limited to all images, photographs, animations, video, audio, 81 | music, text, and other information incorporated into the SOFTWARE), 82 | the accompanying printed materials, and any copies of the SOFTWARE, 83 | are owned by NVIDIA, or its suppliers. The SOFTWARE is protected 84 | by copyright laws and international treaty provisions. Accordingly, 85 | Customer is required to treat the SOFTWARE like any other copyrighted 86 | material, except as otherwise allowed pursuant to this LICENSE 87 | and that it may make one copy of the SOFTWARE solely for backup or 88 | archive purposes. 89 | 90 | 5. APPLICABLE LAW 91 | 92 | This agreement shall be deemed to have been made in, and shall be 93 | construed pursuant to, the laws of the State of California. 94 | 95 | 6. DISCLAIMER OF WARRANTIES AND LIMITATION ON LIABILITY 96 | 97 | 6.1 No Warranties. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE 98 | LAW, THE SOFTWARE IS PROVIDED "AS IS" AND NVIDIA AND ITS SUPPLIERS 99 | DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT 100 | NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 101 | FOR A PARTICULAR PURPOSE. 102 | 103 | 6.2 No Liability for Consequential Damages. TO THE MAXIMUM 104 | EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL NVIDIA OR 105 | ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR 106 | CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, 107 | DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS 108 | OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT 109 | OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF NVIDIA HAS 110 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 111 | 112 | 6.3 Specific Use. SOFTWARE is licensed only for use with NVIDIA products. 113 | Customer's use of NVIDIA products with any other firmware is at its own 114 | risk and may cause an NVIDIA product to become non-compliant with certain 115 | of its certification markings. 116 | 117 | 7. MISCELLANEOUS 118 | 119 | The United Nations Convention on Contracts for the International 120 | Sale of Goods is specifically disclaimed. If any provision of this 121 | LICENSE is inconsistent with, or cannot be fully enforced under, 122 | the law, such provision will be construed as limited to the extent 123 | necessary to be consistent with and fully enforceable under the law. 124 | This agreement is the final, complete and exclusive agreement between 125 | the parties relating to the subject matter hereof, and supersedes 126 | all prior or contemporaneous understandings and agreements relating 127 | to such subject matter, whether oral or written. Customer agrees 128 | that it will not ship, transfer or export the SOFTWARE into any 129 | country, or use the SOFTWARE in any manner, prohibited by the 130 | United States Bureau of Export Administration or any export laws, 131 | restrictions or regulations. This LICENSE may only be modified in 132 | writing signed by an authorized officer of NVIDIA. 133 | 134 | -------------------------------------------------------------------------------- /assets/cbo/cbo.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/assets/cbo/cbo.dtb -------------------------------------------------------------------------------- /assets/jetson-agx-orin-devkit-assets/resinOS.patch: -------------------------------------------------------------------------------- 1 | --- deviceAssetsPath/flash_t234_qspi_sdmmc.xml 2024-06-22 10:29:48.651223772 +0300 2 | +++ deviceAssetsPath/resinOS-flash.xml 2024-06-22 10:35:29.517076263 +0300 3 | @@ -615,7 +615,7 @@ 4 | 0 5 | 6 | 7 | - 8 | + 9 | 10 | sequential 11 | basic 12 | @@ -632,148 +632,93 @@ 13 | 8 14 | 0 15 | 16 | - 17 | + 18 | sequential 19 | basic 20 | 134217728 21 | 0 22 | 8 23 | 0 24 | - LNXFILE 25 | 26 | - 27 | + 28 | sequential 29 | basic 30 | - 786432 31 | + 393216 32 | 0 33 | 8 34 | 0 35 | - DTB_FILE 36 | 37 | - 38 | - sequential 39 | - basic 40 | - 33161216 41 | - 0 42 | - 8 43 | - 0 44 | - 45 | - 46 | + 47 | sequential 48 | basic 49 | 134217728 50 | 0 51 | 8 52 | 0 53 | - LNXFILE 54 | - 55 | - 56 | - sequential 57 | - basic 58 | - 786432 59 | - 0 60 | - 8 61 | - 0 62 | - DTB_FILE 63 | - 64 | - 65 | - sequential 66 | - basic 67 | - 33161216 68 | - 0 69 | - 8 70 | - 0 71 | 72 | - 73 | + 74 | sequential 75 | basic 76 | - RECSIZE 77 | + 393216 78 | 0 79 | 8 80 | 0 81 | - RECFILE 82 | - 83 | - 84 | - sequential 85 | - basic 86 | - 524288 87 | - 0 88 | - 8 89 | - 0 90 | - RECDTB-FILE 91 | 92 | 93 | sequential 94 | basic 95 | - 67108864 96 | + 70496256 97 | 0 98 | 0x8 99 | 0 100 | - ESP_FILE 101 | - C12A7328-F81F-11D2-BA4B-00A0C93EC93B 102 | **Required.** EFI system partition with L4T Launcher. 103 | 104 | - 105 | - sequential 106 | - basic 107 | - RECSIZE 108 | - 0 109 | - 8 110 | - 0 111 | - 112 | - 113 | + 114 | sequential 115 | basic 116 | - 524288 117 | + 41943040 118 | 0 119 | - 8 120 | + 0x8 121 | + FILENAME 122 | + C12A7328-F81F-11D2-BA4B-00A0C93EC93B 123 | 0 124 | 125 | - 126 | + 127 | sequential 128 | basic 129 | - 67108864 130 | + 1027604480 131 | 0 132 | - 0x8 133 | + 0x8 134 | + FILENAME 135 | 0 136 | - **Required.** EFI system partition for fail-safe ESP update. 137 | - 138 | - 139 | + 140 | + 141 | sequential 142 | basic 143 | - 419430400 144 | + 1027604480 145 | 0 146 | - 8 147 | + 0x8 148 | + FILENAME 149 | 0 150 | - 16384 151 | - **Required.** This partition may be mounted and used to store user 152 | - data. 153 | 154 | - 155 | + 156 | sequential 157 | basic 158 | - 502792192 159 | + 20971520 160 | 0 161 | - 8 162 | + 0x8 163 | + FILENAME 164 | 0 165 | - **Required.** Reserve space in case there is any partition change 166 | - required in the future, for example, adding new partitions or increasing size 167 | - of some partitions. 168 | 169 | - 170 | + 171 | sequential 172 | basic 173 | - APPSIZE 174 | + FILESIZE 175 | 0 176 | - 0x808 177 | - 16384 178 | + 0x808 179 | + FILENAME 180 | 0 181 | - APPUUID 182 | - APPFILE 183 | - **Required.** Contains the rootfs. This partition must be assigned 184 | - the "1" for id as it is physically put to the end of the device, so that it 185 | - can be accessed as the fixed known special device `/dev/mmcblk0p1`. 186 | - 187 | + 188 | 189 | sequential 190 | basic 191 | -------------------------------------------------------------------------------- /assets/jetson-nano-emmc-assets/resinOS-flash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | sequential 9 | basic 10 | 262144 11 | 0 12 | 8 13 | 0 14 | 15 | 16 | 17 | sequential 18 | basic 19 | 196608 20 | 0 21 | 8 22 | 0 23 | NVCFILE 24 | 25 | 26 | 27 | sequential 28 | basic 29 | 65536 30 | 0 31 | 8 32 | 0 33 | flash.xml.bin 34 | 35 | 36 | 37 | 38 | sequential 39 | basic 40 | 3604480 41 | 0 42 | 8 43 | 0 44 | 45 | 46 | 47 | sequential 48 | basic 49 | 65536 50 | 0 51 | 0 52 | 8 53 | 0 54 | VERFILE 55 | 56 | 57 | 58 | 59 | 60 | sequential 61 | basic 62 | 2097152 63 | 0 64 | 8 65 | 0 66 | 67 | 68 | sequential 69 | basic 70 | 131072 71 | 0 72 | 8 73 | 0 74 | TBCFILE 75 | 76 | 77 | 78 | sequential 79 | basic 80 | 458752 81 | 0 82 | 0x8 83 | 0 84 | DTBFILE 85 | 86 | 87 | 88 | sequential 89 | basic 90 | 589824 91 | 0 92 | 8 93 | 0 94 | EBTFILE 95 | 96 | 97 | 98 | sequential 99 | basic 100 | 65536 101 | 0 102 | 8 103 | 0 104 | WB0FILE 105 | 106 | 107 | 108 | sequential 109 | basic 110 | 196608 111 | 0 112 | 0 113 | 8 114 | 0 115 | BPFFILE 116 | 117 | 118 | 139 | 140 | 141 | sequential 142 | basic 143 | 589824 144 | 0 145 | 0 146 | 8 147 | 0 148 | TOSFILE 149 | 150 | 151 | sequential 152 | basic 153 | 65536 154 | 0 155 | 0 156 | 8 157 | 0 158 | EKSFILE 159 | 160 | 161 | 162 | sequential 163 | basic 164 | 786432 165 | 0 166 | 0x8 167 | 0 168 | FILENAME 169 | 170 | 171 | 172 | sequential 173 | basic 174 | 458752 175 | 0 176 | 0x8 177 | 0 178 | FILENAME 179 | 180 | 181 | 182 | sequential 183 | basic 184 | 131072 185 | 0 186 | 0x8 187 | 0 188 | rp4.blob 189 | 190 | 193 | 194 | sequential 195 | basic 196 | 46840832 197 | 0 198 | 0x8 199 | 0 200 | bmp.blob 201 | 202 | 203 | sequential 204 | basic 205 | 83886080 206 | 0 207 | 0x8 208 | 0 209 | FILENAME 210 | 211 | 212 | sequential 213 | basic 214 | 499122176 215 | 0 216 | 0x8 217 | 0 218 | FILENAME 219 | 220 | 221 | sequential 222 | basic 223 | 499122176 224 | 0 225 | 0x8 226 | 0 227 | FILENAME 228 | 229 | 230 | sequential 231 | basic 232 | 20971520 233 | 0 234 | 0x8 235 | 0 236 | FILENAME 237 | 238 | 239 | sequential 240 | basic 241 | FILESIZE 242 | 0 243 | 0x808 244 | 0 245 | FILENAME 246 | 247 | 248 | sequential 249 | basic 250 | 2097152 251 | 0 252 | 8 253 | 0 254 | 255 | 256 | 257 | -------------------------------------------------------------------------------- /bin/cmd.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * Copyright 2018 - 2020 Balena.io 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 'use strict'; 20 | 21 | const Bluebird = require('bluebird'); 22 | const path = require('path'); 23 | const yargs = require('yargs'); 24 | const { statAsync } = Bluebird.promisifyAll(require('fs')); 25 | const { tmpdir } = require('os'); 26 | 27 | const utils = require('../lib/utils.js'); 28 | const ResinJetsonFlash = require('../lib/resin-jetson-flash.js'); 29 | const fileSys = require('fs'); 30 | const filePath = require('path'); 31 | const readline = require("readline"); 32 | 33 | const run = async options => { 34 | const stat = await statAsync(options.file); 35 | console.log(filePath.resolve(__dirname, '../Tegra_Software_License_Agreement-Tegra-Linux.txt')); 36 | var tegraLicenseText = fileSys.readFileSync(path.resolve(__dirname, '../Tegra_Software_License_Agreement-Tegra-Linux.txt'), 'utf8'); 37 | console.log(tegraLicenseText); 38 | console.log("The above License Agreement can be consulted at https://developer.download.nvidia.com/embedded/L4T/r35_Release_v2.1/release/Tegra_Software_License_Agreement-Tegra-Linux.txt"); 39 | if (options.acceptLicense != 'yes') { 40 | const rl = readline.createInterface({ 41 | input: process.stdin, 42 | output: process.stdout, 43 | }); 44 | 45 | const response = await new Promise(resolve => { rl.question('Accept the Tegra Software License Agreement above? Type yes/no:', resolve)}); 46 | rl.close(); 47 | if (response != 'yes') { 48 | console.log('Tegra Software License Agreement for Tegra Linux needs to be accepted to use this tool.'); 49 | process.exit(0); 50 | } 51 | } 52 | if (!stat.isFile()) { 53 | throw new Error('Specified image is not a file'); 54 | } 55 | 56 | options.output = options.output || tmpdir(); 57 | 58 | if (!path.isAbsolute(options.output)) { 59 | options.output = path.join(process.cwd(), options.output); 60 | } 61 | 62 | const outputPath = options.persistent 63 | ? path.join(options.output, 'jetson-flash-artifacts') // '/tmp/jetson-flash-artifacts' 64 | : path.join(options.output, process.pid.toString()); 65 | 66 | await utils.outputRegister(outputPath, options.persistent); 67 | 68 | const odmdata = options.odmdata ? options.odmdata : 'default'; 69 | 70 | const Flasher = new ResinJetsonFlash( 71 | options.machine, 72 | options.file, 73 | odmdata, 74 | `${__dirname}/../assets/${options.machine}-assets`, 75 | outputPath, 76 | options.cache 77 | ); 78 | 79 | await Flasher.run(); 80 | }; 81 | 82 | const argv = yargs 83 | .usage('Usage: $0 [options]') 84 | .option('m', { 85 | alias: 'machine', 86 | description: 'Machine to flash', 87 | choices: ['jetson-tx2', 'jetson-tx2-4GB', 'jetson-xavier-nx-devkit-tx2-nx', 'jetson-nano-emmc', 'jetson-nano-qspi-sd', 'jetson-nano-2gb-devkit', 'jetson-xavier', 'jetson-xavier-nx-devkit-emmc', "jetson-xavier-nx-devkit", "jetson-agx-orin-devkit"], 88 | required: true, 89 | type: 'string', 90 | }) 91 | .alias('f', 'file') 92 | .nargs('f', 1) 93 | .describe('f', 'BalenaOS image to use') 94 | .option('d', { 95 | alias: 'odmdata', 96 | description: 'ODMDATA value, currently available for Jetson TX2 only', 97 | choices: ['0x1090000', '0x90000', '0x6090000', '0x7090000', '0x2090000', '0x3090000'], 98 | required: false, 99 | type: 'string', 100 | }) 101 | .option('l', { 102 | alias: 'acceptLicense', 103 | description: 'Accept Tegra Software License Agreement for Linux Tegra? License agreement needs to be accepted to use this tool.', 104 | choices: ['yes', 'no'], 105 | required: false, 106 | type: 'string', 107 | }) 108 | .alias('o', 'output') 109 | .nargs('o', 1) 110 | .describe('o', 'Output directory') 111 | .alias('p', 'persistent') 112 | .boolean('p') 113 | .describe('p', 'Persist work') 114 | .implies('p', 'o') 115 | .example('$0 -f balena.img -p -o ./workdir --acceptLicense yes', '') 116 | .alias('c', 'cache') 117 | .boolean('c') 118 | .describe('c', 'use cached bsp from dockerfile') 119 | .help('h') 120 | .alias('h', 'help') 121 | .epilog('Copyright 2020').argv; 122 | 123 | run(argv); 124 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Most devices are on the same L4T BSP as the Jetson TX2 4 | DEVICE_TYPE="jetson-tx2" 5 | JETSON_FLASH_BSP_URL="https://developer.nvidia.com/downloads/remksjetpack-463r32releasev73t186jetsonlinur3273aarch64tbz2" 6 | 7 | function log { 8 | case $1 in 9 | ERROR) 10 | loglevel=ERROR 11 | shift 12 | ;; 13 | WARN) 14 | loglevel=WARNING 15 | shift 16 | ;; 17 | *) 18 | loglevel=LOG 19 | ;; 20 | esac 21 | printf "%s%s\n" "[$loglevel] " "$1" 22 | if [ "$loglevel" == "ERROR" ]; then 23 | exit 1 24 | fi 25 | } 26 | 27 | function help() { 28 | echo "You can build and run the jetson-flash container using :\n $ ./build_and_run.sh -m [jetson-tx2|jetson-xavier-nx-devkit-tx2-nx|jetson-nano-emmc|jetson-nano-2gb-devkit|jetson-nano-qspi-sd|jetson-xavier|jetson-agx-orin-devkit|jetson-xavier-nx-devkit-emmc|jetson-xavier-nx-devkit" 29 | } 30 | 31 | # Parse arguments 32 | while [[ $# -gt 0 ]]; do 33 | arg="$1" 34 | case $arg in 35 | -h|--help) 36 | help 37 | exit 0 38 | ;; 39 | -m|--machine) 40 | if [ -z "$2" ]; then 41 | log ERROR "\"$1\" argument needs a value." 42 | fi 43 | DEVICE_TYPE=$2 44 | shift 45 | ;; 46 | *) 47 | echo "Unrecognized option $1." 48 | help 49 | exit 1 50 | ;; 51 | esac 52 | shift 53 | done 54 | 55 | 56 | case "${DEVICE_TYPE}" in 57 | jetson-agx-orin-devkit) 58 | JETSON_FLASH_BSP_URL="https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.3/release/Jetson_Linux_r36.4.3_aarch64.tbz2" 59 | ;; 60 | jetson-nano-qspi-sd) 61 | JETSON_FLASH_BSP_URL="https://developer.nvidia.com/downloads/remetpack-463r32releasev73t210jetson-210linur3273aarch64tbz2" 62 | ;; 63 | jetson-nano-2gb-devkit) 64 | JETSON_FLASH_BSP_URL="https://developer.nvidia.com/embedded/l4t/r32_release_v7.1/t210/jetson-210_linux_r32.7.1_aarch64.tbz2" 65 | ;; 66 | jetson-nano-emmc) 67 | JETSON_FLASH_BSP_URL="https://developer.nvidia.com/downloads/remetpack-463r32releasev73t210jetson-210linur3273aarch64tbz2" 68 | ;; 69 | *) 70 | echo $"Using default L4T 32.7.3 BSP ${JETSON_FLASH_BSP_URL}" 71 | esac 72 | 73 | 74 | # Build Dockerfile 75 | docker build --build-arg bsp_url="${JETSON_FLASH_BSP_URL}" --build-arg device_type="${DEVICE_TYPE}" -t jetson-flash-image . 76 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | jetson-flash: 4 | restart: always 5 | build: ./ 6 | privileged: true 7 | volumes: 8 | - '/dev:/dev' 9 | - '/run/udev/control:/run/udev/control' 10 | - '/sys:/sys' 11 | - '~/images:/data/images' 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/cnx100-xavier-nx.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Auvidea CNX100 Xavier NX 2 | 3 | 4 | These are the flashing instructions for the Auvidea CNX100 Xavier NX. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 5 | 6 | ## L4T/balenaOS/jetson-flash compatibility 7 | 8 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 9 | 10 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 11 | 12 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 13 | |------------------|-------------|-----------------|----------------------------------| 14 | | 2.85.2+rev1 | 32.5.1 | 4.5.1 | [v0.5.17](https://github.com/balena-os/jetson-flash/tree/v0.5.17) | 15 | 16 | 17 | ## Requirements 18 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 19 | 20 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 21 | 22 | ### non-Docker 23 | 24 | Prerequisites: 25 | 26 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 27 | - [NodeJS](https://nodejs.org) 28 | - Make sure you have python2 installed and that the `python` binary points to python2. 29 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 30 | 31 | Installation: 32 | 33 | Make sure the prerequesites listed above are installed. 34 | 35 | Clone this repository: 36 | ```sh 37 | $ git clone https://github.com/balena-os/jetson-flash.git 38 | ``` 39 | 40 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 41 | ```sh 42 | $ npm install 43 | ``` 44 | 45 | ### Docker 46 | 47 | Prerequisites: 48 | 49 | - the Docker image should be run as privileged 50 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 51 | 52 | Installation: 53 | 54 | Clone this repository: 55 | ```sh 56 | $ git clone https://github.com/balena-os/jetson-flash.git 57 | ``` 58 | 59 | ## How to use 60 | 61 | Follow the steps below to flash your Jetson board 62 | 63 | ### Recovery mode 64 | 65 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 66 | 67 | We only test jetson-flash on the reference NVIDIA carrier boards. Please consult the Auvidea CNX100 for Nvidia Jetson Xavier NX user manual for the proper recovery mode steps. 68 | 69 | **Confirmation** 70 | 71 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 72 | 73 | You should see something similar to the below, depending on your board: 74 | 75 | ``` 76 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 77 | 78 | ``` 79 | 80 | (The `APX` is crucial to confirming recovery mode.) 81 | 82 | Or 83 | 84 | ``` 85 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 86 | ``` 87 | 88 | ### Run the tool 89 | 90 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 91 | 92 | ```sh 93 | $ ./bin/cmd.js -f -m jetson-xavier-nx-devkit-emmc 94 | ``` 95 | 96 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 97 | 98 | ```sh 99 | ./build.sh [-m jetson-xavier-nx-devkit-emmc] 100 | ``` 101 | 102 | **NOTE**: The `jetson-xavier-nx-devkit-emmc` argument should be passed in command-line when flashing the Auvidea CNX100 Xavier NX. 103 | 104 | You can then enter the container using: 105 | 106 | ```sh 107 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 108 | ``` 109 | 110 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 111 | 112 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 113 | 114 | ```sh 115 | ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 116 | ``` 117 | 118 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 119 | 120 | ```sh 121 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 122 | ``` 123 | 124 | It will exit upon completion. 125 | 126 | --- 127 | 128 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 129 | 130 | ``` 131 | *** The target t186ref has been flashed successfully. *** 132 | Reset the board to boot from internal eMMC. 133 | 134 | ``` 135 | ## Support 136 | 137 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 138 | 139 | 140 | License 141 | ------- 142 | 143 | The project is licensed under the Apache 2.0 license. 144 | -------------------------------------------------------------------------------- /docs/images/jetson-agx-orin-devkit-64gb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-agx-orin-devkit-64gb.jpg -------------------------------------------------------------------------------- /docs/images/jetson-agx-orin-devkit-64gb_recovery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-agx-orin-devkit-64gb_recovery.jpg -------------------------------------------------------------------------------- /docs/images/jetson-nano-2gb-devkit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-nano-2gb-devkit.png -------------------------------------------------------------------------------- /docs/images/jetson-nano-2gb-devkit_rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-nano-2gb-devkit_rec.png -------------------------------------------------------------------------------- /docs/images/jetson-nano-emmc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-nano-emmc.jpg -------------------------------------------------------------------------------- /docs/images/jetson-nano.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-nano.png -------------------------------------------------------------------------------- /docs/images/jetson-nano_rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-nano_rec.png -------------------------------------------------------------------------------- /docs/images/jetson-orin-nano-seeed-j3010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-orin-nano-seeed-j3010.jpg -------------------------------------------------------------------------------- /docs/images/jetson-orin-nx-seeed-j4012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-orin-nx-seeed-j4012.png -------------------------------------------------------------------------------- /docs/images/jetson-orin-nx-seeed-j4012_recovery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-orin-nx-seeed-j4012_recovery.jpg -------------------------------------------------------------------------------- /docs/images/jetson-orin-nx-xavier-nx-devkit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-orin-nx-xavier-nx-devkit.jpg -------------------------------------------------------------------------------- /docs/images/jetson-tx2-nx-devkit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-tx2-nx-devkit.png -------------------------------------------------------------------------------- /docs/images/jetson-tx2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-tx2.png -------------------------------------------------------------------------------- /docs/images/jetson-tx2_rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-tx2_rec.png -------------------------------------------------------------------------------- /docs/images/jetson-xavier.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/docs/images/jetson-xavier.jpg -------------------------------------------------------------------------------- /docs/jetson-agx-orin-devkit-64gb.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson AGX Orin Devkit 64GB 2 | 3 | 4 | 5 | These are the flashing instructions for the [Jetson AGX Orin Developer Kit 64GB](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-orin/). For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | ## L4T/balenaOS/jetson-flash compatibility 8 | 9 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 10 | 11 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 12 | 13 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 14 | |------------------|-------------|-----------------|----------------------------------| 15 | | 6.4.0 or later | 36.4.3 | 6.2 | You are on the correct version. (v0.5.86 or greater) | 16 | | 6.0.6 - 6.3.6 | 36.3 | 6.0 | [v0.5.85](https://github.com/balena-os/jetson-flash/tree/v0.5.85) | 17 | 18 | 19 | ## Requirements 20 | - Docker needs to be installed on the x86 Host PC and the Docker image needs to be run as privileged 21 | - The balenaOS image downloaded from balena-cloud needs to be unpacked and copied on your Host PC inside the `~/images/` folder. This location will be bind mounted inside the running container. 22 | - The Docker image and the associated scripts require a Linux-based host and have been validated on a PC running Ubuntu 22.04. Other host operating systems or virtualized environments may also work, provided that the Nvidia BSP flashing tools are able to communicate with the Jetson device successfully over USB 23 | - We don't formally test Ubuntu 22.04 in VMWare virtual machines, but it seem to work. More specifically, with VMWare Fusion for Mac and VMWare Workstation for Windows. Note: when prompted by VMWare choose to automatically connect the NVIDIA Corp. APX USB device (i.e. the Orin device) to the VM rather than to the host. 24 | 25 | ## Jetson AGX Orin Devkit 64GB Flashing steps: 26 | 27 | NOTE: By default, balenaOS is flashed on the Jetson AGX Orin 64GB Devkit's eMMC; You can change the default using the instructions below. 28 | 29 | 1. Download your balenaOS image from balena-cloud, unpack and write it to a USB stick. We recommend using [Etcher](https://www.balena.io/etcher). 30 | 2. If you would like to flash and boot from a NVME drive instead of the eMMC, please follow these steps: 31 | 1. After writing your balenaOS image to the USB key, mount the flash-rootA partition of the USB stick and open the file `etc/resin-init-flasher.conf` located in it. 32 | 2. The first line of this file is `INTERNAL_DEVICE_KERNEL="mmcblk0"`. Replace `mmcblk0` with `nvme0n1`, save and close the file. 33 | 3. Ensure the flash-rootA partition is unmounted before removing the USB key from your PC. 34 | 4. IMPORTANT: Flashing balenaOS on the NVME will erase the contents of the device's eMMC as well. Please make sure to back-up your data. 35 | 3. Place the balenaOS unpacked image inside the folder ~/images on your HOST PC. This location will be automatically bind-mounted in the container image in the `/data/images/` folder 36 | 4. Put the AGX Orin Devkit 64GB in Force Recovery mode: 37 | 1. Make sure you connect the Type-C plug of the data cable to the USB Type-C port used for flashing, which is located next to 40-pin connector. 38 | 2. While holding the middle Force Recovery button, insert the USB Type-C power supply plug into the USB Type-C port above the DC jack. 39 | 3. This will turn on the Jetson dev kit in Force Recovery Mode. 40 | 4. Release the middle Force Recovery button 41 | 5. Confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and you should see output similar to: `Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX` (The APX is important) 42 | 5. Insert the USB stick created above in the upper USB port located near the the display port of the AGX Orin Devkit 64GB. 43 | 6. Clone this repo on your host PC. 44 | 7. Navigate to the `Orin_Flash` folder and run the Docker image by executing the `build_and_run.sh` script: 45 | ``` 46 | ~/jetson-flash$ cd Orin_Flash/ 47 | ~/jetson-flash/Orin_Flash$ ./build_and_run.sh 48 | ``` 49 | 8. Once the docker image has been built and starts running, the balenaOS kernel and flasher image can be booted by executing the `flash_orin_nx.sh` script: 50 | ``` 51 | root@03ce5cbcbb0d:/usr/src/app/orin-flash# ./flash_orin.sh -f /data/images/ -m jetson-agx-orin-devkit-64gb 52 | ``` 53 | 54 | Other considerations: 55 | - The flashing process takes around 5-10 minutes and once it completes, the board will power-off. The device can be taken out of recovery mode and the USB flasher stick can be unplugged. 56 | - Remove and reconnect power to the device. 57 | - The Orin NX 8GB and 16GB can be emulated during flashing of the Jetson AGX Orin Devkit - [more information here](https://github.com/balena-os/jetson-flash/blob/master/Orin_Flash/agx_orin_emulation.md). 58 | ## Support 59 | 60 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 61 | 62 | 63 | 64 | License 65 | ------- 66 | 67 | The project is licensed under the Apache 2.0 license. 68 | -------------------------------------------------------------------------------- /docs/jetson-agx-orin-devkit.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson AGX Orin Devkit 32GB 2 | 3 | 4 | 5 | These are the flashing instructions for the Jetson AGX Orin Devkit 32GB. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | ## L4T/balenaOS/jetson-flash compatibility 8 | 9 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 10 | 11 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 12 | 13 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 14 | |------------------|-------------|-----------------|----------------------------------| 15 | | 6.4.0 or later | 36.4.3 | 6.2 | You are on the correct version. (v0.5.86 or greater) | 16 | | 5.3.22 - 6.3.6 | 36.3 | 6.0 | [v0.5.85](https://github.com/balena-os/jetson-flash/tree/v0.5.85) | 17 | | 5.3.12 - 5.3.21 | 35.5.0 | 5.1.3 | [v0.5.72](https://github.com/balena-os/jetson-flash/tree/v0.5.72) | 18 | | 4.1.5 - 5.3.10 | 35.4.1 | 5.1.2 | [v0.5.67](https://github.com/balena-os/jetson-flash/tree/v0.5.67) | 19 | | 2.115.18 - 4.1.2 | 35.3.1 | 5.1.1 | [v0.5.57](https://github.com/balena-os/jetson-flash/tree/v0.5.57) | 20 | | 2.113.32 - 2.115.13 | 35.2.1 | 5.1 | [0.5.48](https://github.com/balena-os/jetson-flash/tree/v0.5.48) | 21 | | 2.105.11 - 2.113.31 | 35.1.0 | 5.0.2 | [0.5.43](https://github.com/balena-os/jetson-flash/tree/v0.5.43) | 22 | 23 | ## Requirements 24 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 25 | 26 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 27 | 28 | ### non-Docker 29 | 30 | Prerequisites: 31 | 32 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 33 | - [NodeJS](https://nodejs.org) 34 | - Make sure you have python2 installed and that the `python` binary points to python2. 35 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 36 | 37 | Installation: 38 | 39 | Make sure the prerequesites listed above are installed. 40 | 41 | Clone this repository: 42 | ```sh 43 | $ git clone https://github.com/balena-os/jetson-flash.git 44 | ``` 45 | 46 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 47 | ```sh 48 | $ npm install 49 | ``` 50 | 51 | ### Docker 52 | 53 | Prerequisites: 54 | 55 | - the Docker image should be run as privileged 56 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 57 | 58 | Installation: 59 | 60 | Clone this repository: 61 | ```sh 62 | $ git clone https://github.com/balena-os/jetson-flash.git 63 | ``` 64 | 65 | ## How to use 66 | 67 | Follow the steps below to flash your Jetson board 68 | 69 | ### Recovery mode 70 | 71 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 72 | 73 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 74 | 75 | 1. Make sure you connect the Type-C plug of the data cable to the USB Type-C port used for flashing, which is located next to 40-pin connector. 76 | 2. While holding the middle Force Recovery button, insert the USB Type-C power supply plug into the USB Type-C port above the DC jack. 77 | 3. This will turn on the Jetson dev kit in Force Recovery Mode. 78 | 4. HOLD DOWN UNTIL you hear the fan and get a usb connection popup on your connected PC 79 | 80 | **Confirmation** 81 | 82 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 83 | 84 | You should see something similar to the below, depending on your board: 85 | 86 | ``` 87 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 88 | 89 | ``` 90 | 91 | (The `APX` is crucial to confirming recovery mode.) 92 | 93 | Or 94 | 95 | ``` 96 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 97 | ``` 98 | 99 | ### Run the tool 100 | 101 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 102 | 103 | ```sh 104 | $ ./bin/cmd.js -f -m jetson-agx-orin-devkit 105 | ``` 106 | 107 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 108 | 109 | ```sh 110 | ./build.sh [-m jetson-agx-orin-devkit] 111 | ``` 112 | 113 | You can then enter the container using: 114 | 115 | ```sh 116 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 117 | ``` 118 | 119 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 120 | 121 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 122 | 123 | ```sh 124 | ./bin/cmd.js -f /data/images/ -m jetson-agx-orin-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 125 | ``` 126 | 127 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 128 | 129 | ```sh 130 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-agx-orin-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 131 | ``` 132 | 133 | It will exit upon completion. 134 | 135 | --- 136 | 137 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 138 | 139 | ``` 140 | *** The target t186ref has been flashed successfully. *** 141 | Reset the board to boot from internal eMMC. 142 | 143 | ``` 144 | ## Support 145 | 146 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 147 | 148 | 149 | License 150 | ------- 151 | 152 | The project is licensed under the Apache 2.0 license. 153 | -------------------------------------------------------------------------------- /docs/jetson-nano-2gb-devkit.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson Nano 2GB Developers Kit (SD-CARD version) 2 | 3 | 4 | 5 | These are the flashing instructions for the Jetson Nano 2GB SD-CARD Developers Kit. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | Note that this is for the Jetson Nano Developer Kit 2GB RAM version with an on-module SD card slot. 8 | 9 | ## L4T/balenaOS/jetson-flash compatibility 10 | 11 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 12 | 13 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 14 | 15 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 16 | |------------------|-------------|-----------------|----------------------------------| 17 | | 2.95.15+rev1 or later | 32.7.1 | 4.6.1 | You are on the latest version (v0.5.22 or later) | 18 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.21](https://github.com/balena-os/jetson-flash/tree/v0.5.21) | 19 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.14](https://github.com/balena-os/jetson-flash/tree/v0.5.14) | 20 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.13](https://github.com/balena-os/jetson-flash/tree/v0.5.13) | 21 | 22 | ## Requirements 23 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 24 | 25 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 26 | 27 | ### non-Docker 28 | 29 | Prerequisites: 30 | 31 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 32 | - [NodeJS](https://nodejs.org) 33 | - Make sure you have python2 installed and that the `python` binary points to python2. 34 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 35 | 36 | Installation: 37 | 38 | Make sure the prerequesites listed above are installed. 39 | 40 | Clone this repository: 41 | ```sh 42 | $ git clone https://github.com/balena-os/jetson-flash.git 43 | ``` 44 | 45 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 46 | ```sh 47 | $ npm install 48 | ``` 49 | 50 | ### Docker 51 | 52 | Prerequisites: 53 | 54 | - the Docker image should be run as privileged 55 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 56 | 57 | Installation: 58 | 59 | Clone this repository: 60 | ```sh 61 | $ git clone https://github.com/balena-os/jetson-flash.git 62 | ``` 63 | 64 | ## How to use 65 | 66 | Follow the steps below to flash your Jetson board 67 | 68 | ### Recovery mode 69 | 70 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 71 | 72 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the NVIDIA Jetson Nano Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 73 | 74 | With power off, enable Force Recovery mode by placing a jumper across the "FRC" pins of the Button Header on the carrier board. 75 | 76 | - These are pins 9 ("GND") and 10 ("FC REC") of Button Header J12, which is located on the edge of the carrier board under the Jetson module. 77 | 78 | Then power on the device. 79 | 80 | **Confirmation** 81 | 82 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 83 | 84 | You should see something similar to the below, depending on your board: 85 | 86 | ``` 87 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 88 | 89 | ``` 90 | 91 | (The `APX` is crucial to confirming recovery mode.) 92 | 93 | Or 94 | 95 | ``` 96 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 97 | ``` 98 | 99 | ### Run the tool 100 | 101 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 102 | 103 | ```sh 104 | $ ./bin/cmd.js -f -m jetson-nano-2gb-devkit 105 | ``` 106 | 107 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 108 | 109 | ```sh 110 | ./build.sh [-m jetson-nano-2gb-devkit] 111 | ``` 112 | 113 | You can then enter the container using: 114 | 115 | ```sh 116 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 117 | ``` 118 | 119 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 120 | 121 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 122 | 123 | ```sh 124 | ./bin/cmd.js -f /data/images/ -m jetson-nano-2gb-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 125 | ``` 126 | 127 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 128 | 129 | ```sh 130 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-nano-2gb-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 131 | ``` 132 | 133 | It will exit upon completion. 134 | 135 | --- 136 | 137 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 138 | 139 | ``` 140 | *** The target t186ref has been flashed successfully. *** 141 | Reset the board to boot from internal eMMC. 142 | 143 | ``` 144 | ## Support 145 | 146 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 147 | 148 | 149 | License 150 | ------- 151 | 152 | The project is licensed under the Apache 2.0 license. 153 | -------------------------------------------------------------------------------- /docs/jetson-nano-emmc.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson Nano eMMC 2 | 3 | 4 | 5 | These are the flashing instructions for the Jetson Nano eMMC. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | Note that this is for the production Jetson Nano module without an SD card slot, **not** the [Jetson Nano SD Card Developer Kit](jetson-nano.md), which has an SD card slot on the module itself. 8 | 9 | ## L4T/balenaOS/jetson-flash compatibility 10 | 11 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 12 | 13 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 14 | 15 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 16 | |------------------|-------------|-----------------|----------------------------------| 17 | | 2.108.9+rev1 or later | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.38 or later) | 18 | |2.101.1 - 2.108.9 | 32.7.2 | 4.6.2 | [v0.5.37](https://github.com/balena-os/jetson-flash/tree/v0.5.37) | 19 | | 2.95.15+rev1 - 2.101.0 | 32.7.1 | 4.6.1 | [v0.5.28](https://github.com/balena-os/jetson-flash/tree/v0.5.28) | 20 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.21](https://github.com/balena-os/jetson-flash/tree/v0.5.21) | 21 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.13](https://github.com/balena-os/jetson-flash/tree/v0.5.13) | 22 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.10](https://github.com/balena-os/jetson-flash/tree/v0.5.10) | 23 | 24 | 25 | ## Requirements 26 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 27 | 28 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 29 | 30 | ### non-Docker 31 | 32 | Prerequisites: 33 | 34 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 35 | - [NodeJS](https://nodejs.org) 36 | - Make sure you have python2 installed and that the `python` binary points to python2. 37 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 38 | 39 | Installation: 40 | 41 | Make sure the prerequesites listed above are installed. 42 | 43 | Clone this repository: 44 | ```sh 45 | $ git clone https://github.com/balena-os/jetson-flash.git 46 | ``` 47 | 48 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 49 | ```sh 50 | $ npm install 51 | ``` 52 | 53 | ### Docker 54 | 55 | Prerequisites: 56 | 57 | - the Docker image should be run as privileged 58 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 59 | 60 | Installation: 61 | 62 | Clone this repository: 63 | ```sh 64 | $ git clone https://github.com/balena-os/jetson-flash.git 65 | ``` 66 | 67 | ## How to use 68 | 69 | Follow the steps below to flash your Jetson board 70 | 71 | ### Recovery mode 72 | 73 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 74 | 75 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the NVIDIA Jetson Nano Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 76 | 77 | With power off, enable Force Recovery mode by placing a jumper across the "FRC" pins of the Button Header on the carrier board. 78 | 79 | - For carrier board revision A02, these are pins 3 ("FC REC") and 4 ("GND") of Button Header J40 which is located near the camera header. 80 | - For carrier board revision B01, (and the Nano 2GB) these are pins 9 ("GND") and 10 ("FC REC") of Button Header J12, which is located on the edge of the carrier board under the Jetson module. 81 | 82 | Then power on the device. 83 | 84 | **Confirmation** 85 | 86 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 87 | 88 | You should see something similar to the below, depending on your board: 89 | 90 | ``` 91 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 92 | 93 | ``` 94 | 95 | (The `APX` is crucial to confirming recovery mode.) 96 | 97 | Or 98 | 99 | ``` 100 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 101 | ``` 102 | 103 | ### Run the tool 104 | 105 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 106 | 107 | ```sh 108 | $ ./bin/cmd.js -f -m jetson-nano-emmc 109 | ``` 110 | 111 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 112 | 113 | ```sh 114 | ./build.sh [-m jetson-nano-emmc] 115 | ``` 116 | 117 | You can then enter the container using: 118 | 119 | ```sh 120 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 121 | ``` 122 | 123 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 124 | 125 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 126 | 127 | ```sh 128 | ./bin/cmd.js -f /data/images/ -m jetson-nano-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 129 | ``` 130 | 131 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 132 | 133 | ```sh 134 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-nano-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 135 | ``` 136 | 137 | It will exit upon completion. 138 | 139 | --- 140 | 141 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 142 | 143 | ``` 144 | *** The target t186ref has been flashed successfully. *** 145 | Reset the board to boot from internal eMMC. 146 | 147 | ``` 148 | ## Support 149 | 150 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 151 | 152 | 153 | License 154 | ------- 155 | 156 | The project is licensed under the Apache 2.0 license. 157 | -------------------------------------------------------------------------------- /docs/jetson-nano.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson Nano Developers Kit (SD-CARD version) 2 | 3 | 4 | 5 | These are the flashing instructions for the Jetson Nano SD-CARD Developers Kit. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | Note that this is for the Jetson Nano Developer Kit with an on-module SD card slot and 4GB RAM, **not** the [Jetson Nano eMMC](jetson-nano-emmc.md), which does not have an SD card slot on the module itself. 8 | 9 | ## L4T/balenaOS/jetson-flash compatibility 10 | 11 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 12 | 13 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 14 | 15 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 16 | |------------------|-------------|-----------------|----------------------------------| 17 | | 2.108.9+rev1 or later | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.53 or later) | 18 | |2.101.1 - 2.108.9 | 32.7.2 | 4.6.2 | [v0.5.52](https://github.com/balena-os/jetson-flash/tree/v0.5.52) | 19 | | 2.95.15+rev1 - 2.101.0 | 32.7.1 | 4.6.1 | [v0.5.22](https://github.com/balena-os/jetson-flash/tree/v0.5.22) | 20 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.21](https://github.com/balena-os/jetson-flash/tree/v0.5.21) | 21 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.13](https://github.com/balena-os/jetson-flash/tree/v0.5.13) | 22 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.10](https://github.com/balena-os/jetson-flash/tree/v0.5.10) | 23 | 24 | 25 | ## Requirements 26 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 27 | 28 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 29 | 30 | ### non-Docker 31 | 32 | Prerequisites: 33 | 34 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 35 | - [NodeJS](https://nodejs.org) 36 | - Make sure you have python2 installed and that the `python` binary points to python2. 37 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 38 | 39 | Installation: 40 | 41 | Make sure the prerequesites listed above are installed. 42 | 43 | Clone this repository: 44 | ```sh 45 | $ git clone https://github.com/balena-os/jetson-flash.git 46 | ``` 47 | 48 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 49 | ```sh 50 | $ npm install 51 | ``` 52 | 53 | ### Docker 54 | 55 | Prerequisites: 56 | 57 | - the Docker image should be run as privileged 58 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 59 | 60 | Installation: 61 | 62 | Clone this repository: 63 | ```sh 64 | $ git clone https://github.com/balena-os/jetson-flash.git 65 | ``` 66 | 67 | ## How to use 68 | 69 | Follow the steps below to flash your Jetson board 70 | 71 | ### Recovery mode 72 | 73 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 74 | 75 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the NVIDIA Jetson Nano Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 76 | 77 | With power off, enable Force Recovery mode by placing a jumper across the "FRC" pins of the Button Header on the carrier board. 78 | 79 | - For carrier board revision A02, these are pins 3 ("FC REC") and 4 ("GND") of Button Header J40 which is located near the camera header. 80 | - For carrier board revision B01, (and the Nano 2GB) these are pins 9 ("GND") and 10 ("FC REC") of Button Header J12, which is located on the edge of the carrier board under the Jetson module. 81 | 82 | Then power on the device. 83 | 84 | **Confirmation** 85 | 86 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 87 | 88 | You should see something similar to the below, depending on your board: 89 | 90 | ``` 91 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 92 | 93 | ``` 94 | 95 | (The `APX` is crucial to confirming recovery mode.) 96 | 97 | Or 98 | 99 | ``` 100 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 101 | ``` 102 | 103 | ### Run the tool 104 | 105 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 106 | 107 | ```sh 108 | $ ./bin/cmd.js -f -m jetson-nano-qspi-sd 109 | ``` 110 | 111 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 112 | 113 | ```sh 114 | ./build.sh [-m jetson-nano-qspi-sd] 115 | ``` 116 | 117 | You can then enter the container using: 118 | 119 | ```sh 120 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 121 | ``` 122 | 123 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 124 | 125 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 126 | 127 | ```sh 128 | ./bin/cmd.js -f /data/images/ -m jetson-nano-qspi-sd --accept-license=yes -c /tmp/Linux_for_Tegra 129 | ``` 130 | 131 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 132 | 133 | ```sh 134 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-nano-qspi-sd --accept-license=yes -c /tmp/Linux_for_Tegra 135 | ``` 136 | 137 | It will exit upon completion. 138 | 139 | --- 140 | 141 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 142 | 143 | ``` 144 | *** The target t186ref has been flashed successfully. *** 145 | Reset the board to boot from internal eMMC. 146 | 147 | ``` 148 | ## Support 149 | 150 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 151 | 152 | License 153 | ------- 154 | 155 | The project is licensed under the Apache 2.0 license. 156 | -------------------------------------------------------------------------------- /docs/jetson-orin-nano-devkit-nvme.md: -------------------------------------------------------------------------------- 1 | 2 | # Instructions for the Jetson Orin Nano 8GB (SD) Devkit NVME 3 | 4 | These are the flashing instructions for the Jetson Orin Nano 8GB (SD) Devkit NVME. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 5 | 6 | ## L4T/balenaOS/jetson-flash compatibility 7 | 8 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 9 | 10 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 11 | 12 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 13 | |------------------|-------------|-----------------|----------------------------------| 14 | | 6.4.0 or later | 36.4.3 | 6.2 | You are on the correct version. (v0.5.86 or greater) | 15 | | 5.3.22 - 6.3.6 | 36.3 | 6.0 | [v0.5.85](https://github.com/balena-os/jetson-flash/tree/v0.5.85) | 16 | | 5.3.12 - 5.3.21 | 35.5.0 | 5.1.3 | [v0.5.72](https://github.com/balena-os/jetson-flash/tree/v0.5.72) | 17 | | 4.1.5 - 5.3.10 | 35.4.1 | 5.1.2 | [v0.5.67](https://github.com/balena-os/jetson-flash/tree/v0.5.67) | 18 | | 2.115.18 - 4.1.2 | 35.3.1 | 5.1.1 | [v0.5.57](https://github.com/balena-os/jetson-flash/tree/v0.5.57) | 19 | 20 | 21 | ## Requirements 22 | - Docker needs to be installed on the x86 Host PC and the Docker image needs to be run as privileged 23 | - The balenaOS image downloaded from balena-cloud needs to be unpacked and copied on your Host PC inside the `~/images/` folder. This location will be bind mounted inside the running container. 24 | - The Docker image and the associated scripts require a Linux-based host and have been validated on a PC running Ubuntu 22.04. Other host operating systems or virtualized environments may also work, provided that the Nvidia BSP flashing tools are able to communicate with the Jetson device successfully over USB 25 | - We don't formally test Ubuntu 22.04 in VMWare virtual machines, but it seem to work. More specifically, with VMWare Fusion for Mac and VMWare Workstation for Windows. Note: when prompted by VMWare choose to automatically connect the NVIDIA Corp. APX USB device (i.e. the Orin device) to the VM rather than to the host. 26 | 27 | ### Jetson Orin Nano 8GB (SD) Devkit NVME Flashing steps: 28 | 29 | 1. Attach a NVME drive to the Orin Nano Devkit 30 | 2. Download your balenaOS image from balena-cloud, unpack and write it to a USB stick. We recommend using Etcher. 31 | 3. Place the balenaOS unpacked image inside the folder ~/images on your HOST PC. This location will be automatically bind-mounted in the container image in the `/data/images/` folder 32 | 4. Put the Jetson Orin Nano in Force Recovery mode: 33 | 1. Ensure the device is powered off and the power adapter disconnected. Enable Force Recovery mode by placing a jumper across the "FC REC" and "GND" pins located on the edge of the carrier board, under the Jetson Orin Nano module. 34 | 2. Connect your host computer to the device's USB-C connector. 35 | 3. Connect the power adapter to the Power Jack. 36 | 4. The device will automatically power on in Force Recovery Mode. 37 | 5. Confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and you should see output similar to: `Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX` (The APX is important) 38 | 5. Insert the USB stick created above in the upper USB port located near the the display port of the Orin Nano Devkit 39 | 6. Clone this repo to your host PC. 40 | 7. Navigate to the `Orin_Flash` folder and run the Docker image by executing the `build_and_run.sh` script: 41 | ``` 42 | ~/jetson-flash$ cd Orin_Flash/ 43 | ~/jetson-flash/Orin_Flash$ ./build_and_run.sh 44 | ``` 45 | 8. Once the docker image has been built and starts running, the balenaOS kernel and flasher image can be booted by executing the `flash_orin_nx.sh` script: 46 | ``` 47 | root@03ce5cbcbb0d:/usr/src/app/orin-flash# ./flash_orin.sh -f /data/images/ -m jetson-orin-nano-devkit-nvme 48 | ``` 49 | 50 | Other considerations: 51 | - The flashing process takes around 5-10 minutes and once it completes, the board will power-off. The device can be taken out of recovery mode and the USB flasher stick can be unplugged. 52 | - Remove and reconnect power to the device. 53 | 54 | ## Support 55 | 56 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 57 | 58 | 59 | 60 | License 61 | ------- 62 | 63 | The project is licensed under the Apache 2.0 license. 64 | -------------------------------------------------------------------------------- /docs/jetson-orin-nano-seeed-j3010.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Seeed reComputer J3010 4GB 2 | 3 | 4 | 5 | These are the flashing instructions for the [Seeed J3010](https://www.seeedstudio.com/reComputer-J3010-p-5589.html) Edge AI Computer with NVIDIA® Jetson™ Orin™ Nano 4GB. [See here](../README.md#instructions) for the list of other supported Jetson devices. 6 | 7 | ## L4T/balenaOS/jetson-flash compatibility 8 | 9 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 10 | 11 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 12 | 13 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 14 | |------------------|-------------|-----------------|----------------------------------| 15 | | 6.4.0 or later | 36.4.3 | 6.2 | You are on the correct version. (v0.5.86 or greater) | 16 | | 5.3.22 - 6.3.6 | 36.3 | 6.0 | [v0.5.85](https://github.com/balena-os/jetson-flash/tree/v0.5.85) | 17 | | 5.3.12 - 5.3.21 | 35.5.0 | 5.1.3 | [v0.5.74](https://github.com/balena-os/jetson-flash/tree/v0.5.74) | 18 | 19 | 20 | ## Requirements 21 | - Docker needs to be installed on the x86 Host PC and the Docker image needs to be run as privileged 22 | - The balenaOS image downloaded from balena-cloud needs to be unpacked and copied on your Host PC inside the `~/images/` folder. This location will be bind mounted inside the running container. 23 | - The Docker image and the associated scripts require a Linux-based host and have been validated on a PC running Ubuntu 22.04. Other host operating systems or virtualized environments may also work, provided that the Nvidia BSP flashing tools are able to communicate with the Jetson device successfully over USB 24 | - We don't formally test Ubuntu 22.04 in VMWare virtual machines, but it seem to work. More specifically, with VMWare Fusion for Mac and VMWare Workstation for Windows. Note: when prompted by VMWare choose to automatically connect the NVIDIA Corp. APX USB device (i.e. the Orin device) to the VM rather than to the host. 25 | 26 | ### Seeed reComputer J3010 Flashing steps: 27 | 28 | 1. Ensure a NVME drive is attached to the Seeed reComputer J3010 29 | 2. Download your balenaOS image from balena-cloud, unpack and write it to a USB stick. We recommend using Etcher. 30 | 3. Place the balenaOS unpacked image inside the folder ~/images on your HOST PC. This location will be automatically bind-mounted in the container image in the `/data/images/` folder 31 | 4. Put the Seeed reComputer J3010 in Force Recovery mode: 32 | 1. Ensure the device is powered off and the power adapter disconnected. 33 | 2. Open the top lid of the reComputer and place a jumper across the Force Recovery Mode pins. These are pins ("GND") and ("FC REC") and are located on the carrier board, under the Orin Nano module. 34 | 3. Connect your host computer to the device's USB-C connector. 35 | 4. Connect the power adapter to the Power Jack [J2]. 36 | 5. The device will automatically power on in Force Recovery Mode. 37 | 6. Confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and you should see output similar to: `Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX` (The APX is important) 38 | 5. Insert the USB stick created above in any of the USB ports of the Seeed reComputer J3010 Flashing 39 | 6. Clone this repo to your host PC. 40 | 7. Navigate to the `Orin_Flash` folder and run the Docker image by executing the `build_and_run.sh` script: 41 | ``` 42 | ~/jetson-flash$ cd Orin_Flash/ 43 | ~/jetson-flash/Orin_Flash$ ./build_and_run.sh 44 | ``` 45 | 8. Once the docker image has been built and starts running, the balenaOS kernel and flasher image can be booted by executing the `flash_orin_nx.sh` script: 46 | ``` 47 | root@03ce5cbcbb0d:/usr/src/app/orin-flash# ./flash_orin.sh -f /data/images/ -m jetson-orin-nano-seeed-j3010 48 | ``` 49 | 50 | Other considerations: 51 | - The flashing process takes around 5-10 minutes and once it completes, the board will power-off. The device can be taken out of recovery mode and the USB flasher stick can be unplugged. 52 | - Remove and reconnect power to the device. 53 | 54 | ## Support 55 | 56 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 57 | 58 | 59 | License 60 | ------- 61 | 62 | The project is licensed under the Apache 2.0 license. 63 | -------------------------------------------------------------------------------- /docs/jetson-orin-nx-seeed-j4012.md: -------------------------------------------------------------------------------- 1 | 2 | # Instructions for the Seeed reComputer J4012 16GB 3 | 4 | 5 | 6 | These are the flashing instructions for the Seeed reComputer J4012 16GB. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 7 | 8 | ## L4T/balenaOS/jetson-flash compatibility 9 | 10 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 11 | 12 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 13 | 14 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 15 | |------------------|-------------|-----------------|----------------------------------| 16 | | 6.4.0 or later | 36.4.3 | 6.2 | You are on the correct version. (v0.5.86 or greater) | 17 | | 5.3.22 - 6.3.6 | 36.3 | 6.0 | [v0.5.85](https://github.com/balena-os/jetson-flash/tree/v0.5.85) | 18 | | 5.3.12 - 5.3.21 | 35.5.0 | 5.1.3 | [v0.5.74](https://github.com/balena-os/jetson-flash/tree/v0.5.74) | 19 | | 5.1.8 - 5.3.10 | 35.4.1 | 5.1.2 | [v0.5.67](https://github.com/balena-os/jetson-flash/tree/v0.5.67) | 20 | 21 | ## Requirements 22 | - Docker needs to be installed on the x86 Host PC and the Docker image needs to be run as privileged 23 | - The balenaOS image downloaded from balena-cloud needs to be unpacked and copied on your Host PC inside the `~/images/` folder. This location will be bind mounted inside the running container. 24 | - The Docker image and the associated scripts require a Linux-based host and have been validated on a PC running Ubuntu 22.04. Other host operating systems or virtualized environments may also work, provided that the Nvidia BSP flashing tools are able to communicate with the Jetson device successfully over USB 25 | - We don't formally test Ubuntu 22.04 in VMWare virtual machines, but it seem to work. More specifically, with VMWare Fusion for Mac and VMWare Workstation for Windows. Note: when prompted by VMWare choose to automatically connect the NVIDIA Corp. APX USB device (i.e. the Orin device) to the VM rather than to the host. 26 | 27 | ### Seeed reComputer J4012 Flashing steps: 28 | 29 | 1. Ensure a NVME drive is attached to the Seeed reComputer J4012 30 | 2. Download your balenaOS image from balena-cloud, unpack and write it to a USB stick. We recommend using Etcher. 31 | 3. Place the balenaOS unpacked image inside the folder ~/images on your HOST PC. This location will be automatically bind-mounted in the container image in the `/data/images/` folder 32 | 4. Put the Seeed reComputer J4012 in Force Recovery mode: 33 | 1. Ensure the device is powered off and the power adapter disconnected. 34 | 2. Open the top lid of the reComputer and place a jumper across the Force Recovery Mode pins. These are pins ("GND") and ("FC REC") and are located on the carrier board, under the Orin NX module. 35 | 3. Connect your host computer to the device's USB-C connector. 36 | 4. Connect the power adapter to the Power Jack [J2]. 37 | 5. The device will automatically power on in Force Recovery Mode. 38 | 6. Confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and you should see output similar to: `Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX` (The APX is important) 39 | 5. Insert the USB stick created above in any of the USB ports of the Seeed reComputer J4012 Flashing 40 | 6. Clone this repo to your host PC. 41 | 7. Navigate to the `Orin_Flash` folder and run the Docker image by executing the `build_and_run.sh` script: 42 | ``` 43 | ~/jetson-flash$ cd Orin_Flash/ 44 | ~/jetson-flash/Orin_Flash$ ./build_and_run.sh 45 | ``` 46 | 8. Once the docker image has been built and starts running, the balenaOS kernel and flasher image can be booted by executing the `flash_orin_nx.sh` script: 47 | ``` 48 | root@03ce5cbcbb0d:/usr/src/app/orin-flash# ./flash_orin.sh -f /data/images/ -m jetson-orin-nx-seeed-j4012 49 | ``` 50 | 51 | Other considerations: 52 | - The flashing process takes around 5-10 minutes and once it completes, the board will power-off. The device can be taken out of recovery mode and the USB flasher stick can be unplugged. 53 | - Remove and reconnect power to the device. 54 | 55 | ## Support 56 | 57 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 58 | 59 | 60 | 61 | License 62 | ------- 63 | 64 | The project is licensed under the Apache 2.0 license. 65 | -------------------------------------------------------------------------------- /docs/jetson-orin-nx-xavier-nx-devkit.md: -------------------------------------------------------------------------------- 1 | 2 | # Instructions for the Jetson Orin NX in Xavier NX Devkit NVME 3 | 4 | 5 | 6 | These are the flashing instructions for the Jetson Orin NX in Xavier NX Devkit NVME. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 7 | 8 | ## L4T/balenaOS/jetson-flash compatibility 9 | 10 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 11 | 12 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 13 | 14 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 15 | |------------------|-------------|-----------------|----------------------------------| 16 | | 6.4.0 or later | 36.4.3 | 6.2 | You are on the correct version. (v0.5.86 or greater) | 17 | | 5.3.22 - 6.3.6 | 36.3 | 6.0 | [v0.5.85](https://github.com/balena-os/jetson-flash/tree/v0.5.85) | 18 | | 5.3.12 - 5.3.21 | 35.5.0 | 5.1.3 | [v0.5.72](https://github.com/balena-os/jetson-flash/tree/v0.5.72) | 19 | | 4.1.5 - 5.3.10 | 35.4.1 | 5.1.2 | [v0.5.67](https://github.com/balena-os/jetson-flash/tree/v0.5.67) | 20 | | 2.115.18 - 4.1.2 | 35.3.1 | 5.1.1 | [v0.5.57](https://github.com/balena-os/jetson-flash/tree/v0.5.57) | 21 | | 2.114.0 - 2.115.13 | 35.2.1 | 5.1 | [0.5.49](https://github.com/balena-os/jetson-flash/tree/v0.5.49) | 22 | 23 | 24 | ## Requirements 25 | - Docker needs to be installed on the x86 Host PC and the Docker image needs to be run as privileged 26 | - The balenaOS image downloaded from balena-cloud needs to be unpacked and copied on your Host PC inside the `~/images/` folder. This location will be bind mounted inside the running container. 27 | - The Docker image and the associated scripts require a Linux-based host and have been validated on a PC running Ubuntu 22.04. Other host operating systems or virtualized environments may also work, provided that the Nvidia BSP flashing tools are able to communicate with the Jetson device successfully over USB 28 | - We don't formally test Ubuntu 22.04 in VMWare virtual machines, but it seem to work. More specifically, with VMWare Fusion for Mac and VMWare Workstation for Windows. Note: when prompted by VMWare choose to automatically connect the NVIDIA Corp. APX USB device (i.e. the Orin device) to the VM rather than to the host. 29 | 30 | ### Jetson Orin NX in Xavier NX Devkit NVME Flashing steps: 31 | 32 | 33 | 1. Attach a NVMe drive to the Xavier NX Devkit 34 | 2. Download your balenaOS image from balena-cloud, unpack and write it to a USB stick. We recommend using Etcher. 35 | 3. Place the balenaOS unpacked image inside the folder ~/images on your HOST PC. This location will be automatically bind-mounted in the container image in the `/data/images/` folder 36 | 4. Put the Jetson Orin NX in Force Recovery mode: 37 | 1. Ensure the device is powered off and the power adapter disconnected. 38 | 2. Place a jumper across the Force Recovery Mode pins. These are pins 9 ("GND") and 10 ("FC REC") of the Button Header (J14). 39 | 3. Connect your host computer to the device's USB Micro-B connector. 40 | 4. Connect the power adapter to the Power Jack [J16]. 41 | 5. The device will automatically power on in Force Recovery Mode. 42 | 6. Confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and you should see output similar to: `Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX` (The APX is important) 43 | 5. Insert the USB stick created above in any of the 4 USB ports of the Xavier NX Devkit 44 | 6. Clone this repo to your host PC. 45 | 7. Navigate to the `Orin_Flash` folder and run the Docker image by executing the `build_and_run.sh` script: 46 | ``` 47 | ~/jetson-flash$ cd Orin_Flash/ 48 | ~/jetson-flash/Orin_Flash$ ./build_and_run.sh 49 | ``` 50 | 7. Once the docker image has been built and starts running, the balenaOS kernel and flasher image can be booted by executing the `flash_orin_nx.sh` script: 51 | ``` 52 | root@03ce5cbcbb0d:/usr/src/app/orin-flash# ./flash_orin.sh -f /data/images/ -m jetson-orin-nx-xavier-nx-devkit 53 | 54 | ``` 55 | 56 | Other considerations: 57 | - The flashing process takes around 5-10 minutes and once it completes, the board will power-off. The device can be taken out of recovery mode and the USB flasher stick can be unplugged. 58 | - Remove and reconnect power to the device. 59 | 60 | ## Support 61 | 62 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 63 | 64 | 65 | License 66 | ------- 67 | 68 | The project is licensed under the Apache 2.0 license. 69 | -------------------------------------------------------------------------------- /docs/jetson-tx2-nx-devkit.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson TX2 NX (in Jetson Xavier NX Devkit) 2 | 3 | 4 | 5 | These are the flashing instructions for the Jetson TX2 NX (in Jetson Xavier NX Devkit). For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | ## L4T/balenaOS/jetson-flash compatibility 8 | 9 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 10 | 11 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 12 | 13 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 14 | |------------------|-------------|-----------------|----------------------------------| 15 | | 2.108.9+rev1 or later | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.39 or later) | 16 | |2.101.1 - 2.108.9 | 32.7.2 | 4.6.2 | [v0.5.38](https://github.com/balena-os/jetson-flash/tree/v0.5.38) | 17 | | 2.95.15+rev1 - 2.101.0 | 32.7.1 | 4.6.1 | [v0.5.28](https://github.com/balena-os/jetson-flash/tree/v0.5.28) | 18 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.21](https://github.com/balena-os/jetson-flash/tree/v0.5.21) | 19 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.13](https://github.com/balena-os/jetson-flash/tree/v0.5.13) | 20 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.10](https://github.com/balena-os/jetson-flash/tree/v0.5.10) | 21 | 22 | ## Requirements 23 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 24 | 25 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 26 | 27 | ### non-Docker 28 | 29 | Prerequisites: 30 | 31 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 32 | - [NodeJS](https://nodejs.org) 33 | - Make sure you have python2 installed and that the `python` binary points to python2. 34 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 35 | 36 | Installation: 37 | 38 | Make sure the prerequesites listed above are installed. 39 | 40 | Clone this repository: 41 | ```sh 42 | $ git clone https://github.com/balena-os/jetson-flash.git 43 | ``` 44 | 45 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 46 | ```sh 47 | $ npm install 48 | ``` 49 | 50 | ### Docker 51 | 52 | Prerequisites: 53 | 54 | - the Docker image should be run as privileged 55 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 56 | 57 | Installation: 58 | 59 | Clone this repository: 60 | ```sh 61 | $ git clone https://github.com/balena-os/jetson-flash.git 62 | ``` 63 | 64 | ## How to use 65 | 66 | Follow the steps below to flash your Jetson board 67 | 68 | ### Recovery mode 69 | 70 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 71 | 72 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 73 | 74 | 1. Ensure the device is powered off and the power adapter disconnected. 75 | 2. Place a jumper across the Force Recovery Mode pins. These are pins 9 ("GND") and 10 ("FC REC") of the Button Header (J14). 76 | 3. Connect your host computer to the device's USB Micro-B connector. 77 | 4. Connect the power adapter to the Power Jack [J16]. 78 | 5. The device will automatically power on in Force Recovery Mode. 79 | 80 | **Confirmation** 81 | 82 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 83 | 84 | You should see something similar to the below, depending on your board: 85 | 86 | ``` 87 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 88 | 89 | ``` 90 | 91 | (The `APX` is crucial to confirming recovery mode.) 92 | 93 | Or 94 | 95 | ``` 96 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 97 | ``` 98 | 99 | ### Run the tool 100 | 101 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 102 | 103 | ```sh 104 | $ ./bin/cmd.js -f -m jetson-tx2-nx-devkit 105 | ``` 106 | 107 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 108 | 109 | ```sh 110 | ./build.sh [-m jetson-tx2-nx-devkit] 111 | ``` 112 | 113 | You can then enter the container using: 114 | 115 | ```sh 116 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 117 | ``` 118 | 119 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 120 | 121 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 122 | 123 | ```sh 124 | ./bin/cmd.js -f /data/images/ -m jetson-tx2-nx-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 125 | ``` 126 | 127 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 128 | 129 | ```sh 130 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-tx2-nx-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 131 | ``` 132 | 133 | It will exit upon completion. 134 | 135 | --- 136 | 137 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 138 | 139 | ``` 140 | *** The target t186ref has been flashed successfully. *** 141 | Reset the board to boot from internal eMMC. 142 | 143 | ``` 144 | ## Support 145 | 146 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 147 | 148 | 149 | License 150 | ------- 151 | 152 | The project is licensed under the Apache 2.0 license. 153 | -------------------------------------------------------------------------------- /docs/jetson-tx2.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson TX2 2 | 3 | 4 | 5 | These are the flashing instructions for the Jetson TX2. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | ## L4T/balenaOS/jetson-flash compatibility 8 | 9 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 10 | 11 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 12 | 13 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 14 | |------------------|-------------|-----------------|----------------------------------| 15 | | 2.108.9+rev1 or later | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.35 or later) | 16 | |2.101.1 - 2.108.9 | 32.7.2 | 4.6.2 | [v0.5.34](https://github.com/balena-os/jetson-flash/tree/v0.5.34) | 17 | | 2.95.15+rev1 - 2.101.0 | 32.7.1 | 4.6.1 | [v0.5.32](https://github.com/balena-os/jetson-flash/tree/v0.5.32) | 18 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.26](https://github.com/balena-os/jetson-flash/tree/v0.5.26) | 19 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.19](https://github.com/balena-os/jetson-flash/tree/v0.5.19) | 20 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.10](https://github.com/balena-os/jetson-flash/tree/v0.5.10) | 21 | | 2.50.1+rev1 - 2.60.1+rev2 | 32.4.3 | 4.4 | [v0.5.5](https://github.com/balena-os/jetson-flash/tree/v0.5.5) | 22 | | 2.47.1+rev2 - 2.49.0+rev2 | 32.3.1 | 4.3 | [v0.4.1](https://github.com/balena-os/jetson-flash/tree/v0.4.1) | 23 | | 2.39.0+rev1 - 2.47.1+rev1 | 32.2.0 | 4.2 | [v0.4.0](https://github.com/balena-os/jetson-flash/tree/v0.4.0) | 24 | | Older than 2.47 | 28.3 | 3.3 | [v0.3.0](https://github.com/balena-os/jetson-flash/tree/v0.3.0) | 25 | 26 | 27 | 28 | ## Requirements 29 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 30 | 31 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 32 | 33 | ## TX2 Notes 34 | 35 | - The USB flashing method for the Jetson TX2 is an alternative to SD-CARD provisioning, and can also be used to re-flash TX2s that cannot boot normally due to corrupt QSPI firmware. 36 | - For the Jetson-TX2 flasher image only, the system-proxy directory entries are not copied over by jetson-flash. 37 | 38 | ### non-Docker 39 | 40 | Prerequisites: 41 | 42 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 43 | - [NodeJS](https://nodejs.org) 44 | - Make sure you have python2 installed and that the `python` binary points to python2. 45 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 46 | 47 | Installation: 48 | 49 | Make sure the prerequesites listed above are installed. 50 | 51 | Clone this repository: 52 | ```sh 53 | $ git clone https://github.com/balena-os/jetson-flash.git 54 | ``` 55 | 56 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 57 | ```sh 58 | $ npm install 59 | ``` 60 | 61 | ### Docker 62 | 63 | Prerequisites: 64 | 65 | - the Docker image should be run as privileged 66 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 67 | 68 | Installation: 69 | 70 | Clone this repository: 71 | ```sh 72 | $ git clone https://github.com/balena-os/jetson-flash.git 73 | ``` 74 | 75 | ## How to use 76 | 77 | Follow the steps below to flash your Jetson board 78 | 79 | ### Recovery mode 80 | 81 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 82 | 83 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 84 | 85 | 1. Power down the device, removing the AC adapter. 86 | 2. Connect the Micro-B plug on the USB cable to the Recovery (USB Micro-B) Port on the device and the other end to an available USB port on the host PC. 87 | 3. Connect the power adapter to the device. 88 | 4. With the system powered on: 89 | - Press and hold the RECOVERY FORCE button. 90 | - While depressing the RECOVERY FORCE button, press and release the RESET button. 91 | - Wait 2 seconds and release the RECOVERY FORCE button. 92 | 93 | **Confirmation** 94 | 95 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 96 | 97 | You should see something similar to the below, depending on your board: 98 | 99 | ``` 100 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 101 | 102 | ``` 103 | 104 | (The `APX` is crucial to confirming recovery mode.) 105 | 106 | Or 107 | 108 | ``` 109 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 110 | ``` 111 | 112 | ### Run the tool 113 | 114 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 115 | 116 | ```sh 117 | $ ./bin/cmd.js -f -m jetson-tx2 118 | ``` 119 | 120 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 121 | 122 | ```sh 123 | ./build.sh [-m jetson-tx2] 124 | ``` 125 | 126 | You can then enter the container using: 127 | 128 | ```sh 129 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 130 | ``` 131 | 132 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 133 | 134 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 135 | 136 | ```sh 137 | ./bin/cmd.js -f /data/images/ -m jetson-tx2 --accept-license=yes -c /tmp/Linux_for_Tegra 138 | ``` 139 | 140 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 141 | 142 | ```sh 143 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-tx2 --accept-license=yes -c /tmp/Linux_for_Tegra 144 | ``` 145 | 146 | It will exit upon completion. 147 | 148 | --- 149 | 150 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 151 | 152 | ``` 153 | *** The target t186ref has been flashed successfully. *** 154 | Reset the board to boot from internal eMMC. 155 | 156 | ``` 157 | ## Support 158 | 159 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 160 | 161 | 162 | License 163 | ------- 164 | 165 | The project is licensed under the Apache 2.0 license. 166 | -------------------------------------------------------------------------------- /docs/jetson-xavier-nx-devkit-emmc.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson Xavier NX Devkit eMMC 2 | 3 | 4 | These are the flashing instructions for the Jetson Xavier NX Devkit eMMC. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 5 | 6 | ## L4T/balenaOS/jetson-flash compatibility 7 | 8 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 9 | 10 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 11 | 12 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 13 | |------------------|-------------|-----------------|----------------------------------| 14 | | 2.108.9+rev1 or later | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.54 or later) | 15 | |2.101.1 - 2.108.9 | 32.7.2 | 4.6.2 | [v0.5.53](https://github.com/balena-os/jetson-flash/tree/v0.5.53) | 16 | | 2.95.15+rev1 - 2.101.0 | 32.7.1 | 4.6.1 | [v0.5.33](https://github.com/balena-os/jetson-flash/tree/v0.5.33) | 17 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.23](https://github.com/balena-os/jetson-flash/tree/v0.5.23) | 18 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.17](https://github.com/balena-os/jetson-flash/tree/v0.5.17) | 19 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.3](https://github.com/balena-os/jetson-flash/tree/v0.5.3) | 20 | 21 | 22 | ## Requirements 23 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 24 | 25 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 26 | 27 | ### non-Docker 28 | 29 | Prerequisites: 30 | 31 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 32 | - [NodeJS](https://nodejs.org) 33 | - Make sure you have python2 installed and that the `python` binary points to python2. 34 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 35 | 36 | Installation: 37 | 38 | Make sure the prerequesites listed above are installed. 39 | 40 | Clone this repository: 41 | ```sh 42 | $ git clone https://github.com/balena-os/jetson-flash.git 43 | ``` 44 | 45 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 46 | ```sh 47 | $ npm install 48 | ``` 49 | 50 | ### Docker 51 | 52 | Prerequisites: 53 | 54 | - the Docker image should be run as privileged 55 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 56 | 57 | Installation: 58 | 59 | Clone this repository: 60 | ```sh 61 | $ git clone https://github.com/balena-os/jetson-flash.git 62 | ``` 63 | 64 | ## How to use 65 | 66 | Follow the steps below to flash your Jetson board 67 | 68 | ### Recovery mode 69 | 70 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 71 | 72 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 73 | 74 | 1. Ensure the device is powered off and the power adapter disconnected. 75 | 2. Place a jumper across the Force Recovery Mode pins. These are pins 9 ("GND") and 10 ("FC REC") of the Button Header (J14). 76 | 3. Connect your host computer to the device's USB Micro-B connector. 77 | 4. Connect the power adapter to the Power Jack [J16]. 78 | 5. The device will automatically power on in Force Recovery Mode. 79 | 80 | **Confirmation** 81 | 82 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 83 | 84 | You should see something similar to the below, depending on your board: 85 | 86 | ``` 87 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 88 | 89 | ``` 90 | 91 | (The `APX` is crucial to confirming recovery mode.) 92 | 93 | Or 94 | 95 | ``` 96 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 97 | ``` 98 | 99 | ### Run the tool 100 | 101 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 102 | 103 | ```sh 104 | $ ./bin/cmd.js -f -m jetson-xavier-nx-devkit-emmc 105 | ``` 106 | 107 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 108 | 109 | ```sh 110 | ./build.sh [-m jetson-xavier-nx-devkit-emmc] 111 | ``` 112 | 113 | You can then enter the container using: 114 | 115 | ```sh 116 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 117 | ``` 118 | 119 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 120 | 121 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 122 | 123 | ```sh 124 | ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 125 | ``` 126 | 127 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 128 | 129 | ```sh 130 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 131 | ``` 132 | 133 | It will exit upon completion. 134 | 135 | --- 136 | 137 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 138 | 139 | ``` 140 | *** The target t186ref has been flashed successfully. *** 141 | Reset the board to boot from internal eMMC. 142 | 143 | ``` 144 | ## Support 145 | 146 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 147 | 148 | 149 | License 150 | ------- 151 | 152 | The project is licensed under the Apache 2.0 license. 153 | -------------------------------------------------------------------------------- /docs/jetson-xavier-nx-devkit.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson Xavier NX Devkit SD-CARD 2 | 3 | 4 | These are the flashing instructions for the Jetson Xavier NX Devkit SD-CARD. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 5 | 6 | ## L4T/balenaOS/jetson-flash compatibility 7 | 8 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 9 | 10 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 11 | 12 | 13 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 14 | |------------------|-------------|-----------------|----------------------------------| 15 | | 2.108.9+rev1 or later | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.36 or later) | 16 | |2.101.1 - 2.108.9 | 32.7.2 | 4.6.2 | [v0.5.35](https://github.com/balena-os/jetson-flash/tree/v0.5.53) | 17 | | 2.95.15+rev1 - 2.101.0 | 32.7.1 | 4.6.1 | [v0.5.33](https://github.com/balena-os/jetson-flash/tree/v0.5.33) | 18 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.23](https://github.com/balena-os/jetson-flash/tree/v0.5.23) | 19 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.17](https://github.com/balena-os/jetson-flash/tree/v0.5.17) | 20 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.3](https://github.com/balena-os/jetson-flash/tree/v0.5.3) | 21 | 22 | ## Requirements 23 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 24 | 25 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 26 | 27 | ### non-Docker 28 | 29 | Prerequisites: 30 | 31 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 32 | - [NodeJS](https://nodejs.org) 33 | - Make sure you have python2 installed and that the `python` binary points to python2. 34 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 35 | 36 | Installation: 37 | 38 | Make sure the prerequesites listed above are installed. 39 | 40 | Clone this repository: 41 | ```sh 42 | $ git clone https://github.com/balena-os/jetson-flash.git 43 | ``` 44 | 45 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 46 | ```sh 47 | $ npm install 48 | ``` 49 | 50 | ### Docker 51 | 52 | Prerequisites: 53 | 54 | - the Docker image should be run as privileged 55 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 56 | 57 | Installation: 58 | 59 | Clone this repository: 60 | ```sh 61 | $ git clone https://github.com/balena-os/jetson-flash.git 62 | ``` 63 | 64 | ## How to use 65 | 66 | Follow the steps below to flash your Jetson board 67 | 68 | ### Recovery mode 69 | 70 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 71 | 72 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 73 | 74 | 1. Ensure the device is powered off and the power adapter disconnected. 75 | 2. Place a jumper across the Force Recovery Mode pins. These are pins 9 ("GND") and 10 ("FC REC") of the Button Header (J14). 76 | 3. Connect your host computer to the device's USB Micro-B connector. 77 | 4. Connect the power adapter to the Power Jack [J16]. 78 | 5. The device will automatically power on in Force Recovery Mode. 79 | 80 | **Confirmation** 81 | 82 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 83 | 84 | You should see something similar to the below, depending on your board: 85 | 86 | ``` 87 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 88 | 89 | ``` 90 | 91 | (The `APX` is crucial to confirming recovery mode.) 92 | 93 | Or 94 | 95 | ``` 96 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 97 | ``` 98 | 99 | ### Run the tool 100 | 101 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 102 | 103 | ```sh 104 | $ ./bin/cmd.js -f -m jetson-xavier-nx-devkit 105 | ``` 106 | 107 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 108 | 109 | ```sh 110 | ./build.sh [-m jetson-xavier-nx-devkit] 111 | ``` 112 | 113 | You can then enter the container using: 114 | 115 | ```sh 116 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 117 | ``` 118 | 119 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 120 | 121 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 122 | 123 | ```sh 124 | ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 125 | ``` 126 | 127 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 128 | 129 | ```sh 130 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 131 | ``` 132 | 133 | It will exit upon completion. 134 | 135 | --- 136 | 137 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 138 | 139 | ``` 140 | *** The target t186ref has been flashed successfully. *** 141 | Reset the board to boot from internal eMMC. 142 | 143 | ``` 144 | ## Support 145 | 146 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 147 | 148 | 149 | License 150 | ------- 151 | 152 | The project is licensed under the Apache 2.0 license. 153 | -------------------------------------------------------------------------------- /docs/jetson-xavier.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Jetson AGX Xavier 2 | 3 | 4 | 5 | These are the flashing instructions for the Jetson AGX Xavier. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 6 | 7 | ## L4T/balenaOS/jetson-flash compatibility 8 | 9 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 10 | 11 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 12 | 13 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 14 | |------------------|-------------|-----------------|----------------------------------| 15 | | 2.108.9+rev1 or later | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.49 or later) | 16 | |2.101.1 - 2.108.9 | 32.7.2 | 4.6.2 | [v0.5.48](https://github.com/balena-os/jetson-flash/tree/v0.5.48) | 17 | | 2.95.15+rev1 - 2.101.0 | 32.7.1 | 4.6.1 | [v0.5.23](https://github.com/balena-os/jetson-flash/tree/v0.5.23) | 18 | | 2.87.1+rev1 - 2.95.14 | 32.6.1 | 4.6 | [v0.5.22](https://github.com/balena-os/jetson-flash/tree/v0.5.22) | 19 | |2.82.11+rev2 - 2.85.2+rev5 | 32.5.1 | 4.5.1 | [v0.5.18](https://github.com/balena-os/jetson-flash/tree/v0.5.18) | 20 | | 2.67.2+rev1 - 2.82.11+rev1 | 32.4.4 | 4.4.1 | [v0.5.10](https://github.com/balena-os/jetson-flash/tree/v0.5.10) | 21 | 22 | ## Requirements 23 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 24 | 25 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 26 | 27 | ### non-Docker 28 | 29 | Prerequisites: 30 | 31 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 32 | - [NodeJS](https://nodejs.org) 33 | - Make sure you have python2 installed and that the `python` binary points to python2. 34 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 35 | 36 | Installation: 37 | 38 | Make sure the prerequesites listed above are installed. 39 | 40 | Clone this repository: 41 | ```sh 42 | $ git clone https://github.com/balena-os/jetson-flash.git 43 | ``` 44 | 45 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 46 | ```sh 47 | $ npm install 48 | ``` 49 | 50 | ### Docker 51 | 52 | Prerequisites: 53 | 54 | - the Docker image should be run as privileged 55 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 56 | 57 | Installation: 58 | 59 | Clone this repository: 60 | ```sh 61 | $ git clone https://github.com/balena-os/jetson-flash.git 62 | ``` 63 | 64 | ## How to use 65 | 66 | Follow the steps below to flash your Jetson board 67 | 68 | ### Recovery mode 69 | 70 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 71 | 72 | We only test jetson-flash on the reference NVIDIA carrier board. If your carrier board varies significantly from the Developer Kit you may need to contact the manufacturer for the proper recovery mode steps. 73 | 74 | 1. Ensure the device is powered off and connect it to the host PC via USB. 75 | 2. Press and hold down the Force Recovery button. 76 | 3. Press and hold down the Power button. 77 | 4. Release both buttons. 78 | 79 | **Confirmation** 80 | 81 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 82 | 83 | You should see something similar to the below, depending on your board: 84 | 85 | ``` 86 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 87 | 88 | ``` 89 | 90 | (The `APX` is crucial to confirming recovery mode.) 91 | 92 | Or 93 | 94 | ``` 95 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 96 | ``` 97 | 98 | ### Run the tool 99 | 100 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 101 | 102 | ```sh 103 | $ ./bin/cmd.js -f -m jetson-xavier 104 | ``` 105 | 106 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 107 | 108 | ```sh 109 | ./build.sh [-m jetson-xavier] 110 | ``` 111 | 112 | You can then enter the container using: 113 | 114 | ```sh 115 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 116 | ``` 117 | 118 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 119 | 120 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 121 | 122 | ```sh 123 | ./bin/cmd.js -f /data/images/ -m jetson-xavier --accept-license=yes -c /tmp/Linux_for_Tegra 124 | ``` 125 | 126 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 127 | 128 | ```sh 129 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-xavier --accept-license=yes -c /tmp/Linux_for_Tegra 130 | ``` 131 | 132 | It will exit upon completion. 133 | 134 | --- 135 | 136 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 137 | 138 | ``` 139 | *** The target t186ref has been flashed successfully. *** 140 | Reset the board to boot from internal eMMC. 141 | 142 | ``` 143 | ## Support 144 | 145 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 146 | 147 | License 148 | ------- 149 | 150 | The project is licensed under the Apache 2.0 license. 151 | -------------------------------------------------------------------------------- /docs/jn30b-nano.md: -------------------------------------------------------------------------------- 1 | # Instructions for the Auvidea JN30B Nano 2 | 3 | 4 | These are the flashing instructions for the Auvidea JN30B Nano. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 5 | 6 | Note that this is for the production Jetson Nano module without an SD card slot, in an Auvidea JN30B carrier board. 7 | 8 | ## L4T/balenaOS/jetson-flash compatibility 9 | 10 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 11 | 12 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 13 | 14 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 15 | |------------------|-------------|-----------------|----------------------------------| 16 | | 2.103.2 | 32.7.2 | 4.6.2 | [v0.5.37](https://github.com/balena-os/jetson-flash/tree/v0.5.37) | 17 | | 2.95.8 | 32.6.1 | 4.6 | [v0.5.21](https://github.com/balena-os/jetson-flash/tree/v0.5.21) | 18 | 19 | 20 | ## Requirements 21 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 22 | 23 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 24 | 25 | ### non-Docker 26 | 27 | Prerequisites: 28 | 29 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 30 | - [NodeJS](https://nodejs.org) 31 | - Make sure you have python2 installed and that the `python` binary points to python2. 32 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 33 | 34 | Installation: 35 | 36 | Make sure the prerequesites listed above are installed. 37 | 38 | Clone this repository: 39 | ```sh 40 | $ git clone https://github.com/balena-os/jetson-flash.git 41 | ``` 42 | 43 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 44 | ```sh 45 | $ npm install 46 | ``` 47 | 48 | ### Docker 49 | 50 | Prerequisites: 51 | 52 | - the Docker image should be run as privileged 53 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 54 | 55 | Installation: 56 | 57 | Clone this repository: 58 | ```sh 59 | $ git clone https://github.com/balena-os/jetson-flash.git 60 | ``` 61 | 62 | ## How to use 63 | 64 | Follow the steps below to flash your Jetson board 65 | 66 | ### Recovery mode 67 | 68 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 69 | 70 | We only test jetson-flash on the reference NVIDIA carrier board. Please consult the Auvidea JN30B user manual for the proper recovery mode steps. 71 | 72 | **Confirmation** 73 | 74 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 75 | 76 | You should see something similar to the below, depending on your board: 77 | 78 | ``` 79 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 80 | 81 | ``` 82 | 83 | (The `APX` is crucial to confirming recovery mode.) 84 | 85 | Or 86 | 87 | ``` 88 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 89 | ``` 90 | 91 | ### Run the tool 92 | 93 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 94 | 95 | ```sh 96 | $ ./bin/cmd.js -f -m jetson-nano-emmc 97 | ``` 98 | 99 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 100 | 101 | ```sh 102 | ./build.sh [-m jetson-nano-emmc] 103 | ``` 104 | 105 | **NOTE**: The `jetson-nano-emmc` argument should be passed in command-line when flashing the Auvidea JN30B Nano. 106 | 107 | You can then enter the container using: 108 | 109 | ```sh 110 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 111 | ``` 112 | 113 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 114 | 115 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 116 | 117 | ```sh 118 | ./bin/cmd.js -f /data/images/ -m jetson-nano-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 119 | ``` 120 | 121 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 122 | 123 | ```sh 124 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-nano-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 125 | ``` 126 | 127 | It will exit upon completion. 128 | 129 | --- 130 | 131 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 132 | 133 | ``` 134 | *** The target t186ref has been flashed successfully. *** 135 | Reset the board to boot from internal eMMC. 136 | 137 | ``` 138 | ## Support 139 | 140 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 141 | 142 | 143 | License 144 | ------- 145 | 146 | The project is licensed under the Apache 2.0 license. 147 | -------------------------------------------------------------------------------- /docs/photon-nano.md: -------------------------------------------------------------------------------- 1 | # Instructions for the CTI Photon Nano 2 | 3 | 4 | These are the flashing instructions for the CTI Photon Nano. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 5 | 6 | Note that this is for the production Jetson Nano module without an SD card slot, in a Photon AI Camera Platform for NVIDIA Jetson Nano 7 | 8 | ## L4T/balenaOS/jetson-flash compatibility 9 | 10 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 11 | 12 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 13 | 14 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 15 | |------------------|-------------|-----------------|----------------------------------| 16 | | 4.0.9 | 32.7.3 | 4.6.3 | You are on the correct version. (v0.5.38 or later) | 17 | 18 | 19 | ## Requirements 20 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 21 | 22 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 23 | 24 | ### non-Docker 25 | 26 | Prerequisites: 27 | 28 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 29 | - [NodeJS](https://nodejs.org) 30 | - Make sure you have python2 installed and that the `python` binary points to python2. 31 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 32 | 33 | Installation: 34 | 35 | Make sure the prerequesites listed above are installed. 36 | 37 | Clone this repository: 38 | ```sh 39 | $ git clone https://github.com/balena-os/jetson-flash.git 40 | ``` 41 | 42 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 43 | ```sh 44 | $ npm install 45 | ``` 46 | 47 | ### Docker 48 | 49 | Prerequisites: 50 | 51 | - the Docker image should be run as privileged 52 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 53 | 54 | Installation: 55 | 56 | Clone this repository: 57 | ```sh 58 | $ git clone https://github.com/balena-os/jetson-flash.git 59 | ``` 60 | 61 | ## How to use 62 | 63 | Follow the steps below to flash your Jetson board 64 | 65 | ### Recovery mode 66 | 67 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 68 | 69 | We only test jetson-flash on the reference NVIDIA carrier board. Please consult the Connect Tech Photon AI Camera Platform for NVIDIA Jetson Nano user manual for the proper recovery mode steps. 70 | 71 | **Confirmation** 72 | 73 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 74 | 75 | You should see something similar to the below, depending on your board: 76 | 77 | ``` 78 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 79 | 80 | ``` 81 | 82 | (The `APX` is crucial to confirming recovery mode.) 83 | 84 | Or 85 | 86 | ``` 87 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 88 | ``` 89 | 90 | ### Run the tool 91 | 92 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 93 | 94 | ```sh 95 | $ ./bin/cmd.js -f -m jetson-nano-emmc 96 | ``` 97 | 98 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 99 | 100 | ```sh 101 | ./build.sh [-m jetson-nano-emmc] 102 | ``` 103 | 104 | **NOTE**: The `jetson-nano-emmc` argument should be passed in command-line when flashing the CTI Photon Nano. 105 | 106 | You can then enter the container using: 107 | 108 | ```sh 109 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 110 | ``` 111 | 112 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 113 | 114 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 115 | 116 | ```sh 117 | ./bin/cmd.js -f /data/images/ -m jetson-nano-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 118 | ``` 119 | 120 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 121 | 122 | ```sh 123 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-nano-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 124 | ``` 125 | 126 | It will exit upon completion. 127 | 128 | --- 129 | 130 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 131 | 132 | ``` 133 | *** The target t186ref has been flashed successfully. *** 134 | Reset the board to boot from internal eMMC. 135 | 136 | ``` 137 | ## Support 138 | 139 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 140 | 141 | 142 | License 143 | ------- 144 | 145 | The project is licensed under the Apache 2.0 license. 146 | -------------------------------------------------------------------------------- /docs/photon-tx2-nx.md: -------------------------------------------------------------------------------- 1 | # Instructions for CTI Photon TX2 NX 2 | 3 | These are the flashing instructions for the CTI Photon TX2 NX. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 4 | 5 | ## L4T/balenaOS/jetson-flash compatibility 6 | 7 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 8 | 9 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 10 | 11 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 12 | |------------------|-------------|-----------------|----------------------------------| 13 | | 2.113.14 | 32.7.2 | 4.6.2 | [v0.5.38](https://github.com/balena-os/jetson-flash/tree/v0.5.38) | 14 | | 2.98.12 | 32.7.1 | 4.6.1 | [v0.5.28](https://github.com/balena-os/jetson-flash/tree/v0.5.28) | 15 | | 2.88.4+rev3 | 32.6.1 | 4.6 | [v0.5.21](https://github.com/balena-os/jetson-flash/tree/v0.5.21) | 16 | |2.82.11+rev12 | 32.5.1 | 4.5.1 | [v0.5.13](https://github.com/balena-os/jetson-flash/tree/v0.5.13) | 17 | 18 | 19 | ## Requirements 20 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 21 | 22 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 23 | 24 | ### non-Docker 25 | 26 | Prerequisites: 27 | 28 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 29 | - [NodeJS](https://nodejs.org) 30 | - Make sure you have python2 installed and that the `python` binary points to python2. 31 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 32 | 33 | Installation: 34 | 35 | Make sure the prerequesites listed above are installed. 36 | 37 | Clone this repository: 38 | ```sh 39 | $ git clone https://github.com/balena-os/jetson-flash.git 40 | ``` 41 | 42 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 43 | ```sh 44 | $ npm install 45 | ``` 46 | 47 | ### Docker 48 | 49 | Prerequisites: 50 | 51 | - the Docker image should be run as privileged 52 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 53 | 54 | Installation: 55 | 56 | Clone this repository: 57 | ```sh 58 | $ git clone https://github.com/balena-os/jetson-flash.git 59 | ``` 60 | 61 | ## How to use 62 | 63 | Follow the steps below to flash your Jetson board 64 | 65 | ### Recovery mode 66 | 67 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 68 | 69 | We only test jetson-flash on the reference NVIDIA carrier boards. Please consult the Connect Tech Photon AI Camera Platform for Nvidia Jetson TX2 NX user manual for the proper recovery mode steps. 70 | 71 | **Confirmation** 72 | 73 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 74 | 75 | You should see something similar to the below, depending on your board: 76 | 77 | ``` 78 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 79 | 80 | ``` 81 | 82 | (The `APX` is crucial to confirming recovery mode.) 83 | 84 | Or 85 | 86 | ``` 87 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 88 | ``` 89 | 90 | ### Run the tool 91 | 92 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 93 | 94 | ```sh 95 | $ ./bin/cmd.js -f -m jetson-tx2-nx-devkit 96 | ``` 97 | 98 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 99 | 100 | ```sh 101 | ./build.sh [-m jetson-tx2-nx-devkit] 102 | ``` 103 | 104 | **NOTE**: The `jetson-tx2-nx-devkit` argument should be passed in command-line when flashing the CTI Photon TX2 NX. 105 | 106 | You can then enter the container using: 107 | 108 | ```sh 109 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 110 | ``` 111 | 112 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 113 | 114 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 115 | 116 | ```sh 117 | ./bin/cmd.js -f /data/images/ -m jetson-tx2-nx-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 118 | ``` 119 | 120 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 121 | 122 | ```sh 123 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-tx2-nx-devkit --accept-license=yes -c /tmp/Linux_for_Tegra 124 | ``` 125 | 126 | It will exit upon completion. 127 | 128 | --- 129 | 130 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 131 | 132 | ``` 133 | *** The target t186ref has been flashed successfully. *** 134 | Reset the board to boot from internal eMMC. 135 | 136 | ``` 137 | ## Support 138 | 139 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 140 | 141 | 142 | License 143 | ------- 144 | 145 | The project is licensed under the Apache 2.0 license. 146 | -------------------------------------------------------------------------------- /docs/photon-xavier-nx.md: -------------------------------------------------------------------------------- 1 | # Instructions for the CTI Photon Xavier NX 2 | 3 | 4 | These are the flashing instructions for the CTI Photon Xavier NX. For the list of other balena-supported Jetson devices [See here](../README.md#instructions). 5 | 6 | ## L4T/balenaOS/jetson-flash compatibility 7 | 8 | **Use the version of jetson-flash that corresponds to the version of balenaOS that you would like to provision per the table below.** 9 | 10 | (Each version of jetson-flash uses a specific version of NVIDIA's L4T BSP to properly partition the Jetson's boot media. This BSP version must also match the BSP used in the version of balenaOS you're flashing) 11 | 12 | | balenaOS version | BSP version | Jetpack version | Use this version of jetson-flash | 13 | |------------------|-------------|-----------------|----------------------------------| 14 | | 4.0.9+rev2 | 32.7.3 | 4.6.3 | [v0.5.54](https://github.com/balena-os/jetson-flash/tree/v0.5.54) | 15 | | 2.98.33 | 32.7.1 | 4.6.1 | [v0.5.33](https://github.com/balena-os/jetson-flash/tree/v0.5.33) | 16 | | 2.88.4+rev10 | 32.6.1 | 4.6 | [v0.5.23](https://github.com/balena-os/jetson-flash/tree/v0.5.23) | 17 | | 2.82.11+rev8 | 32.5.1 | 4.5.1 | [v0.5.17](https://github.com/balena-os/jetson-flash/tree/v0.5.17) | 18 | | 2.67.3+rev5 | 32.4.4 | 4.4.1 | [v0.5.4](https://github.com/balena-os/jetson-flash/tree/v0.5.4) | 19 | | 2.58.6+rev5 | 32.4.3 | 4.4 | [v0.5.3](https://github.com/balena-os/jetson-flash/tree/v0.5.3) | 20 | 21 | 22 | ## Requirements 23 | Jetson Flash requires an x86 Linux-based host (or virtual machine) and has been tested on Ubuntu 22.04 (Focal). 24 | 25 | You can either install all the prerequisites listed below or run the provided Docker image (using Docker, not balenaOS) on the host. 26 | 27 | ### non-Docker 28 | 29 | Prerequisites: 30 | 31 | - Sudo privileges (required by Tegra Flash and to delete intermediate steps created by the tool in `/tmp/${pid_of_process}`) 32 | - [NodeJS](https://nodejs.org) 33 | - Make sure you have python2 installed and that the `python` binary points to python2. 34 | - Dependencies required for the the L4T package, including: lbzip2, e2fsprogs, dosfstools, libxml2-utils, lz4 35 | 36 | Installation: 37 | 38 | Make sure the prerequesites listed above are installed. 39 | 40 | Clone this repository: 41 | ```sh 42 | $ git clone https://github.com/balena-os/jetson-flash.git 43 | ``` 44 | 45 | Install Node.js dependencies by issuing the following command in the jetson-flash directory: 46 | ```sh 47 | $ npm install 48 | ``` 49 | 50 | ### Docker 51 | 52 | Prerequisites: 53 | 54 | - the Docker image should be run as privileged 55 | - `/dev/bus/usb` needs to be bind-mounted for the Tegra BSP tools to communicate with the device 56 | 57 | Installation: 58 | 59 | Clone this repository: 60 | ```sh 61 | $ git clone https://github.com/balena-os/jetson-flash.git 62 | ``` 63 | 64 | ## How to use 65 | 66 | Follow the steps below to flash your Jetson board 67 | 68 | ### Recovery mode 69 | 70 | Make sure that the Jetson board is plugged into your host via USB and is in recovery mode before issuing the flashing command. 71 | 72 | We only test jetson-flash on the reference NVIDIA carrier boards. Please consult the Connect Tech Photon AI Camera Platform for Nvidia Jetson Xavier NX user manual for the proper recovery mode steps. 73 | 74 | **Confirmation** 75 | 76 | You can confirm your device is running in recovery mode by issuing the command `lsusb | grep NVIDIA` and examining the output. 77 | 78 | You should see something similar to the below, depending on your board: 79 | 80 | ``` 81 | Bus 003 Device 005: ID 0955:7023 NVIDIA Corp. APX 82 | 83 | ``` 84 | 85 | (The `APX` is crucial to confirming recovery mode.) 86 | 87 | Or 88 | 89 | ``` 90 | Bus 001 Device 019: ID 0955:7c18 NVIDIA Corp. T186 [TX2 Tegra Parker] recovery mode 91 | ``` 92 | 93 | ### Run the tool 94 | 95 | For **non - Docker**, run the tool by specifying the path to the unzipped image (in place of "") and the device type as shown below: 96 | 97 | ```sh 98 | $ ./bin/cmd.js -f -m jetson-xavier-nx-devkit-emmc 99 | ``` 100 | 101 | For **Docker**, issue the following commands in the folder that has the Dockerfile to build the container (building may take a while and appear to hang, so be patient.) Create a folder named `images` in your home directory and place your balena image file there so it's available inside the container. 102 | 103 | ```sh 104 | ./build.sh [-m jetson-xavier-nx-devkit-emmc] 105 | ``` 106 | 107 | **NOTE**: The `jetson-xavier-nx-devkit-emmc` argument should be passed in command-line when flashing the CTI Photon Xavier NX. 108 | 109 | You can then enter the container using: 110 | 111 | ```sh 112 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image /bin/bash 113 | ``` 114 | 115 | Alternatively, run the provided docker-compose file with `docker-compose up` and ssh into the container with `docker exec -it /bin/bash` 116 | 117 | Once in the container, you can run jetson-flash by specifying the balena image in your host's `~/images/` folder (in place of ""): 118 | 119 | ```sh 120 | ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 121 | ``` 122 | 123 | You can alternatively just run the jetson-flash tool in a single command by running the container with this command: 124 | 125 | ```sh 126 | docker container run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/images:/data/images jetson-flash-image ./bin/cmd.js -f /data/images/ -m jetson-xavier-nx-devkit-emmc --accept-license=yes -c /tmp/Linux_for_Tegra 127 | ``` 128 | 129 | It will exit upon completion. 130 | 131 | --- 132 | 133 | The flashing process may take 5 - 15 minutes or longer during which a lot of log output will appear. If all goes well, you'll see something similar to the following upon completion: 134 | 135 | ``` 136 | *** The target t186ref has been flashed successfully. *** 137 | Reset the board to boot from internal eMMC. 138 | 139 | ``` 140 | ## Support 141 | 142 | If you're having any problems, please [raise an issue](https://github.com/balena-os/jetson-flash/issues/new) on GitHub or ask a question [in our forums](https://forums.balena.io/c/share-questions-or-issues-about-balena-jetson-flash-which-is-a-tool-that-allows-users-to-flash-balenaos-on-nvidia-jetson-devices/95) and the balena.io team will be happy to help. 143 | 144 | 145 | License 146 | ------- 147 | 148 | The project is licensed under the Apache 2.0 license. 149 | -------------------------------------------------------------------------------- /flash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/jetson-flash/9bb26340893cadd0599fd98a1a9f67c233bede0c/flash.jpg -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2020 Balena.io 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and * limitations under the License. 14 | */ 15 | 16 | 'use strict'; 17 | 18 | const _ = require('lodash'); 19 | const Bluebird = require('bluebird'); 20 | const bz2 = require('unbzip2-stream'); 21 | const filedisk = require('file-disk'); 22 | const fs = Bluebird.promisifyAll(require('fs')); 23 | const fse = require('fs-extra'); 24 | const GPT = require('gpt'); 25 | const hasha = require('hasha'); 26 | const partitionInfo = require('partitioninfo'); 27 | const streamToString = require('stream-to-string'); 28 | const tar = require('tar-fs'); 29 | 30 | const { SpinnerPromise } = require('resin-cli-visuals'); 31 | const { spawnSync } = require('child_process'); 32 | const { join, basename } = require('path'); 33 | const { get } = require('request'); 34 | 35 | const readFromDisk = async (disk, offset, size) => { 36 | const buff = await disk.read(Buffer.alloc(size), 0, size, offset); 37 | return buff.buffer; 38 | }; 39 | 40 | const fileHash = file => { 41 | return hasha.fromFile(file, { 42 | algorithm: 'sha1', 43 | }); 44 | }; 45 | 46 | const dirHash = dir => { 47 | return streamToString( 48 | tar.pack(dir).pipe( 49 | hasha.stream({ 50 | algorithm: 'sha1', 51 | }), 52 | ), 53 | ); 54 | }; 55 | 56 | const imageStampPath = output => { 57 | return join(output, 'stamp'); 58 | }; 59 | const dirStampPath = output => { 60 | return `${output}.stamp`; 61 | }; 62 | 63 | const checkOutputDir = output => { 64 | return fs 65 | .statAsync(dirStampPath(output)) 66 | .then(async () => { 67 | return ( 68 | (await fs.readFileAsync(dirStampPath(output))).toString() === 69 | (await dirHash(output)) 70 | ); 71 | }) 72 | .catch( 73 | { 74 | code: 'ENOENT', 75 | }, 76 | () => { 77 | return false; 78 | }, 79 | ); 80 | }; 81 | 82 | const checkImage = async (output, image) => { 83 | return new SpinnerPromise({ 84 | promise: fs 85 | .statAsync(dirStampPath(output)) 86 | .then(async () => { 87 | return ( 88 | (await fs.readFileAsync(imageStampPath(output))).toString() === 89 | (await fileHash(image)) 90 | ); 91 | }) 92 | .catch( 93 | { 94 | code: 'ENOENT', 95 | }, 96 | () => { 97 | return false; 98 | }, 99 | ), 100 | startMessage: `Checking image cache for ${image}`, 101 | stopMessage: `Cache image check done`, 102 | }); 103 | }; 104 | 105 | exports.sudoRm = output => { 106 | spawnSync('sudo', ['rm', '-r', output], { 107 | stdio: 'inherit', 108 | }); 109 | }; 110 | 111 | exports.outputRegister = async (output, persistent) => { 112 | await fse.ensureDir(output); 113 | 114 | if (!persistent) { 115 | process.on('SIGINT', () => { 116 | process.exit(); 117 | }); 118 | process.on('exit', () => { 119 | spawnSync('rm', ['-r', output], { 120 | stdio: 'inherit', 121 | }); 122 | }); 123 | } 124 | }; 125 | 126 | exports.extractPartition = async (image, partitionName, output) => { 127 | console.log( 128 | `Extracting partition ${partitionName} from ${image} to ${output}`, 129 | ); 130 | 131 | const partition = (await exports.getPartitionTableWithNames( 132 | image, 133 | )).partitions.find(part => { 134 | return part.name === partitionName; 135 | }); 136 | 137 | const path = join(output, partition.name); 138 | const read = fs.createReadStream(image, { 139 | start: partition.offset, 140 | end: partition.offset + partition.size - 1, 141 | }); 142 | const write = fs.createWriteStream(path); 143 | 144 | return new Bluebird((resolve, reject) => { 145 | read.pipe(write); 146 | read.on('end', () => { 147 | resolve(path); 148 | }); 149 | read.on('error', reject); 150 | }); 151 | }; 152 | 153 | exports.decompressTbz2FromUrl = (url, output) => { 154 | return new SpinnerPromise({ 155 | promise: new Bluebird((resolve, reject) => { 156 | const stream = tar.extract(output); 157 | stream.on('error', reject); 158 | stream.on('finish', resolve); 159 | get(url) 160 | .pipe(bz2()) 161 | .pipe(stream); 162 | }), 163 | startMessage: `Downloading and extracting ${url}`, 164 | stopMessage: `Saved in ${output}`, 165 | }); 166 | }; 167 | 168 | exports.checkConsistency = async dir => { 169 | const result = await new SpinnerPromise({ 170 | promise: checkOutputDir(dir), 171 | startMessage: `Checking artifact consistency for ${dir}`, 172 | stopMessage: `Consistency check done for ${dir}`, 173 | }); 174 | 175 | if (!result) { 176 | await fse.remove(dir); 177 | await fse.emptyDir(dir); 178 | } 179 | 180 | return result; 181 | }; 182 | 183 | exports.cached = async (output, image) => { 184 | console.log('Checking resin cache'); 185 | 186 | const result = 187 | (await checkImage(output, image)) && 188 | (await exports.checkConsistency(output)); 189 | 190 | if (!result) { 191 | await fse.remove(imageStampPath(basename(output))); 192 | await fse.emptyDir(output); 193 | } 194 | 195 | return result; 196 | }; 197 | 198 | exports.generateStamp = async dir => { 199 | return fs.writeFileAsync( 200 | dirStampPath(dir), 201 | await new SpinnerPromise({ 202 | promise: dirHash(dir), 203 | startMessage: `Generate hash for ${dir}`, 204 | stopMessage: `Successfully generated hash`, 205 | }), 206 | ); 207 | }; 208 | 209 | exports.generateCache = async (output, image) => { 210 | await fs.writeFileAsync(imageStampPath(output), await fileHash(image)); 211 | await exports.generateStamp(output); 212 | }; 213 | 214 | exports.getPartitionTableWithNames = async image => { 215 | const MBR_SIZE = 512; 216 | const GPT_SIZE = 512 * 33; 217 | 218 | const rawTable = await Bluebird.using( 219 | filedisk.openFile(image, 'r'), 220 | async fd => { 221 | return GPT.parse( 222 | await readFromDisk(new filedisk.FileDisk(fd), MBR_SIZE, GPT_SIZE), 223 | ); 224 | }, 225 | ); 226 | const partTable = await partitionInfo.getPartitions(image); 227 | 228 | partTable.partitions.forEach((partition, i) => { 229 | partition.name = rawTable.partitions[i].name; 230 | }); 231 | 232 | return partTable; 233 | }; 234 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jetson-flash", 3 | "version": "0.5.87", 4 | "description": "This tool allows users to flash BalenaOS on specific Jetson devices using Nvidia flashing tools.", 5 | "scripts": { 6 | "test": "tap --timeout=0 --no-coverage --after=tests/cleanup.js", 7 | "start": "bin/cmd.js" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/balena-os/jetson-flash.git" 12 | }, 13 | "keywords": [ 14 | "flash", 15 | "balenaOS", 16 | "USB" 17 | ], 18 | "author": "Theodor Gherzan", 19 | "license": "Apache-2.0", 20 | "bugs": { 21 | "url": "https://github.com/balena-os/jetson-flash/issues" 22 | }, 23 | "homepage": "https://github.com/balena-os/jetson-flash#readme", 24 | "dependencies": { 25 | "apply-patch": "^0.1.2", 26 | "balena-image-fs": "^7.4.1", 27 | "balena-sdk": "^16.38.0", 28 | "bluebird": "^3.7.2", 29 | "ext2fs": "^4.2.4", 30 | "file-disk": "^7.0.1", 31 | "fs-extra": "^9.1.0", 32 | "hasha": "^5.2.2", 33 | "install": "^0.13.0", 34 | "lodash": "^4.17.21", 35 | "make-dir": "^3.1.0", 36 | "npm": "^7.11.1", 37 | "partitioninfo": "^6.0.2", 38 | "progress-stream": "^2.0.0", 39 | "request": "^2.88.2", 40 | "resin-cli-visuals": "^1.8.0", 41 | "stream-to-string": "^1.2.0", 42 | "string-to-stream": "^3.0.1", 43 | "tar-fs": "^2.1.1", 44 | "unbzip2-stream": "^1.4.3", 45 | "xml-js": "^1.6.11", 46 | "yargs": "^16.2.0" 47 | }, 48 | "versionist": { 49 | "publishedAt": "2025-03-18T19:55:54.583Z" 50 | }, 51 | "engines": { 52 | "node": ">=16" 53 | }, 54 | "devDependencies": { 55 | "tap": "^16.3.4" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /run_http_server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd /tmp/ 4 | python3 -m http.server 80 & 5 | popd 6 | 7 | bash 8 | -------------------------------------------------------------------------------- /scripts/resin-image-flasher-unwrap.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 - 2020 Balena.io 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 'use strict'; 18 | 19 | const _ = require('lodash'); 20 | const Bluebird = require('bluebird'); 21 | const progressStream = require('progress-stream'); 22 | const balenafs = require('balena-image-fs'); 23 | 24 | const { createReadStream, createWriteStream } = require('fs'); 25 | const { getPartitions } = require('partitioninfo'); 26 | const { join } = require('path'); 27 | const { Progress } = require('resin-cli-visuals'); 28 | const pipeline = Bluebird.promisify(require('stream').pipeline); 29 | 30 | const RESIN_FLASHER = { 31 | bootID: 1, 32 | rootfsID: 2, 33 | resinImagePath: '/opt/', 34 | }; 35 | 36 | const EFI_CODES = { 37 | gpt: 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B', 38 | mbr: '14', 39 | }; 40 | 41 | const getResinImageFromFlasher = async (image, output) => { 42 | const RESIN_IMAGE_REGEX = new RegExp('^(resin|balena)-image.*\.(resin|balena)os-img'); 43 | 44 | console.log(`Retrieve BalenaOS image from ${image}`); 45 | await balenafs.interact(image, RESIN_FLASHER.rootfsID, async fs => { 46 | const path = join( 47 | RESIN_FLASHER.resinImagePath, 48 | (await Bluebird.promisify(fs.readdir)(RESIN_FLASHER.resinImagePath)).find(value => { 49 | return RESIN_IMAGE_REGEX.test(value); 50 | }), 51 | ); 52 | const size = (await Bluebird.promisify(fs.stat)(path)).size; 53 | const stream = fs.createReadStream(path); 54 | 55 | return new Bluebird((resolve, reject) => { 56 | const bar = new Progress(`Writing to ${output}`); 57 | const str = progressStream({ 58 | length: size, 59 | time: 1000, 60 | }); 61 | const out = createWriteStream(output); 62 | 63 | stream.pipe(str).pipe(out); 64 | 65 | stream.on('error', reject); 66 | stream.on('end', resolve); 67 | 68 | str.on('progress', update => { 69 | bar.update({ 70 | percentage: update.percentage, 71 | eta: update.eta, 72 | }); 73 | }); 74 | }); 75 | }); 76 | }; 77 | 78 | // FIXME This function needs to be reimplemented once the fatfs module is fixed 79 | const copyResinConfigurationOver = async (flasherImage, resinImage) => { 80 | const paths = ['/config.json', '/system-connections', '/dispatcher.d', '/splash']; 81 | 82 | const findResinBootPart = async image => { 83 | const table = await getPartitions(image); 84 | return table.partitions.find(value => { 85 | return value.type === EFI_CODES[table.type]; 86 | }); 87 | }; 88 | 89 | const createFSH = options => { 90 | const recurse = async (fs, path) => { 91 | const stat = await Bluebird.promisify(fs.stat)(path).catch( 92 | { 93 | code: 'ISDIR', 94 | }, 95 | () => { 96 | return null; 97 | }, 98 | ); 99 | const node = { 100 | path, 101 | }; 102 | 103 | if (stat === null || stat.isDirectory()) { 104 | const subpaths = await Bluebird.promisify(fs.readdir)(path); 105 | node.type = 'directory'; 106 | node.mode = stat ? stat.mode : null; 107 | node.children = await Bluebird.map(subpaths, async p => { 108 | return await recurse(fs, join(path, p)); 109 | }); 110 | } else if (stat.isFile()) { 111 | node.type = 'file'; 112 | node.mode = stat.mode; 113 | } else { 114 | throw new Error(`Unkown type for ${path}`); 115 | } 116 | return node; 117 | }; 118 | 119 | return balenafs.interact(options.image, options.partition, fs => { 120 | return recurse(fs, options.path); 121 | }); 122 | }; 123 | 124 | const resinImageBootPartID = (await findResinBootPart(resinImage)).index; 125 | const performCopy = async paths => { 126 | await Bluebird.each(paths, async path => { 127 | await balenafs.interact(resinImage, resinImageBootPartID, async fs => { 128 | if (path.type === 'directory') { 129 | //We cannot create directories at the moment, so we skip this action 130 | await performCopy(path.children); 131 | } 132 | }) 133 | 134 | if (path.type === 'file') { 135 | await balenafs.interact(flasherImage, RESIN_FLASHER.bootID, async fsFlasher => { 136 | await balenafs.interact(resinImage, resinImageBootPartID, async fsImage => { 137 | await pipeline( 138 | fsFlasher.createReadStream(path.path), 139 | fsImage.createWriteStream(path.path) 140 | ) 141 | }) 142 | }) 143 | } 144 | }); 145 | }; 146 | 147 | console.log( 148 | `Copying resin configuration from ${flasherImage} to ${resinImage}`, 149 | ); 150 | const toCopy = await Bluebird.map( 151 | paths, 152 | path => { 153 | return createFSH({ 154 | image: flasherImage, 155 | partition: RESIN_FLASHER.bootID, 156 | path, 157 | }).catch( 158 | { 159 | code: 'NOENT', 160 | }, 161 | () => { 162 | return null; 163 | }, 164 | ); 165 | }, 166 | { 167 | concurrency: 1, 168 | }, 169 | ).filter(fsh => { 170 | return fsh !== null; 171 | }); 172 | 173 | await performCopy(toCopy); 174 | }; 175 | 176 | exports.unwrapResinImageFlasher = async (image, output) => { 177 | const table = await getPartitions(image); 178 | 179 | const files = await balenafs.interact( 180 | image, 181 | table.partitions.find(value => { 182 | return value.type === EFI_CODES[table.type]; 183 | }).index, 184 | async fs => { 185 | return await Bluebird.promisify(fs.readdir)('/') 186 | } 187 | ) 188 | 189 | if (files.includes('resin-image-flasher') || files.includes('balena-image-flasher')) { 190 | await getResinImageFromFlasher(image, output); 191 | await copyResinConfigurationOver(image, output); 192 | } else { 193 | await pipeline(createReadStream(image), createWriteStream(output)); 194 | } 195 | 196 | return output; 197 | }; 198 | -------------------------------------------------------------------------------- /tests/cleanup.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | 3 | console.log('cleaning up images') 4 | fs.unlinkSync('jetson-tx2.img'); 5 | fs.rmSync('jetson-flash-artifacts', { recursive: true, force: true }); 6 | -------------------------------------------------------------------------------- /tests/index.js: -------------------------------------------------------------------------------- 1 | const tap = require('tap') 2 | const fs = require('fs') 3 | const ResinJetsonFlash = require('../lib/resin-jetson-flash.js'); 4 | 5 | 6 | const { getSdk } = require('balena-sdk'); 7 | 8 | const IMAGE_PATH = 'jetson-tx2.img' 9 | 10 | const balena = getSdk({ 11 | apiUrl: "https://api.balena-cloud.com/", 12 | }); 13 | 14 | tap.test('Test jetson-flash artifact preperation', async t => { 15 | // download tx2 image with sdk 16 | await new Promise(async (resolve, reject) => { 17 | t.comment('Downloading image...') 18 | balena.models.os.download('jetson-tx2').then(function(stream) { 19 | stream.pipe(fs.createWriteStream(IMAGE_PATH)); 20 | stream.on("finish", () => { 21 | resolve(); 22 | }) 23 | }); 24 | }) 25 | 26 | const Flasher = new ResinJetsonFlash( 27 | 'jetson-tx2', 28 | IMAGE_PATH, 29 | '', 30 | `${__dirname}/../assets/jetson-tx2-assets`, 31 | './jetson-flash-artifacts', 32 | ); 33 | 34 | await t.resolves( 35 | Flasher.generateArtifacts(), 36 | 'Should generate artifacts without errors' 37 | ) 38 | }) 39 | --------------------------------------------------------------------------------