Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
1.3 KiB

  1. ARMCC?= arm-none-eabi-gcc
  2. ARMOBJDUMP?= arm-none-eabi-objdump
  3. ARMTARGET?= -mcpu=cortex-m3 -mthumb -DSTROBE_SINGLE_THREAD=1
  4. PROG = lora.irr
  5. PROGEXT = .elf
  6. SRCS = main.c
  7. SRCS+= strobe_rng_init.c
  8. CFLAGS+= -DNDEBUG
  9. # Strobe
  10. .PATH: $(.CURDIR)/strobe
  11. CFLAGS = -I$(.CURDIR)/strobe
  12. SRCS+= strobe.c \
  13. x25519.c
  14. # Microcontroller
  15. STM32=$(.CURDIR)/stm32
  16. .PATH: $(STM32)/l151ccux
  17. LINKER_SCRIPT=$(STM32)/l151ccux/STM32L151CCUX_FLASH.ld
  18. SRCS+= startup_stm32l151ccux.s \
  19. system_stm32l1xx.c
  20. CFLAGS+= -I$(STM32)
  21. CFLAGS+= -I$(STM32)/l151ccux
  22. CFLAGS+= -DSTM32L151xC
  23. OBJS = $(SRCS:C/.c$/.o/)
  24. .PHONY: all
  25. all: $(PROG)$(PROGEXT) $(PROG).list
  26. $(PROG)$(PROGEXT): $(OBJS)
  27. $(ARMCC) $(ARMTARGET) -o $@ $(.ALLSRC) -T$(LINKER_SCRIPT) --specs=nosys.specs -Wl,--gc-sections -static --specs=nano.specs -Wl,--start-group -lc -lm -Wl,--end-group
  28. $(PROG).list: $(PROG)$(PROGEXT)
  29. $(ARMOBJDUMP) -h -S $(.ALLSRC) > $@
  30. .PHONY: runtests
  31. runtests:
  32. ls *.py | entr sh -c 'python -m coverage run -m unittest lora && coverage report --omit=p/\* -m -i'
  33. .c.o:
  34. $(ARMCC) $(ARMTARGET) $(CFLAGS) -c $< -o $@
  35. STROBE_REPO = https://git.code.sf.net/p/strobe/code
  36. STROBE_BRANCH = master
  37. .PHONY: init-strobe
  38. init-strobe:
  39. git subtree add -P strobe --squash $(STROBE_REPO) $(STROBE_BRANCH)
  40. .PHONY: update-strobe
  41. update-strobe:
  42. git subtree pull -P strobe --squash $(STROBE_REPO) $(STROBE_BRANCH)