forked from ambrop72/aprinter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-commands.txt
79 lines (60 loc) · 3.16 KB
/
test-commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Run the configuration service.
nix-build nix/ -A aprinterService -o ~/aprinter-service && ~/aprinter-service/bin/aprinter-service
# Build firmware.
python -B config_system/generator/generate.py --config ~/Downloads/aprinter_config.json | nix-build - -o ~/aprinter-build
# Build web interface (for copying to SD-card).
nix-build nix/ -A aprinterWebif -o ~/aprinter-webif
# Flash various boards.
python -B flash.py -f ~/aprinter-build/aprinter.bin -t duet
python -B flash.py -f ~/aprinter-build/aprinter.bin -t arduino_due
python -B flash.py -f ~/aprinter-build/aprinter.hex -t arduino_mega
python -B flash.py -f ~/aprinter-build/aprinter.elf -t stm32f4
python -B flash.py -f ~/aprinter-build/aprinter.hex -t teensy3
python -B flash.py -f ~/aprinter-build/aprinter.hex -t melzi_programmer
# OpenOCD
# Note, if using SWO, need to actually read it.
# For SWO you first need this: "mkfifo ~/swo".
# STM32F4-Discovery:
openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c 'tpiu config internal /home/ambro/swo uart off 168000000'
# Teensy3 with Discovery:
openocd -f interface/stlink-v2.cfg -f /home/ambro/k20.cfg -c 'tpiu config internal /home/ambro/swo uart off 96000000; init; halt'
# Teensy3 with JTAG:
openocd -f /home/ambro/neodb.cfg -f /home/ambro/k20.cfg -c 'init; halt'
# Duet
openocd -f interface/stlink-v2.cfg -c "set CPUTAPID 0x2ba01477; source [find target/at91sam3ax_8x.cfg]; init; halt"
# OpenOCD telnet
telnet 127.0.0.1 4444
# Read SWO output.
while true; do swodec --dump-inst < ~/swo; sleep 5; done
# GDB
arm-none-eabi-gdb -ex 'target remote 127.0.0.1:3333' ~/aprinter-build/aprinter.elf
# Teensy3 unsecure.
openocd -f /home/ambro/neodb.cfg -f /home/ambro/k20.cfg -c 'init; kinetis mdm mass_erase'
# List data symbols sorted by size.
arm-none-eabi-nm --print-size --size-sort -td ~/aprinter-build/aprinter.elf |egrep ' (b|B|d|D|g|G) '
# Download network speed test.
curl http://192.168.111.110/downloadTest >/dev/null
# Upload network speed test.
python -B upload.py -s 512 -l 100000000 | pv | nc 192.168.111.110 80
# Download file from SD card.
time curl http://192.168.111.110/dino.gcode >/dev/null
# Upload file to SD card.
time python -B upload.py -s 512 -l 100000000 -p /rr_upload?name=a.gcode | pv | nc 192.168.111.110 80
# Test writing file to SD card.
M935 F0.txt S10000000 D1111111111111122222222222222222333333
M935 F0.txt S10000000 D123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF123456789ABCDEF
# Test reading file from SD card.
M936 F0.txt
# Run a local web interface forwarding API calls to machine.
nix-build nix/ -A aprinterWebifTest -o ~/aprinter-webif-test && ~/aprinter-webif-test/bin/aprinter-webif-test
# Run Linux test port.
./aprinter-build-linux/aprinter.elf -l -cFIFO -p80 -ttap9
# TAP config for Linux
ip tuntap add dev tap9 mode tap user ambro
ifconfig tap9 192.168.64.1/24
tc qdisc add dev tap9 root netem delay 1ms
modprobe ifb
ip link set dev ifb0 up
tc qdisc add dev tap9 ingress
tc filter add dev tap9 parent ffff: protocol ip u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb0
tc qdisc add dev ifb0 root netem delay 1ms