-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·45 lines (33 loc) · 1.17 KB
/
build.sh
File metadata and controls
executable file
·45 lines (33 loc) · 1.17 KB
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
#!/bin/bash
# Needed for python and pip
sudo apt-get install python python-pip
sudo pip install virtualenv
# Needed for srec_cat
sudo apt-get install srecord
# Set Motherboard
sed "s/#define MOTHERBOARD BOARD_RAMPS_14_EFB/#define MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB/g" -i Marlin/Marlin/Configuration.h
# Set chip
sed "s/env_default = megaatmega2560/env_default = LPC1768/g" -i Marlin/platformio.ini
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
cd Marlin
platformio run -v
cd ..
# Add the compiler to PATH
# Build LPC bootloader
cd LPC17xx-DFU-Bootloader/
PATH=~/.platformio/packages/toolchain-gccarmnoneeabi/bin/:$PATH make
cd ..
BOOTLOADER_HEX="LPC17xx-DFU-Bootloader/build/DFU-Bootloader.hex"
FIRMWARE_ELF="Marlin/.pioenvs/LPC1768/firmware.elf"
FIRMWARE_HEX="Marlin/.pioenvs/LPC1768/firmware.hex"
COMBINED_HEX="main-combined.hex"
UPLOAD_TTY=/dev/ttyUSB0
~/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-objcopy -R .stack -O ihex $FIRMWARE_ELF $FIRMWARE_HEX
srec_cat $BOOTLOADER_HEX -Intel $FIRMWARE_HEX -Intel -out $COMBINED_HEX -Intel
until lpc21isp $COMBINED_HEX $UPLOAD_TTY 115200 12000
do
echo "Retrying in 5..."
sleep 5
done