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.
 
 
 
 
 
 

126 lines
2.7 KiB

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