Last active
September 11, 2024 22:50
-
-
Save ghazanhaider/15328e1c82389afdf705c40abe857c5d to your computer and use it in GitHub Desktop.
Setting up SAM-BA across architectures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Microchip SAM-BA is only released for x86_64 architecture and will not run on arm64 | |
# These steps allow it to be run under Ubuntu arm64 using qemu-user successfully | |
- Install Ubuntu (24.04.01) | |
- sudo apt install: | |
qemu-user | |
qemu-user-static | |
gcc-aarch64-linux-gnu | |
binutils-aarch64-linux-gnu | |
binutils-aarch64-linux-gnu-dbg | |
build-essential | |
- For other arch, get this package list first: | |
https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu/dists/noble/main/binary-amd64/Packages.gz | |
- Download these packages from another arch repo: | |
libbsd0_0.12.1-1build1_amd64.deb | |
libcap2_2.66-5ubuntu2_amd64.deb | |
libgl1_1.7.0-1build1_amd64.deb | |
libglib2.0-0t64_2.80.0-6ubuntu1_amd64.deb | |
libglvnd0_1.7.0-1build1_amd64.deb | |
libglx0_1.7.0-1build1_amd64.deb | |
libmd0_1.1.0-2build1_amd64.deb | |
libpcre2-8-0_10.42-4ubuntu2_amd64.deb | |
libudev1_255.4-1ubuntu8_amd64.deb | |
libudev-dev_255.4-1ubuntu8_amd64.deb | |
libx11-6_1.8.7-1build1_amd64.deb | |
libxau6_1.0.9-1build6_amd64.deb | |
libxcb1_1.15-1ubuntu2_amd64.deb | |
libxdmcp6_1.1.3-0ubuntu6_amd64.deb | |
libzstd1_1.5.5+dfsg2-2build1_amd64.deb | |
mesa-common-dev_24.0.5-1ubuntu1_amd64.deb | |
udev_255.4-1ubuntu8_amd64.deb | |
zlib1g_1.3.dfsg-3.1ubuntu2_amd64.deb | |
REPO PREFIX: https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu/ | |
Add "Filename:" from Packages.gz which starts with "pool/" | |
- Unarchive each deb: ar -x XXX.deb | |
- Unzip the resulting data.tar.zst for each deb: tar xvf data.tar.zst | |
- Copy all libraries to the target folder: | |
cp usr/lib/x86_64-linux-gnu/* /usr/x86_64-linux-gnu/lib/ | |
- Download sam-ba for Linux and unzip | |
- Run sam-ba like so: | |
alias samba='qemu-amd64 -L /usr/x86_64-linux-gnu/ ./samba/sam-ba -d sama5d2:4:1 -t 1' | |
If the above steps fail, check to see if sam-ba or one of its libraries needs another library: | |
/usr/x86_64-linux-gnu/bin/readelf -d /usr/x86_64-linux-gnu/lib/libcap | |
(reference: https://azeria-labs.com/arm-on-x86-qemu-user/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment