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.
 
 
 
 
 
 

144 lines
3.0 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. CFLAGS+= -Wall -Werror
  12. .include <$(.PARSEDIR)/mu.opts.mk>
  13. .if ${MK_SYSINIT} == "yes"
  14. .PATH: $(SRCTOP)
  15. SRCS+= sysinit.c
  16. .endif
  17. # Strobe
  18. .if ${MK_STROBE} == "yes"
  19. .PATH: $(SRCTOP)/strobe
  20. CFLAGS+= -I$(SRCTOP)/strobe -DSTROBE_SINGLE_THREAD=1
  21. STROBE_SRCS+= strobe.c \
  22. x25519.c
  23. .endif
  24. # LoRamac (SX1276) radio code
  25. .if ${MK_SX1276} == "yes"
  26. LORAMAC_SRC = $(SRCTOP)/loramac/src
  27. .PATH: $(LORAMAC_SRC)/radio/sx1276 $(LORAMAC_SRC)/system $(LORAMAC_SRC)/boards/mcu $(LORAMAC_SRC)/boards/NucleoL152
  28. CFLAGS+= -I$(LORAMAC_SRC)/boards
  29. CFLAGS+= -I$(LORAMAC_SRC)/system
  30. CFLAGS+= -I$(LORAMAC_SRC)/radio
  31. CFLAGS+= -DUSE_HAL_DRIVER -DSX1276MB1LAS
  32. SRCS+= sx1276.c
  33. SRCS+= utilities.c
  34. SRCS+= adc.c timer.c delay.c gpio.c uart.c fifo.c
  35. 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
  36. .endif
  37. # Generic STM32F103 Microcontroller
  38. .if ${MK_STM32F103} == "yes"
  39. ARMTARGET?= -mcpu=cortex-m3 -mthumb
  40. .PATH: $(STM32)/f103c8t6
  41. LINKER_SCRIPT=$(STM32)/f103c8t6/STM32F103C8T6_FLASH.ld
  42. SRCS+= \
  43. misc.c \
  44. hal_generic.c \
  45. startup_stm32f103xb.s \
  46. stm32f1xx_hal.c \
  47. stm32f1xx_hal_cortex.c \
  48. stm32f1xx_hal_dma.c \
  49. stm32f1xx_hal_gpio.c \
  50. stm32f1xx_hal_pcd.c \
  51. stm32f1xx_hal_pcd_ex.c \
  52. stm32f1xx_hal_pwr.c \
  53. stm32f1xx_hal_rcc.c \
  54. stm32f1xx_hal_rcc_ex.c \
  55. stm32f1xx_hal_uart.c \
  56. stm32f1xx_ll_usb.c \
  57. system_stm32f1xx.c
  58. CFLAGS+= -I$(STM32)
  59. CFLAGS+= -I$(STM32)/f103c8t6
  60. CFLAGS+= -DSTM32F103xB
  61. .endif
  62. # NODE151 Microcontroller
  63. .if ${MK_NODE151} == "yes"
  64. ARMTARGET?= -mcpu=cortex-m3 -mthumb
  65. .PATH: $(STM32)/l151ccux
  66. LINKER_SCRIPT=$(STM32)/l151ccux/STM32L151CCUX_FLASH.ld
  67. SRCS+= \
  68. startup_stm32l151ccux.s \
  69. stm32l1xx_hal.c \
  70. stm32l1xx_hal_adc.c \
  71. stm32l1xx_hal_adc_ex.c \
  72. stm32l1xx_hal_cortex.c \
  73. stm32l1xx_hal_dma.c \
  74. stm32l1xx_hal_flash.c \
  75. stm32l1xx_hal_flash_ex.c \
  76. stm32l1xx_hal_gpio.c \
  77. stm32l1xx_hal_pcd.c \
  78. stm32l1xx_hal_pcd_ex.c \
  79. stm32l1xx_hal_pwr.c \
  80. stm32l1xx_hal_pwr_ex.c \
  81. stm32l1xx_hal_rcc.c \
  82. stm32l1xx_hal_rcc_ex.c \
  83. stm32l1xx_hal_rtc.c \
  84. stm32l1xx_hal_rtc_ex.c \
  85. stm32l1xx_hal_spi.c \
  86. stm32l1xx_hal_uart.c \
  87. system_stm32l1xx.c
  88. SRCS+= \
  89. stm32l1xx_it.c \
  90. stm32l1xx_hal_msp.c
  91. CFLAGS+= -I$(STM32)
  92. CFLAGS+= -I$(STM32)/l151ccux
  93. CFLAGS+= -DSTM32L151xC
  94. .endif
  95. # RS485 Framing
  96. .if ${MK_RS485FRAME} == "yes"
  97. SRCS+= \
  98. rs485frame.c
  99. CFLAGS+= -I$(SRCTOP)/rs485hid
  100. .endif
  101. # USB CDC
  102. .if ${MK_USB_CDC} == "yes"
  103. .PATH: $(STM32)/usb
  104. SRCS+= \
  105. si_usb.c \
  106. usb_device.c \
  107. usbd_cdc.c \
  108. usbd_cdc_if.c \
  109. usbd_conf.c \
  110. usbd_core.c \
  111. usbd_ctlreq.c \
  112. usbd_desc.c \
  113. usbd_ioreq.c
  114. CFLAGS+= -I$(STM32)/usb
  115. .endif
  116. .if ${MK_USB_CDC} == "yes" && ${MK_NODE151} == "yes"
  117. SRCS+= \
  118. stm32l1xx_ll_usb.c
  119. .endif