Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • card10/firmware
  • annejan/firmware
  • astro/firmware
  • fpletz/firmware
  • gerd/firmware
  • fleur/firmware
  • swym/firmware
  • l/firmware
  • uberardy/firmware
  • wink/firmware
  • madonius/firmware
  • mot/firmware
  • filid/firmware
  • q3k/firmware
  • hauke/firmware
  • Woazboat/firmware
  • pink/firmware
  • mossmann/firmware
  • omniskop/firmware
  • zenox/firmware
  • trilader/firmware
  • Danukeru/firmware
  • shoragan/firmware
  • zlatko/firmware
  • sistason/firmware
  • datenwolf/firmware
  • bene/firmware
  • amedee/firmware
  • martinling/firmware
  • griffon/firmware
  • chris007/firmware
  • adisbladis/firmware
  • dbrgn/firmware
  • jelly/firmware
  • rnestler/firmware
  • mh/firmware
  • ln/firmware
  • penguineer/firmware
  • monkeydom/firmware
  • jens/firmware
  • jnaulty/firmware
  • jeffmakes/firmware
  • marekventur/firmware
  • pete/firmware
  • h2obrain/firmware
  • DooMMasteR/firmware
  • jackie/firmware
  • prof_r/firmware
  • Draradech/firmware
  • Kartoffel/firmware
  • hinerk/firmware
  • abbradar/firmware
  • JustTB/firmware
  • LuKaRo/firmware
  • iggy/firmware
  • ente/firmware
  • flgr/firmware
  • Lorphos/firmware
  • matejo/firmware
  • ceddral7/firmware
  • danb/firmware
  • joshi/firmware
  • melle/firmware
  • fitch/firmware
  • deurknop/firmware
  • sargon/firmware
  • markus/firmware
  • kloenk/firmware
  • lucaswerkmeister/firmware
  • derf/firmware
  • meh/firmware
  • dx/card10-firmware
  • torben/firmware
  • yuvadm/firmware
  • AndyBS/firmware
  • klausdieter1/firmware
  • katzenparadoxon/firmware
  • xiretza/firmware
  • ole/firmware
  • techy/firmware
  • thor77/firmware
  • TilCreator/firmware
  • fuchsi/firmware
  • dos/firmware
  • yrlf/firmware
  • PetePriority/firmware
  • SuperVirus/firmware
  • sur5r/firmware
  • tazz/firmware
  • Alienmaster/firmware
  • flo_h/firmware
  • baldo/firmware
  • mmu_man/firmware
  • Foaly/firmware
  • sodoku/firmware
  • Guinness/firmware
  • ssp/firmware
  • led02/firmware
  • Stormwind/firmware
  • arist/firmware
  • coon/firmware
  • mdik/firmware
  • pippin/firmware
  • royrobotiks/firmware
  • zigot83/firmware
  • mo_k/firmware
106 results
Show changes
Showing
with 642 additions and 12868 deletions
......@@ -6,8 +6,12 @@ BIN1="$2"
BIN2="$3"
BINOUT="$4"
dd if=/dev/zero ibs=1k count=448 2>/dev/null | LANG=C tr "\000" "\377" > "$BINOUT"
dd if="$BIN1" of="$BINOUT" conv=notrunc 2>/dev/null
dd if="$BIN2" >> "$BINOUT" 2>/dev/null
if [ "$(stat -c "%s" "${BIN1}")" -gt 589824 ]; then
echo "$0: ${BIN1} is too big to fit!" >&2
exit 1
fi
objcopy -I binary -O binary --pad-to=589824 --gap-fill=255 "${BIN1}" "$BINOUT"
cat "$BIN2" >>"$BINOUT"
"$PYTHON" "$(dirname "$0")/crc_patch.py" "$BINOUT"
#!/usr/bin/env python3
import sys
import crc16
import warnings
warnings.simplefilter("ignore")
try:
import crc16
crcfun = crc16.crc16xmodem
except ImportError:
try:
import crcmod
crcfun = crcmod.predefined.mkCrcFun("xmodem")
except ImportError:
try:
import crcelk
crcfun = crcelk.CRC_XMODEM.calc_bytes
except ImportError:
raise Exception(
"Could not find a CRC implementation. Tried: crc16, crcmod, crcelk."
)
def main():
data = open(sys.argv[1], 'rb').read()
crc = crc16.crc16xmodem(data)
data = open(sys.argv[1], "rb").read()
crc = crcfun(data)
# print(crc)
padded = data + bytes([crc >> 8, crc & 0xFF])
crc = crc16.crc16xmodem(padded)
crc = crcfun(padded)
# print(crc)
open(sys.argv[1], 'wb').write(padded)
open(sys.argv[1], "wb").write(padded)
if __name__ == "__main__":
......
This diff is collapsed.
......@@ -21,6 +21,7 @@ executable(
'bootloader-usb.c',
'crc16-ccitt.c',
splash_screen,
version_hdr,
dependencies: [
libcard10,
max32665_startup_boot,
......
......@@ -4,7 +4,9 @@ set -xe
cd "$(dirname "$0")"
test -d build/ && rm -r build/
git submodule update --init ./lib/micropython
# Get external libs (MicroPython, tiny-AES-c, SHA256)
git submodule deinit --all
git submodule update --init ./lib
meson --cross-file card10-cross.ini build/ "$@"
set +x
......
......@@ -6,7 +6,7 @@ strip = 'arm-none-eabi-strip'
[properties]
c_args = ['-mthumb', '-mcpu=cortex-m4', '-mfloat-abi=softfp', '-mfpu=fpv4-sp-d16', '-Wa,-mimplicit-it=thumb', '-ffunction-sections', '-fdata-sections', '-fsingle-precision-constant', '-fno-isolate-erroneous-paths-dereference']
c_link_args = ['-mthumb', '-mcpu=cortex-m4', '-mfloat-abi=softfp', '-mfpu=fpv4-sp-d16', '-Wl,--start-group', '-lc', '-lnosys', '-Wl,--end-group', '--specs=nano.specs']
c_link_args = ['-mthumb', '-mcpu=cortex-m4', '-mfloat-abi=softfp', '-mfpu=fpv4-sp-d16', '-Wl,--start-group', '-lc', '-lnosys', '-Wl,--end-group', '--specs=nano.specs', '-Wl,-wrap,BbBleDrvRand']
target_defs = ['-DTARGET=32665', '-DTARGET_REV=0x4131', '-DBOARD_CARD10=1']
......
......@@ -18,9 +18,11 @@ in stdenv.mkDerivation rec {
bash
crc16
gcc-arm-embedded
git
meson
ninja
py
py.pkgs.pillow
];
src = ./.;
buildCommand = ''
......@@ -33,7 +35,7 @@ in stdenv.mkDerivation rec {
chmod -R +w .
# The nix sandbox does not have /usr/bin/env bash, patch things up.
for f in lib/micropython/*.sh; do
for f in lib/micropython/*.sh tools/*.sh; do
patchShebangs "$f"
done
......@@ -41,10 +43,13 @@ in stdenv.mkDerivation rec {
meson --cross-file card10-cross.ini "$build"
ninja -C "$build" -j $NIX_BUILD_CORES
# Copy artifacts to derivation outputs.
install -D -m 444 "$build/bootloader/bootloader.elf" -t "$out/bootloader"
install -D -m 444 "$build/pycardium/pycardium_epicardium.bin" -t "$out/pycardium"
install -D -m 444 "$build/epicardium/epicardium.elf" -t "$out/epicardium"
install -D -m 444 "$build/pycardium/pycardium.elf" -t "$out/pycardium"
# Copy ELFs for debugging
install -D -m 444 "$build/bootloader/bootloader.elf" -t "$out/lib/bootloader.elf"
install -D -m 444 "$build/epicardium/epicardium.elf" -t "$out/lib/epicardium.elf"
install -D -m 444 "$build/pycardium/pycardium.elf" -t "$out/lib/pycardium.elf"
# Create new flash contents
install -D -m 444 "$build/pycardium/pycardium_epicardium.bin" "$out/card10/card10.bin"
install -m 444 preload/*.py -t $out/card10/
cp -ar preload/apps $out/card10/
'';
}
This diff is collapsed.
This diff is collapsed.
FROM ubuntu
RUN apt-get update && apt-get -y install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi python3 python3-pip ninja-build git
RUN pip3 install meson crc16 pillow
VOLUME /firmware
WORKDIR /firmware
CMD ./bootstrap.sh && ninja -C build && chown -R --reference=/firmware build
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.