This commit is contained in:
2024-12-26 16:33:50 -05:00
parent 36f7f9e639
commit 12261e3fa5
19 changed files with 0 additions and 1 deletions

View File

@@ -0,0 +1,240 @@
# TSYS Group Handbook - Engineering Documentation - Team SwEng - Supply Chain
## Version
* 1.0 published 03/11/2021 at 08:30 CST
## Introduction
This article covers the high level overview of the software supply chain for the orbiter, ground station, operations center.
It touches very briefly on the hardware that will be used in the proof of concept. We have a separate article, that goes into far more detail about the hardware.
This article also doesn't touch on the software tooling (compilers and such), which is extensive and is documented in another article.
## Avionics - Seeduino
This is the core of the software system for the orbiter. It's where the magic happens, and is subject to full regulatory review/compliance requirements. It must do very few things, and it must do them perfectly.
This is all going to be custom code.
### Main board
* The proof of concept utilizes Seeduino LoraWANGPS boards:
Overview: <https://www.seeedstudio.com/Seeeduino-LoRaWAN-W-GPS-p-2781.html>
Technical Documentation: <https://wiki.seeedstudio.com/Seeeduino_LoRAWAN/> (unfortunately no ability to deep link on that page, so read it over for example code of Lora send/receive, battery checking etc)
* The boards will be running all code via FreeRTOS:
* <https://www.freertos.org/FreeRTOS-quick-start-guide.html>
* <https://wiki.seeedstudio.com/Software-FreeRTOS/>
* <https://github.com/Seeed-Studio/Seeed_Arduino_FreeRTOS>
* <https://github.com/Seeed-Studio/Seeed_Arduino_ooFreeRTOS>
FreeRTOS will need to interface with the following groove boards connected to the Seeduino via i2c:
(see <https://wiki.seeedstudio.com/Arduino_Software_I2C_user_guide/> for notes on multiple i2c)
### IMU
* This is where all the sensor data will come from.
* IMU:
<https://www.seeedstudio.com/Grove-IMU-10DOF-p-2386.html>
<https://wiki.seeedstudio.com/Grove-IMU_10DOF/>
<https://github.com/Seeed-Studio/Seeed_Arduino_IMU10DOF>
* Functions
* ReadPitch
* ReadYaw
* ReadRoll
* ReadTime
* ReadTemp
* ...(etc) (whatever the board can provide) (maybe a single function that takes an argument, whatever)
### Parafoil Control
* Control of the parafoil is critical, and will likely receive the most regulatory scrutiny.
* Motor driver board:
<https://wiki.seeedstudio.com/Grove-I2C_Motor_Driver_V1.3/>
<https://github.com/Seeed-Studio/Grove_I2C_Motor_Driver_v1_3/>
* Functions
* OrbiterOperateParafoil (left,right,up,down) [to operate the parafoil motors]
* OrbiterCutDown
* EnvelopePop
* DeployParafoil
* OrbiterSelfDestruct
### Power Management
Where the batteries, cells, load all comes together. The below board will be interfaced to (for data reading purposes) from the Seeduino via (I believe GPIO, but maybe i2c (check the docs)):
<http://www.switchdoc.com/sunairplus-solar-power-controllerdata-collector/>
* Functions
* ReadVoltage
* ReadCurrent
* ReadAmps
* ReadChargeLevel
* ... (etc)
### Telemetry
This key data:
* Charge levels
* Full IMU data
* Full sensor data (light,temp,etc)
needs to be broadcast to:
* Ground stations (via lora)
* other aircraft (via ads-b)
* Functions:
* (future, we have no ads-b currently) ADS-B(send) [for sending data over ads-b]
* (future, we have no ads-b currently) ADS-B(receive) [for receiving (listening) data over ads-b] (all smarts for processing would be on pi)
* lora(send) [to dump out telemetry to ground stations]
* lora(receive) [to receive operator instructions]
* IMU Sensor Read (logs to memory buffer in pi, so tile38 can read)
* IMU Sensor Send (broadcast on air)
* Data Logging
* GPS Read
* GPS Send
* Charge Status
* Voltage of Battery
Technical Documentation for the above, along with example code : <https://wiki.seeedstudio.com/Seeeduino_LoRAWAN/> (unfortunately no ability to deep link on that page, so read it over for example code of Lora send/receive, battery checking etc)
### Overhead / Housekeeping
Various things will be needed for regular management/housekeeping duties.
* Functions:
* TickleTheTail [keep the watchdog from activating]
<https://shop.switchdoc.com/collections/break-out-boards/products/switchdoc-labs-dual-watchdog-timer-board-for-arduino-raspberry-pi>>
is the hardware watchdog timer that we have in the shop.
This will be used to supervise/recover both the arduino and the pi.
## Avionics - Raspberry pi
The pi is essentially a large disk (for geo spatial db, holding avionics firmware, holding log data etc) and beefy CPU (for geo spatial lookups, processing ads-b data, perhaps some data crunching for local optimizations based on weather) attached to the avionics. The pi is important, but not completely critical. It can crash (and if not fixed by watchdog) can remain offline and the orbiter can come in for service safely. We will utilize best practices with the pi, to ensure it's as reliable/available as possible.
In poc the pi will be attached via USB (and also serving as a host for the arduino for firmware updates of the avionics ), in prototype/prod it will be on an integrated board as a Pi CM.
### Payload Power Management
Control of the power payload, on a geo fence basis, in a black box/non customer changeable is also super critical, and will likely receive the second most regulatory scrutiny.
In the prototype, the geo fence will utilize this board to cut/restore power:
<https://shop.switchdoc.com/collections/break-out-boards/products/usb-powercontrol-board-v2-w-grove-control-usb-to-usb-solid-state-relay-for-raspberry-pi-and-arduinos-v2>
* Functions
* Payload Power On
* Payload Power Off
* Payload Location Lookup
### geo gencing
<https://tile38.com/>
This will be utilized for geo-fencing. The pi will periodic query
GPS (or just read off the serial feed from the arduino) and cut off power to the payload (and restore it) at appropriate locations.
### operating system
Most likely will utilize a combination of
* balena os https://www.balena.io/os/
* openmtc https://www.openmtc.org/
### avionics updating
Updating the seeduino firmware image in flight, Will utilize the
* arduino-cli
system.
## Ground Station Avionics
This will be a relatively simple system, designed todo two functions:
* Receive lora broadcasts
* Convert the lora data to IP packets and push the packets to a bus for listeners to consume.
The ground station avionics software will do nothing else.
For receiving broadcasts:
* <https://github.com/RAKWireless>
* <https://github.com/RAKWireless/RAK831-LoRaGateway-RPi>
* For converting lora packets to IP and relaying data to an endpoint: <https://www.chirpstack.io/gateway-bridge/gateway/raspberrypi/>
* General lorawan software
<https://github.com/Lora-net>
* relaying to timeseries database
<https://github.com/mhe/mqtt2influxdb>
## Operations Center / Device fleet management
We must implement one bus listener: the Ops Center. Other parties may implement additional listeners as needed.
Primary software packages involved:
* <https://nasa.github.io/openmct/>
* <https://www.chirpstack.io/>
* Balena
* <https://www.balena.io/os/?>
* <https://www.balena.io/engine/?>
* <https://www.balena.io/open/?>
* <https://github.com/balena-io/open-balena?d_id=7632b330-6018-41b8-82ca-e5fab4fabf15R>
### Backend
### Client side
* <http://www.berryterminal.com/doku.php/berryboot>
* <http://www.berryterminal.com/doku.php/berryboot/adding_custom_distributions>
### Telemetry
* <https://richardstechnotes.wordpress.com/2015/12/26/iot-streaming-with-mqtt-and-apache-nifi/>
* <https://github.com/richards-tech/RTMQTT>
* <https://github.com/richards-tech/RTNiFiStreamProcessors>
* <https://github.com/richards-tech/RTIMULib2>
* <http://cpham.perso.univ-pau.fr/LORA/RPIgateway.html>
* <http://www.dragino.com/products/module/item/106-lora-gps-hat.html>
* <http://wiki.dragino.com/index.php?title=Lora/GPS_HAT#Example1_--_Use_with_LMIC_library_for_LoraWAN_compatible>
* <http://www.eleduino.com/Dragino-Lora-GPS_HAT-for-Raspberry-Pi-p10580.html>
* <http://www.aliexpress.com/store/product/Long-distance-wireless-433-868-915Mhz-Lora-and-GPS-Expansion-Board-for-Raspberry-Pi/1390863_32672385182.html>
* <http://csis.org/files/attachments/151216_Unmanned_Systems.pdf>
## Ground Station Payload
This will be written up later, and is for a dedicated payload team to worry about.
For knowledge capture purposes, some things to consider:
* <https://github.com/jhshi/openofdm>
* <https://openofdm.readthedocs.io/en/latest/overview.html>
* <https://news.ycombinator.com/item?id=25814237>
* <https://www.nuand.com/bladeRF-wiphy/>
* <https://news.ycombinator.com/item?id=24273919>
* <https://github.com/open-sdr/openwifi>

225
team-sweng/SwEngTooling.md Normal file
View File

@@ -0,0 +1,225 @@
# TSYS Group Handbook - Engineering Documentation - Team SwEng - Tooling
## Introduction
This article covers the tools and support stack/systems used by the software engineering team at Suborbital Systems. It should be read by everyone in the engineering organization.
## Sw Engineering Systems
* Build/dev/test systems
* buildbox (All compiles happen here (either directly or via jenkins invoking)
* subodev / suboqa (All dev/testing is done on these systems, in particular for hardware engineering test suite iteration etc)
* Production systems
* suboprod (All production workloads, validations, simulations run here, cuda enabled for speed. May use docker in future to allow easy sharing of cuda card and versioning workloads)
* suboprod01-05 (cuda tk1 cluster)
* opc01/02 (op center systems)
## General Information
* All systems have NTP sync time, and working DNS
* All systems have an MOTD covering the basics and pointers to detailed documentation
* All systems have /subo mounted via NFS
### /subo directory
localuser@buildbox:~$ ls /subo/
SupplyChain Tooling
localuser@buildbox:~$
* **SupplyChain** is for upstream software that is used in deliverables produced by engineering. It would also contain any libraries/custom software etc that engineering produces
* **Tooling** is for off the shelf , upstream, vendor software that is used to support engineering operations. Things like (cross) compilers, custom builds of software etc go in it.
Each directory has the same top-level layout:
```bash
SupplyChain:
bin lib scripts src
Tooling:
bin lib scripts src
```
* bin is for installed packages (either stand alone (go/java) executables , or compiled software distributions) (with sub directories off of bin for each package, even if it's a single executable (we like clean systems and toolboxes))
```bash
root@buildbox:/subo/Tooling/bin# ls team-sweng/
arduino-cli
root@buildbox:/subo/Tooling/bin# ls team-sweng/arduino-cli/
arduino-cli
root@buildbox:/subo/Tooling/bin#
```
This is then referenced in /etc/profile as part of the path:
```bash
export PATH="/subo/Tooling/bin/team-mecheng/openvsp/OpenVSP-3.23.0-Linux:\
/subo/Tooling/lib/miniconda/bin:\
/subo/Tooling/bin/team-sweng/arduino-cli:\
$PATH"
localuser@buildbox:~$ echo $PATH
/subo/Tooling/bin/team-mecheng/openvsp/OpenVSP-3.23.0-Linux:/subo/Tooling/lib/miniconda/bin:/subo/Tooling/bin/team-mecheng/openvsp/OpenVSP-3.23.0-Linux:/subo/Tooling/lib/miniconda/bin:/subo/Tooling/bin/team-sweng/arduino-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
localuser@buildbox:~$
```
We will probably create a /subo/bin directory and symlink things to it and add that to the path (if/when the $PATH environment variable becomes too long)
The path in /etc/profile must be updated on subodev/qa/prod when new software is built on buildbox (and installed to /subo/..../bin)
* lib is for any non apt-get installed libraries needed for anything we are building from source
* src is for the (typically) git clone/checkout of upstream software, with a sub directory for each package, just like bin.
* scripts is for scripts (see immediately below for two key scripts)
### Dependency tracking
```bash
root@buildbox:/subo/Tooling/scripts# ls
install-build-deps.sh install-runtime-deps.sh
root@buildbox:/subo/Tooling/scripts#
```
* Tracking Build Dependencies
If you apt-get a package/packages to make cmake/configure work, capture it in
**install-build-deps.sh**
* Tracking Runtime Dependencies
If you apt-get a package/packages to make cmake/configure work, capture it in
**install-runtime-deps.sh**
## Cross Compilers
### Cross compile for pi and make custom images
* <http://rpi-cloud.com/guide-install-jenkins-on-rpi/>
* <http://software-novotny.de/raspberry-pi-remote-compilation-with-jenkins>
* <http://watchmysys.com/blog/tag/cross-compile/>
* <https://github.com/andrius/build-raspbian-image>
* <https://github.com/debian-pi/raspbian-ua-netinst>
* atmel (arduino mega/uno)
* Documentation: <https://medium.com/swlh/how-to-create-an-automated-build-pipeline-for-your-arduino-project-1df9826f2a5e>
* Location on buildbox:
```bash
/subo/Tooling/src/team-sweng/cross-compile/rpi
```
* pi
* Documentation: <https://www.raspberrypi.org/documentation/linux/kernel/building.md> and
<https://blog.kitware.com/cross-compiling-for-raspberry-pi/>
* Location on buildbox:
```bash
/subo/Tooling/src/team-sweng/cross-compile/rpi
```
which contains the current checkout (as of 03/02/2021)
* cortex (m0)
* Documentation: <https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm>
* Location on buildbox:
```bash
/subo/Tooling/src/team-sweng/cross-compile/cortexm0
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/cortexm0 ls
binutils-gdb gcc newlib-cygwin
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/cortexm0
```
* crosstool-ng
* Documentation: <http://crosstool-ng.github.io/docs/install/>
* Location on buildobx:
```bash
/subo/Tooling/src/team-sweng/cross-compile/crosstool-ng
```
which may well prove easier/better than the raw cloned sources enumerated in the last bullet point.
* nvidia
We will be making extensive use of Nvidia systems at subo, especially in R&d (for engineering/validation etc)
* Documentation: * <https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/> and * <https://elinux.org/Jetson/Installing_CUDA>
Also see below under Software Development Kits , the CUDA bullet.
## Regular Compilers
buildbox is Ubuntu 20.04 and has bison/flex/autoconf/gcc/g++/build-essential (etc etc) via apt-get install as of 03/02/2021. run apt-get update/upgrade at any time (since anything regulatory scope, we build/install/version lock in /subo/....)
## Meta tooling
* distcc ?
* ccache ?
* ninja make?
## Software Development Kits
### CUDA / JetPack
* <https://developer.nvidia.com/cuda-downloads>
* <https://developer.nvidia.com/embedded/jetpack>
So this will be a bit tricky. We have three CUDA targets:
1 suboprod vm (hosted on pfv-vmsrv-02)
```bash
root@pfv-vmsrv-02:~# lspci |grep -i nv
01:00.0 VGA compatible controller: NVIDIA Corporation GF104GLM [Quadro 3000M] (rev a1)
```
2 jetson nano (<https://developer.nvidia.com/embedded/jetson-nano-developer-kit>) (this might? use cuda)
3 suboprod01-05 (tk1) (kepler)
* <https://developer.nvidia.com/blog/jetson-tk1-mobile-embedded-supercomputer-cuda-everywhere/>
(this uses cuda actual)
* <https://developer.nvidia.com/embedded-computing>
* <https://developer.nvidia.com/embedded/jetson-developer-kits>
* <http://mercury.pr.erau.edu/~siewerts/cec450/documents/Jetson/Tegra_Linux_Driver_Package_Developers_Guide.pdf>
Charles may tackle this, either way it's a (for now) low priority as far as tooling goes for
software engineering tooling. On the other hand, hardware/mechanical engineering will have much greater need for this stack for simulations/validation etc (for example <https://developer.nvidia.com/blog/drop-in-acceleration-gnu-octave/>).
### Areas to explore
* CUDA clustering
* mixed gpu gens/archs
### Links
* <https://www.google.com/search?client=firefox-b-e&q=ubuntu+20.04+cuda+cross+compile&oq=ubuntu+20.04+cuda+cross+compile&aqs=heirloom-srp>..
* <https://www.google.com/search?q=cuda+jenkins&oq=cuda+jenkins&aqs=chrome..69i57.2296j0j7&sourceid=chrome&ie=UTF-8>
* <https://www.google.com/search?client=firefox-b-e&q=cuda+build+server>
* <https://www.google.com/search?client=firefox-b-e&ei=cFxIYKzcDJaStAaMsKrICA&q=cuda+ci+server&oq=cuda+ci+server&gs_lcp=Cgdnd3Mtd2l6EAM6BwgAEEcQsANQ3idYmShg3SloAnACeACAAYYDiAH6BJIBBzAuMi4wLjGYAQCgAQGqAQdnd3Mtd2l6yAEIuAECwAEB&sclient=gws-wiz&ved=0ahUKEwis1PyjgqXvAhUWCc0KHQyYCokQ4dUDCA4&uact=5>
* <https://www.vitaarca.net/post/tech/install-cuda-and-cudnn-to-ubuntu-server/>
* <https://stackoverflow.com/questions/63309619/is-it-possible-to-build-an-nvidia-cuda-based-image-on-a-server-without-a-gpu>
* <https://jupyterhub.readthedocs.io/en/latest/>
* <https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html>
* <https://crosstool-ng.github.io/docs/>

View File

@@ -0,0 +1,109 @@
# Tooling Task List
## Add architecture-specific directories to file tree
### Various cross-compiler parts
-----
From <https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm>, you can find the following:
### GNU C/C++ Compiler
You can find the sources to Arm Embedded GCC at [git://gcc.gnu.org/git/gcc.git](git://gcc.gnu.org/git/gcc.git). All contributions are made to trunk. Patches are cherry-picked as needed to the Arm embedded branches.
### Binutils
You can find the sources to Arm Embedded Binutils at [git://sourceware.org/git/binutils-gdb.git](git://sourceware.org/git/binutils-gdb.git). All embedded branches are under [users/ARM/embedded-binutils-[version]-branch](users/ARM/embedded-binutils-[version]-branch). Contribution is similar to GCC.
### GDB
You can find the sources to Arm Embedded Binutils at [users/ARM/embedded-binutils-[version]-branch](git://sourceware.org/git/binutils-gdb.git). All embedded branches are at [users/ARM/embedded-gdb-[version]-branch](users/ARM/embedded-gdb-[version]-branch). You can contribute in the same way that you contribute to GCC.
### Newlib
You can find the sources at [users/ARM/embedded-gdb-[version]-branch](users/ARM/embedded-gdb-[version]-branch). We contribute to master, and the toolchain is based on master branch.
-----
### crosstool-NG [http://crosstool-ng.org/#download_and_usage](http://crosstool-ng.org/#download_and_usage)
x86 install (buildbox)
### Arduino-cli
x86 - RPi cluster install (into /subo/arm directory), deploying Uno and Mega Arduinos)
### Cross-compilers
x86-to-ARM cross-compiler (gcc, binutils, gdb), deploying RPi
x86-to-M0 cross-compiler (gcc, binutils, gdb), deploying M0
x86-to-AVR cross-compiler (gcc, etc.?), deploying Uno, Mega
### CUDA / JetPack (low priority)
suboprod
jetson nano
suboprod[n] - 01 through 05
### Configure Jenkins
-----
## Avionics - Seeeduino
### Install FreeRTOS
### IMU - Interface with
Multiple i2c
IMU
Functions - ReadPitch, ReadYaw, ReadRoll, ReadTime, ReadTemp, etc.
### Parafoil Control
Motor driver board drivers
Functions - OrbiterOperateParafoil (motor left, right, up, down), OrbiterCutDown, EnvelopePop, DeployParafoil, OrbiterSelfDestruct
### Power Management
Functions - ReadVoltage, ReadCurrent, ReadAmps, ReadChargeLevel, etc.
### Telemetry
Key data - Charge levels, Full IMU data, Full sensor data (light, temp, etc.)
Broadcast to ground stations (via lora), other aircraft (via ads-b)
Functions
> Future, no ads-b yet, ADS-B(send), ADS-B(receive)
>
> Lora(send), lora(receive), IMU Sensor Read, IMU
Sensor Send, Data Logging, GPS Read, GPS Send, Charge Status, Battery Voltage
### Overhead / Housekeeping
Functions - TickleTheTail
## Avionics - Raspberry Pi
Payload Power Management
### Functions - Payload Power On, Payload PowerOff, Payload Location Lookup
### Geo Fencing obtain tile38 data
### Operating System - Balena OS, Openmtc
### Avionics Updating will use Arduino-cli
## Ground Station Avionics
### Receive lora broadcasts
### Convert lora data to IP packets, push packets to a bus
### Set up chirpserver
### Set up openmtc

View File

@@ -0,0 +1,4 @@
CNW 05/27/2021 at 11:19 am
https://github.com/arduino/toolchain-avr

View File

@@ -0,0 +1,129 @@
# Cross Compiler Notes - cotextm0
Begin active work (other than git clone and such ) at 18:09 on 05/28/2021
Quick look at bash history (to document git clones)
738 02/19/2021 20:56:24 git clone --depth=1 https://github.com/raspberrypi/linux
874 03/02/2021 21:04:48 git clone git://sourceware.org/git/newlib-cygwin.git
876 03/02/2021 21:03:33 git clone git://sourceware.org/git/binutils-gdb.git
897 03/02/2021 20:52:16 git clone git://gcc.gnu.org/git/gcc.git
914 03/02/2021 21:02:45 git clone https://github.com/crosstool-ng/crosstool-ng.git
1099 03/07/2021 15:22:03 git clone https://github.com/librenms/librenms-agent.git
1497 05/28/2021 13:58:59 git clone git://gcc.gnu.org/git/gcc.git
1513 05/28/2021 18:08:05 history |grep git|grep clone
So this has been on again/off again for about two months. Glad to be wrapping it up.
Attempting to run the build script (./build-prerequisites.sh) gives us an error:
```console
+2021-05-28:18:13:57 (./build-prerequisites.sh:132): echo Task '[I-0]' /x86_64-linux-gnu/zlib/
Task [I-0] /x86_64-linux-gnu/zlib/
+2021-05-28:18:13:57 (./build-prerequisites.sh:133): rm -rf /subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-native/zlib
+2021-05-28:18:13:57 (./build-prerequisites.sh:134): copy_dir_clean /subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/src/zlib-1.2.8 /subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-native/zlib
+2021-05-28:18:13:57 (/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-common.sh:50): copy_dir_clean(): set +u
+2021-05-28:18:13:57 (/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-common.sh:51): copy_dir_clean(): mkdir -p /subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-native/zlib
+2021-05-28:18:13:57 (/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-common.sh:52): copy_dir_clean(): cd /subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/src/zlib-1.2.8
/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-common.sh: line 52: cd: /subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/src/zlib-1.2.8: No such file or directory
+2021-05-28:18:13:57 (/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-common.sh:56): copy_dir_clean(): cd /subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-native/zlib
+2021-05-28:18:13:57 (/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major/build-common.sh:56): copy_dir_clean(): tar xf -
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major# ls build-native/
zlib
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major# ls build-native/
.stage zlib/
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major# ls build-native/zlib/
```
Which is expected as zlib isn't downloaded, though it arguably should be by install-sources.sh which utilizes build-common.sh which is where you find the
actual download URLs. Light edit I did, was changing URLs from ftp to http. Between release.txt and the How-to-build-toolchain.pdf I got the following results:
```console
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major# ls src/
binutils-gdb gcc gmp-6.1.0.tar.bz2 isl-0.18.tar.xz mpc-1.0.3.tar.gz mpfr-3.1.4.tar.bz2 newlib-cygwin
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major#
```
Since this was written for ubuntu 14.04 , i'm guessing URLs are out of date.... so...
```
GMP_URL=https://gmplib.org/download/gmp/$GMP_PACK
MPFR_URL=http://www.mpfr.org/$MPFR/$MPFR_PACK
MPC_URL=http://ftp.gnu.org/gnu/mpc/$MPC_PACK
ISL_URL=http://isl.gforge.inria.fr/$ISL_PACK
EXPAT_URL=https://downloads.sourceforge.net/project/expat/expat/$EXPAT_VER/$EXPAT_PACK
LIBELF_URL=https://fossies.org/linux/misc/old/$LIBELF_PACK
LIBICONV_URL=https://ftp.gnu.org/pub/gnu/libiconv/$LIBICONV_PACK
ZLIB_URL=http://www.zlib.net/fossils/$ZLIB_PACK
ENV_VAR_UPDATE_URL=http://nsis.sourceforge.net/mediawiki/images/a/ad/$ENV_VAR_UPDATE_PACK
PYTHON_WIN_URL=https://www.python.org/ftp/python/$PYTHON_WIN_VER/$PYTHON_WIN_PACK
BUGURL="https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major# grep PACK build-common.sh
PACKAGEDIR=$ROOT/pkg
GMP_PACK=$GMP.tar.bz2
MPFR_PACK=$MPFR.tar.bz2
MPC_PACK=$MPC.tar.gz
ISL_PACK=$ISL.tar.xz
EXPAT_PACK=$EXPAT.tar.bz2
LIBELF_PACK=$LIBELF.tar.gz
LIBICONV_PACK=$LIBICONV.tar.gz
ZLIB_PACK=$ZLIB.tar.gz
ENV_VAR_UPDATE_PACK=$ENV_VAR_UPDATE.7z
PYTHON_WIN_PACK=$PYTHON_WIN.msi
GMP_URL=https://gmplib.org/download/gmp/$GMP_PACK
MPFR_URL=http://www.mpfr.org/$MPFR/$MPFR_PACK
MPC_URL=http://ftp.gnu.org/gnu/mpc/$MPC_PACK
ISL_URL=http://isl.gforge.inria.fr/$ISL_PACK
EXPAT_URL=https://downloads.sourceforge.net/project/expat/expat/$EXPAT_VER/$EXPAT_PACK
LIBELF_URL=https://fossies.org/linux/misc/old/$LIBELF_PACK
LIBICONV_URL=https://ftp.gnu.org/pub/gnu/libiconv/$LIBICONV_PACK
ZLIB_URL=http://www.zlib.net/fossils/$ZLIB_PACK
ENV_VAR_UPDATE_URL=http://nsis.sourceforge.net/mediawiki/images/a/ad/$ENV_VAR_UPDATE_PACK
PYTHON_WIN_URL=https://www.python.org/ftp/python/$PYTHON_WIN_VER/$PYTHON_WIN_PACK
PACKAGE_NAME_SUFFIX="${host_arch}-linux"
PACKAGE_NAME_SUFFIX=mac-$(sw_vers -productVersion)
PACKAGE_NAME=gcc-$TARGET-$GCC_VER_NAME-$RELEASEVER
PACKAGE_NAME_NATIVE=$PACKAGE_NAME-$PACKAGE_NAME_SUFFIX
PACKAGE_NAME_MINGW=$PACKAGE_NAME-win32
INSTALL_PACKAGE_NAME=gcc-$TARGET-$GCC_VER_NAME-$RELEASEVER
root@buildbox:/subo/Tooling/src/team-sweng/cross-compile/arduino-m0/gcc-arm-none-eabi-10-2020-q4-major# grep VER build-common.sh
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
WORKSPACE | SRC_VERSION)
GMP_VER=6.1.0
MPFR_VER=3.1.4
MPC_VER=1.0.3
ISL_VER=0.18
EXPAT_VER=2.1.1
LIBELF_VER=0.8.13
LIBICONV_VER=1.15
ZLIB_VER=1.2.8
PYTHON_WIN_VER=2.7.7
GMP=gmp-$GMP_VER
MPFR=mpfr-$MPFR_VER
MPC=mpc-$MPC_VER
ISL=isl-$ISL_VER
EXPAT=expat-$EXPAT_VER
LIBELF=libelf-$LIBELF_VER
LIBICONV=libiconv-$LIBICONV_VER
ZLIB=zlib-$ZLIB_VER
PYTHON_WIN=python-$PYTHON_WIN_VER
EXPAT_URL=https://downloads.sourceforge.net/project/expat/expat/$EXPAT_VER/$EXPAT_PACK
PYTHON_WIN_URL=https://www.python.org/ftp/python/$PYTHON_WIN_VER/$PYTHON_WIN_PACK
RELEASEVER=${release_year}-q1-update
RELEASEVER=${release_year}-q2-preview
RELEASEVER=${release_year}-q3-update
RELEASEVER=${release_year}-q4-major
GCC_VER=`cat $SRCDIR/$GCC/gcc/BASE-VER`
GCC_VER_NAME=`echo $GCC_VER | cut -d'.' -f1`
GCC_VER_SHORT=$GCC_VER_NAME
PKGVERSION="GNU Arm Embedded Toolchain $GCC_VER_NAME-$RELEASEVER"
PACKAGE_NAME=gcc-$TARGET-$GCC_VER_NAME-$RELEASEVER
INSTALL_PACKAGE_NAME=gcc-$TARGET-$GCC_VER_NAME-$RELEASEVER
APPNAME="$PKGVERSION $GCC_VER_SHORT $release_year"
```

View File

@@ -0,0 +1,38 @@
CNW
05/27/2021 at 10:49
<https://deardevices.com/2019/04/18/how-to-crosscompile-raspi/>
git clone <https://github.com/raspberrypi/tools>
killed that
found a better option (uses docker so it's nicely contained)
<https://github.com/Pro/raspi-toolchain>
realized that might be (only for) rpi0 dug into source material and found
<https://solarianprogrammer.com/2018/05/06/building-gcc-cross-compiler-raspberry-pi/>
Light modifications to the instructions (--werror and path adjustments):
```console
../glibc-2.28/configure --prefix=/subo/Tooling/bin/team-sweng/cross-compile/rpi/arm-linux-gnueabihf --build=$MACHTYPE --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --with-arch=armv6 --with-fpu=vfp --with-float=hard --with-headers=/subo/Tooling/bin/team-sweng/cross-compile/rpi/arm-linux-gnueabihf/include --disable-multilib libc_cv_forced_unwind=yes --disable-werror
install csu/crt1.o csu/crti.o csu/crtn.o /subo/Tooling/bin/team-sweng/cross-compile/rpi/arm-linux-gnueabihf/lib
arm-linux-gnueabihf-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o /subo/Tooling/bin/team-sweng/cross-compile/rpi/arm-linux-gnueabihf/lib/libc.so
touch /subo/Tooling/bin/team-sweng/cross-compile/rpi/arm-linux-gnueabihf/include/gnu/stubs.h
```
Glibc build well underway as of 17:58 on 05/28/2021
Executable built on buildbox , scp to my pi, run. Patient closed at 18:27 on 05/28/2021
```console
root@buildbox:~# arm-linux-gnueabihf-gcc hello-pi.c -o hello-pi
root@buildbox:~# file hello-pi
hello-pi: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=ee4a21a234906299467b7e0ec735d400497c5ad8, for GNU/Linux 3.2.0, not stripped
> ./hello-pi
Hello rpi cross!% ~ 18:26:12
```