Skip to content

Instantly share code, notes, and snippets.

@janjongboom
Created June 4, 2015 10:04
Show Gist options
  • Save janjongboom/08681a73aacfd3f26c54 to your computer and use it in GitHub Desktop.
Save janjongboom/08681a73aacfd3f26c54 to your computer and use it in GitHub Desktop.
Building LoRaMac-node on OS/X and Linux without IDE

This applies to building the software from LoRaMac-node for LoRaMote Class A with MCU STM32L151CB on an OS/X or Linux system.

  1. Acquire the GNU Tools for ARM Embedded Processors
  2. Put it under ~/toolchains/arm-embedded-4_9 (or change the paths in the .sh file)
  3. Place the build-loramote-class-a.sh file in your LoRaMac-node directory, and chmod +x it
  4. Run ./build-loramote-class-a.sh
  5. LoRaMacClassA.elf will be in your out/ directory
  6. ???
  7. PROFIT!
mkdir -p out
cd out
~/toolchains/arm-embedded-4_9/bin/arm-none-eabi-gcc \
-mcpu=cortex-m3 \
-mthumb \
-g2 \
-Wall \
-Os \
-std=c99 \
-c \
-DUSE_DEBUGGER \
-DLOW_POWER_MODE_ENABLE \
-DUSE_BAND_868 \
-I../src/system \
-I../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/inc \
-I../src/boards/LoRaMote \
-I../src/system/crypto \
-I../src/boards/mcu/stm32/cmsis \
-I../src/boards/mcu/stm32 \
-I../src \
-I../src/boards/LoRaMote/cmsis \
-I../src/peripherals \
-I../src/radio \
-I../src/mac \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_gpio.c \
../src/boards/LoRaMote/adc-board.c \
../src/system/delay.c \
../src/boards/mcu/stm32/sysIrqHandlers.c \
../src/system/i2c.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_pwr.c \
../src/peripherals/sx1509.c \
../src/system/timer.c \
../src/boards/LoRaMote/cmsis/arm-gcc/startup_stm32l1xx_md.s \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_exti.c \
../src/boards/mcu/stm32/utilities.c \
../src/system/uart.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_rcc.c \
../src/boards/LoRaMote/cmsis/system_stm32l1xx.c \
../src/boards/LoRaMote/gps-board.c \
../src/apps/LoRaMac/classA/LoRaMote/main.c \
../src/peripherals/gpio-ioe.c \
../src/boards/LoRaMote/i2c-board.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_adc.c \
../src/boards/LoRaMote/timer-board.c \
../src/boards/LoRaMote/board.c \
../src/boards/LoRaMote/sx1272-board.c \
../src/boards/LoRaMote/gpio-board.c \
../src/peripherals/mpl3115.c \
../src/system/gpio.c \
../src/boards/LoRaMote/rtc-board.c \
../src/system/crypto/cmac.c \
../src/system/crypto/aes.c \
../src/mac/LoRaMac.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_dbgmcu.c \
../src/peripherals/sx9500.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_syscfg.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_dma.c \
../src/peripherals/mag3110.c \
../src/system/fifo.c \
../src/boards/LoRaMote/uart-board.c \
../src/system/adc.c \
../src/system/gps.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_usart.c \
../src/boards/LoRaMote/spi-board.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_spi.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_i2c.c \
../src/peripherals/mma8451.c \
../src/mac/LoRaMacCrypto.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/misc.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_rtc.c \
../src/radio/sx1272/sx1272.c \
../src/boards/mcu/stm32/STM32L1xx_StdPeriph_Driver/src/stm32l1xx_tim.c
~/toolchains/arm-embedded-4_9/bin/arm-none-eabi-gcc \
-mcpu=cortex-m3 \
-mthumb \
-g2 \
-nostartfiles \
-Wl,-Map=LoRaMacClassA.map \
-Os \
-Wl,--gc-sections \
--specs=nano.specs \
-L../src/boards/LoRaMote/cmsis/arm-gcc \
-Wl,-T../src/boards/LoRaMote/cmsis/arm-gcc/stm32l1xx_md_flash.ld \
-g \
-o \
LoRaMacClassA.elf \
mpl3115.o \
stm32l1xx_usart.o \
gpio-ioe.o \
stm32l1xx_tim.o \
board.o \
sysIrqHandlers.o \
i2c-board.o \
stm32l1xx_dbgmcu.o \
spi-board.o \
timer-board.o \
gps.o \
adc-board.o \
LoRaMac.o \
fifo.o \
system_stm32l1xx.o \
timer.o \
uart.o \
mag3110.o \
misc.o \
stm32l1xx_adc.o \
utilities.o \
main.o \
sx9500.o \
stm32l1xx_syscfg.o \
sx1272-board.o \
sx1509.o \
stm32l1xx_spi.o \
stm32l1xx_exti.o \
cmac.o \
aes.o \
rtc-board.o \
LoRaMacCrypto.o \
stm32l1xx_rtc.o \
delay.o \
gpio-board.o \
stm32l1xx_dma.o \
stm32l1xx_i2c.o \
stm32l1xx_gpio.o \
stm32l1xx_rcc.o \
stm32l1xx_pwr.o \
gpio.o \
sx1272.o \
adc.o \
mma8451.o \
startup_stm32l1xx_md.o \
uart-board.o \
i2c.o \
gps-board.o \
-lc \
-lm \
-lrdimon
cd ..
echo "Build Completed. Output file is $PWD/out/LoRaMacClassA.elf"
@ht-hieu
Copy link

ht-hieu commented May 5, 2017

Why don't you use Makefile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment