This shows you the differences between two versions of the page.
ass:labs-2025:01 [2025/08/03 15:07] florin.stancu |
ass:labs-2025:01 [2025/08/04 12:36] (current) florin.stancu [01 - Firmware & Bootloaders] |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
- | ===== 01 - Firmware & Bootloaders ===== | + | ===== 01 - Firmware & Bootloader ===== |
===== Objectives ===== | ===== Objectives ===== | ||
Line 27: | Line 27: | ||
When everything is ready, you'll get to fire up the board, upload the firmware image package using NXP's specific serial boot protocol and play with it! | When everything is ready, you'll get to fire up the board, upload the firmware image package using NXP's specific serial boot protocol and play with it! | ||
- | |||
- | ==== Connecting to the VM ==== | ||
- | |||
- | If you wish to run the build locally, make sure you have a pretty powerful x64 laptop/PC (8-16 powerful cores, 32GB RAM, 50GB SSD free space). | ||
- | |||
- | Otherwise, we offer some rather powerful VMs hosted inside the Faculty’s private cloud (OpenStack) for use with this workshop. | ||
- | |||
- | It’s going to be a headless (no graphics) server-like environment, so Linux command line knowledge is required. Don’t worry, you have all the tools you need in there (plus a tweaked Zsh, TMux for running persistent/multiplexed terminals and vim with AstroNvim config for enthusiasts). | ||
- | |||
- | But first, you will need to gain access to this VM. To do this, you must create a SSH private/public key pair and give the public counterpart to the superviser for account creation & authorization (do this on your personal PC / laptop in a Linux sh-compatible shell or Windows Powershell), generate a public/private SSH keypair: | ||
- | |||
- | <code bash> | ||
- | # first, check if a keypair already exists | ||
- | you@laptop:~# ls ~/.ssh/ | ||
- | # if the files `id_ed25519` and `id_ed25519.pub` already exist, SKIP everything else! | ||
- | you@laptop:~# ssh-keygen -t ed25519 # Edwards curves: better & shorter keys! | ||
- | # answer the defaults (aka just press enter multiple times) | ||
- | you@laptop:~# ls -l ~/.ssh/ | ||
- | -rw------- 1 root root 2602 Oct 15 12:59 id_ed25519 # <-- THE PRIVATE KEY, keep secret! | ||
- | -rw-r--r-- 1 root root 571 Oct 15 12:59 id_ed25519.pub # <-- your PUBLIC key to give away! | ||
- | # print and copy the private key (including the 'ssh-ed25519' prefix!): | ||
- | you@laptop:~# cat ~/.ssh/id_ed25519.pub | ||
- | ssh-ed25519 AAAAB3NzaC... # a longish line containing the public key number + email | ||
- | </code> | ||
- | |||
- | Now copy and paste your public key and give it to a supervisor (together with a preferred username to be created) to gain access to the build machine and wait for confirmation... | ||
- | |||
- | Finally, try to connect to your assigned VM and port, e.g.: | ||
- | |||
- | <code bash> | ||
- | ssh youruser@arm2025.root.sx -p 221X # where X is your assigned VM index | ||
- | </code> | ||
- | |||
- | <note tip> | ||
- | **Suggestion #1:** After manually solving each task, automate the steps you've taken by writing a [[https://makefiletutorial.com/|Makefile]]. Chances are that you're going to have to rebuild things (at least partially) dozens of times, and you'll also need to reuse your scripts usable for the next labs as well! E.g.: <code Makefile> | ||
- | export CROSS_COMPILE = /path/to/your/toolchain/gcc-prefix...- | ||
- | |||
- | ATF_DIR = imx-atf | ||
- | ATF_MAKE_FLAGS = SPD=none PLAT=TODO... | ||
- | atf: | ||
- | make -C "$(ATF_DIR)" $(ATF_MAKE_FLAGS) | ||
- | |||
- | UBOOT_DIR = u-boot-tn-imx | ||
- | UBOOT_MAKE_FLAGS = | ||
- | uboot: | ||
- | make -C "$(UBOOT_DIR)" $(UBOOT_MAKE_FLAGS) | ||
- | |||
- | .PHONY: uboot atf | ||
- | # ... and so on ! | ||
- | </code> | ||
- | |||
- | **Suggestion #2:** You can either manually download all required open-source projects via git or use git submodules and add them to a parent repository! But beware though: Linux's repo is quite huge (several GBs -- but you'll see it yourself in the next lab)! | ||
- | </note> | ||
{{namespace>:ass:labs-2025:01:tasks&nofooter&noeditbutton}} | {{namespace>:ass:labs-2025:01:tasks&nofooter&noeditbutton}} | ||