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.
 
 
 
 
 
 

92 lines
2.1 KiB

  1. SRCS.NODE151+= board.c
  2. SRCS.NODE151+= misc.c
  3. ARMOBJDUMP?= arm-none-eabi-objdump
  4. ARMCC?= arm-none-eabi-gcc
  5. # Clang doesn't work due to no-nano libc
  6. #ARMCC?=clang-mp-9.0
  7. #ARMTARGET?= -nostdlib -ffreestanding -target arm-none-eabi -mcpu=cortex-m3 -mfloat-abi=soft -mthumb
  8. .include <$(.PARSEDIR)/mu.opts.mk>
  9. # Strobe
  10. .if ${MK_STROBE} == "yes"
  11. .PATH: $(.CURDIR)/strobe
  12. CFLAGS+= -I$(.CURDIR)/strobe -DSTROBE_SINGLE_THREAD=1
  13. STROBE_SRCS+= strobe.c \
  14. x25519.c
  15. .endif
  16. # LoRamac (SX1276) radio code
  17. .if ${MK_SX1276} == "yes"
  18. LORAMAC_SRC = $(.CURDIR)/loramac/src
  19. .PATH: $(LORAMAC_SRC)/radio/sx1276 $(LORAMAC_SRC)/system $(LORAMAC_SRC)/boards/mcu $(LORAMAC_SRC)/boards/NucleoL152
  20. CFLAGS+= -I$(LORAMAC_SRC)/boards
  21. CFLAGS+= -I$(LORAMAC_SRC)/system
  22. CFLAGS+= -I$(LORAMAC_SRC)/radio
  23. CFLAGS+= -DUSE_HAL_DRIVER -DSX1276MB1LAS
  24. SRCS+= sx1276.c
  25. SRCS+= utilities.c
  26. SRCS+= adc.c timer.c delay.c gpio.c uart.c fifo.c
  27. SRCS+= adc-board.c delay-board.c gpio-board.c rtc-board.c lpm-board.c sx1276mb1las-board.c spi-board.c uart-board.c
  28. .endif
  29. # NODE151 Microcontroller
  30. .if ${MK_NODE151} == "yes"
  31. ARMTARGET?= -mcpu=cortex-m3 -mthumb
  32. STM32=$(.CURDIR)/stm32
  33. .PATH: $(STM32)/l151ccux
  34. LINKER_SCRIPT=$(STM32)/l151ccux/STM32L151CCUX_FLASH.ld
  35. SRCS+= \
  36. startup_stm32l151ccux.s \
  37. stm32l1xx_hal.c \
  38. stm32l1xx_hal_adc.c \
  39. stm32l1xx_hal_adc_ex.c \
  40. stm32l1xx_hal_cortex.c \
  41. stm32l1xx_hal_dma.c \
  42. stm32l1xx_hal_flash.c \
  43. stm32l1xx_hal_flash_ex.c \
  44. stm32l1xx_hal_gpio.c \
  45. stm32l1xx_hal_pcd.c \
  46. stm32l1xx_hal_pcd_ex.c \
  47. stm32l1xx_hal_pwr.c \
  48. stm32l1xx_hal_pwr_ex.c \
  49. stm32l1xx_hal_rcc.c \
  50. stm32l1xx_hal_rcc_ex.c \
  51. stm32l1xx_hal_rtc.c \
  52. stm32l1xx_hal_rtc_ex.c \
  53. stm32l1xx_hal_spi.c \
  54. stm32l1xx_hal_uart.c \
  55. system_stm32l1xx.c
  56. SRCS+= \
  57. stm32l1xx_it.c \
  58. stm32l1xx_hal_msp.c
  59. CFLAGS+= -I$(STM32)
  60. CFLAGS+= -I$(STM32)/l151ccux
  61. CFLAGS+= -DSTM32L151xC
  62. .endif
  63. # USB CDC
  64. .if ${MK_USB_CDC} == "yes"
  65. .PATH: $(STM32)/usb
  66. SRCS+= \
  67. usb_device.c \
  68. usbd_cdc.c \
  69. usbd_cdc_if.c \
  70. usbd_conf.c \
  71. usbd_core.c \
  72. usbd_ctlreq.c \
  73. usbd_desc.c \
  74. usbd_ioreq.c
  75. CFLAGS+= -I$(STM32)/usb
  76. .endif
  77. .if ${MK_USB_CDC} == "yes" && ${MK_NODE151} == "yes"
  78. SRCS+= \
  79. stm32l1xx_ll_usb.c
  80. .endif