Skip to content

Instantly share code, notes, and snippets.

@cladmi
cladmi / naturalchimie_sort_cauldron.js
Created December 17, 2019 00:37
naturalchimie sort cauldron
// ==UserScript==
// @name Sort naturalchimie cauldron
// @include http://www.naturalchimie.com/cauldron
// @version 1
// @grant none
// ==/UserScript==
// Get element sorting key
// Use formated %05u element number for elements
// Use magic object name otherwise
#! /bin/bash
# Compare the value of a variable for all applicatinos and boards between
# two different riot versions.
#
# This assumes both versions have the same applications and boards as only
# 'riot_master' is checked to list all of them.
# The value elements are sorted after being printed
@cladmi
cladmi / compare_riot_repositories_variable_value.sh
Created March 5, 2019 15:55
compare_riot_repositories_variable_value.sh
#! /bin/bash
# Compare the value of a variable for all applicatinos and boards between
# two different riot versions.
#
# This assumes both versions have the same applications and boards as only
# 'riot_master' is checked to list all of them.
# Global variables
# Do not parse and export all the build variables
# This is a HACK to prevent issues when running `make` inside of `make`
GLOBAL_GOALS += time-make
# Handle that 'BOARD' is overwritten when using a global goal
time-make: BOARD:=$(BOARD)
.PHONY: time-make
time-make:
@echo $@: ${BOARD}
time make clean all
@cladmi
cladmi / avr_2.26.ld
Last active November 5, 2018 16:33
Linker script extracted with binutils 2.26 with `avr-gcc -Wl,--verbose -mmcu=atmega32u4` (GNU ld (GNU Binutils) 2.26.20160125)
/* Script for -n: mix text and data on same page */
/* Copyright (C) 2014-2015 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
OUTPUT_ARCH(avr:5)
__TEXT_REGION_LENGTH__ = DEFINED(__TEXT_REGION_LENGTH__) ? __TEXT_REGION_LENGTH__ : 128K;
__DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH__ : 0xffa0;
__EEPROM_REGION_LENGTH__ = DEFINED(__EEPROM_REGION_LENGTH__) ? __EEPROM_REGION_LENGTH__ : 64K;
@cladmi
cladmi / Makefile.include.md
Created September 10, 2018 15:17
Order in which file are included in `Makefile.include` and what they define regarding dependencies

Order of definitions in Makefile.include

Include paths for a normal build regarding modules dependencies handling.

In the following description I use USEMODULE only even if some files are setting USEPKG it is just a specific case.

INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include
@cladmi
cladmi / compare_size.sh
Last active September 4, 2018 16:16
compare_size.sh
#! /bin/bash
set -u
set -e
readonly BOARD=${1}
readonly EXAMPLE=${2}
readonly MAKE="make --no-print-directory BOARD=${BOARD}"
readonly OBJDUMP=$(${MAKE} -C RIOT/${EXAMPLE} info-debug-variable-OBJDUMP)
@cladmi
cladmi / diff.md
Last active August 29, 2018 12:49
ld-r size_diff.md

Summary:

Total: 23646, Same: 1044, Diff: 22602

app board bss data text dec bss data text dec bss_diff data_diff text_diff dec_diff both valid
tests/lwip_sock_tcp pic32-wifire:gnu 0 0 0 0 20376 2900 172484 195760 20376 2900 172484 195760 false
tests/cortexm_common_ldscript iotlab-m3:gnu 0 0 0 0 2740 140 8364 11244 2740 140 8364 11244 false
tests/cortexm_common_ldscript bluepill:gnu 0 0 0 0 2748 140 8268 11156 2748 140 8268 11156 false
tests/cortexm_common_ldscript spark-core:gnu 0 0 0 0 2732 140 8188 11060 2732 140 8188 11060 false
@cladmi
cladmi / arduino-zero
Created June 1, 2018 16:08
xtimer_usleep_short
make clean all
Building application "tests_xtimer_usleep_short" for "arduino-zero" with MCU "samd21".
text data bss dec hex filename
10676 140 2780 13596 351c /home/harter/work/git/RIOT/tests/xtimer_usleep_short/bin/arduino-zero/tests_xtimer_usleep_short.elf
make flash-only
iotlab-node --jmespath='keys(@)[0]' --format='int' --list saclay,arduino-zero,1 --update /home/harter/work/git/RIOT/tests/xtimer_usleep_short/bin/arduino-zero/tests_xtimer_usleep_short.elf | grep 0
0
make test
./tests/01-run.py
@cladmi
cladmi / gist:be8089c799479ddad2823f1e6dc4ef28
Created May 8, 2018 14:34
arduino-zero trickle failure
make clean all
make[1]: Entering directory '/home/harter/work/git/RIOT_test/tests/trickle'
Building application "tests_trickle" for "arduino-zero" with MCU "samd21".
text data bss dec hex filename
11504 220 2820 14544 38d0 /home/harter/work/git/RIOT_test/tests/trickle/bin/arduino-zero/tests_trickle.elf
make[1]: Leaving directory '/home/harter/work/git/RIOT_test/tests/trickle'
make flash-only
make[1]: Entering directory '/home/harter/work/git/RIOT_test/tests/trickle'
iotlab-node --list saclay,arduino-zero,1 --update /home/harter/work/git/RIOT_test/tests/trickle/bin/arduino-zero/tests_trickle.elf