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.
 
 
 
 
 
 

132 lines
2.8 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. hal_generic.c \
  44. startup_stm32f103xb.s \
  45. stm32f1xx_hal.c \
  46. stm32f1xx_hal_cortex.c \
  47. stm32f1xx_hal_gpio.c \
  48. stm32f1xx_hal_pcd.c \
  49. stm32f1xx_hal_pcd_ex.c \
  50. stm32f1xx_hal_rcc.c \
  51. stm32f1xx_hal_rcc_ex.c \
  52. stm32f1xx_ll_usb.c \
  53. system_stm32f1xx.c
  54. CFLAGS+= -I$(STM32)
  55. CFLAGS+= -I$(STM32)/f103c8t6
  56. CFLAGS+= -DSTM32F103xB
  57. .endif
  58. # NODE151 Microcontroller
  59. .if ${MK_NODE151} == "yes"
  60. ARMTARGET?= -mcpu=cortex-m3 -mthumb
  61. .PATH: $(STM32)/l151ccux
  62. LINKER_SCRIPT=$(STM32)/l151ccux/STM32L151CCUX_FLASH.ld
  63. SRCS+= \
  64. startup_stm32l151ccux.s \
  65. stm32l1xx_hal.c \
  66. stm32l1xx_hal_adc.c \
  67. stm32l1xx_hal_adc_ex.c \
  68. stm32l1xx_hal_cortex.c \
  69. stm32l1xx_hal_dma.c \
  70. stm32l1xx_hal_flash.c \
  71. stm32l1xx_hal_flash_ex.c \
  72. stm32l1xx_hal_gpio.c \
  73. stm32l1xx_hal_pcd.c \
  74. stm32l1xx_hal_pcd_ex.c \
  75. stm32l1xx_hal_pwr.c \
  76. stm32l1xx_hal_pwr_ex.c \
  77. stm32l1xx_hal_rcc.c \
  78. stm32l1xx_hal_rcc_ex.c \
  79. stm32l1xx_hal_rtc.c \
  80. stm32l1xx_hal_rtc_ex.c \
  81. stm32l1xx_hal_spi.c \
  82. stm32l1xx_hal_uart.c \
  83. system_stm32l1xx.c
  84. SRCS+= \
  85. stm32l1xx_it.c \
  86. stm32l1xx_hal_msp.c
  87. CFLAGS+= -I$(STM32)
  88. CFLAGS+= -I$(STM32)/l151ccux
  89. CFLAGS+= -DSTM32L151xC
  90. .endif
  91. # USB CDC
  92. .if ${MK_USB_CDC} == "yes"
  93. .PATH: $(STM32)/usb
  94. SRCS+= \
  95. si_usb.c \
  96. usb_device.c \
  97. usbd_cdc.c \
  98. usbd_cdc_if.c \
  99. usbd_conf.c \
  100. usbd_core.c \
  101. usbd_ctlreq.c \
  102. usbd_desc.c \
  103. usbd_ioreq.c
  104. CFLAGS+= -I$(STM32)/usb
  105. .endif
  106. .if ${MK_USB_CDC} == "yes" && ${MK_NODE151} == "yes"
  107. SRCS+= \
  108. stm32l1xx_ll_usb.c
  109. .endif