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.
 
 
 
 
 
 

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