Skip to content

Instantly share code, notes, and snippets.

View janhieber's full-sized avatar

Jan Hieber janhieber

  • Germany
View GitHub Profile
@janhieber
janhieber / fitimage.its
Created August 29, 2017 10:28
U-Boot FIT image template for mkimage
/dts-v1/;
/ {
description = "Simple image with single Linux kernel";
images {
#address-cells = <1>;
#size-cells = <0>;
kernel@0 {
#address-cells = <1>;
#size-cells = <0>;
@janhieber
janhieber / build.sh
Created August 29, 2017 10:25
Kernel build script
#!/usr/bin/env sh
# settings
USECCACHE=1
CROSS_COMPILE=arm-none-eabi-
ARCH=arm
MAKEPARAM="all"
#############################################
@janhieber
janhieber / target_copy.sh
Created August 29, 2017 10:24
Copy kernel and modules to SSH or local SD/MMC target
#!/usr/bin/env sh
# settings
DEVICE=sdj
IP=192.168.0.2
##########################################################
function main(){
# if we have an IP, check if target is there
@janhieber
janhieber / NAT_setup.txt
Created August 25, 2017 07:54
NAT setup
############# on host
# set fixed IP (rpi-net)
NetworkManager / systemd-networkd ...
# enable IPv4 forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/ipforward.conf
# enable NAT in iptables (rpi-net is target interface)
@janhieber
janhieber / GCC_link_blob.txt
Created August 24, 2017 11:52
Link blob into C program
@janhieber
janhieber / cross_compile_ccache.txt
Created August 23, 2017 11:26
How to cross compile with ccache
mkdir /usr/local/bin/ccache
ln -s /usr/bin/ccache /usr/local/bin/ccache/arm-none-eabi-gcc
ln -s /usr/bin/ccache /usr/local/bin/ccache/arm-none-eabi-g++
ln -s /usr/bin/ccache /usr/local/bin/ccache/arm-none-eabi-cpp
ln -s /usr/bin/ccache /usr/local/bin/ccache/arm-none-eabi-c++
export PATH="/usr/local/bin/ccache:$PATH"
# now cross compile as usuas, eg wih
# CROSS_COMPILE=arm-none-eabi-
@janhieber
janhieber / tftp_update_fat.txt
Last active August 16, 2017 12:22
U-Boot FAT update over TFTP
# Enter this in u-boot.
# Downloads SPL and u-boot into RAM and then writes it to sdcard
# network configuration
setenv ipaddr 192.168.0.2
setenv serverip 192.168.0.1
# update commands
setenv tftp_to_fat "tftp ${loadaddr} '${file}'; fatwrite mmc 0:1 ${loadaddr} '${file}' '${filesize}'"
setenv u "for file in MLO u-boot.img; do run tftp_to_fat; done; reset"