SRCS.NODE151+= board.c SRCS.NODE151+= misc.c _SRCTOPDIR:= $(.PARSEDIR)/.. SRCTOP?=$(_SRCTOPDIR:tA) STM32?=$(SRCTOP)/stm32 ARMOBJDUMP?= arm-none-eabi-objdump ARMCC?= arm-none-eabi-gcc # Clang doesn't work due to no-nano libc #ARMCC?=clang-mp-9.0 #ARMTARGET?= -nostdlib -ffreestanding -target arm-none-eabi -mcpu=cortex-m3 -mfloat-abi=soft -mthumb CFLAGS+= -Wall -Werror .include <$(.PARSEDIR)/mu.opts.mk> .if ${MK_HAL_INIT} == "yes" .PATH: $(SRCTOP)/board SRCS+= hal_init.c .endif .if ${MK_SYSINIT} == "yes" .PATH: $(SRCTOP) CFLAGS+= -I$(SRCTOP) SRCS+= sysinit.c .endif # Strobe .if ${MK_STROBE} == "yes" .PATH: $(SRCTOP)/strobe CFLAGS+= -I$(SRCTOP)/strobe -DSTROBE_SINGLE_THREAD=1 STROBE_SRCS+= strobe.c \ x25519.c .endif .if ${MK_STROBE} == "yes" && ${MK_STM32F103} == "yes" .PATH: $(SRCTOP)/board STROBE_SRCS+= strobe_f1_rng_init.c .endif # LoRamac (SX1276) radio code .if ${MK_SX1276} == "yes" LORAMAC_SRC = $(SRCTOP)/loramac/src .PATH: $(LORAMAC_SRC)/radio/sx1276 $(LORAMAC_SRC)/system $(LORAMAC_SRC)/boards/mcu $(LORAMAC_SRC)/boards/NucleoL152 CFLAGS+= -I$(LORAMAC_SRC)/boards CFLAGS+= -I$(LORAMAC_SRC)/system CFLAGS+= -I$(LORAMAC_SRC)/radio CFLAGS+= -DUSE_HAL_DRIVER -DSX1276MB1LAS SRCS+= sx1276.c SRCS+= utilities.c SRCS+= adc.c timer.c delay.c gpio.c uart.c fifo.c 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 .endif # Generic STM32F103 Microcontroller .if ${MK_STM32F103} == "yes" ARMTARGET?= -mcpu=cortex-m3 -mthumb .PATH: $(STM32)/f103c8t6 .PATH: $(SRCTOP)/board LINKER_SCRIPT=$(STM32)/f103c8t6/STM32F103C8T6_FLASH.ld SRCS+= \ f1_flash.c \ hal_generic.c \ startup_stm32f103xb.s \ stm32_bluepill.c \ stm32f1xx_hal.c \ stm32f1xx_hal_adc.c \ stm32f1xx_hal_adc_ex.c \ stm32f1xx_hal_cortex.c \ stm32f1xx_hal_dma.c \ stm32f1xx_hal_flash.c \ stm32f1xx_hal_flash_ex.c \ stm32f1xx_hal_gpio.c \ stm32f1xx_hal_pcd.c \ stm32f1xx_hal_pcd_ex.c \ stm32f1xx_hal_pwr.c \ stm32f1xx_hal_rcc.c \ stm32f1xx_hal_rcc_ex.c \ stm32f1xx_hal_uart.c \ system_stm32f1xx.c CFLAGS+= -I$(STM32) CFLAGS+= -I$(STM32)/f103c8t6 CFLAGS+= -DSTM32F103xB .endif # NODE151 Microcontroller .if ${MK_NODE151} == "yes" ARMTARGET?= -mcpu=cortex-m3 -mthumb .PATH: $(STM32)/l151ccux LINKER_SCRIPT=$(STM32)/l151ccux/STM32L151CCUX_FLASH.ld SRCS+= \ startup_stm32l151ccux.s \ stm32l1xx_hal.c \ stm32l1xx_hal_adc.c \ stm32l1xx_hal_adc_ex.c \ stm32l1xx_hal_cortex.c \ stm32l1xx_hal_dma.c \ stm32l1xx_hal_flash.c \ stm32l1xx_hal_flash_ex.c \ stm32l1xx_hal_gpio.c \ stm32l1xx_hal_pcd.c \ stm32l1xx_hal_pcd_ex.c \ stm32l1xx_hal_pwr.c \ stm32l1xx_hal_pwr_ex.c \ stm32l1xx_hal_rcc.c \ stm32l1xx_hal_rcc_ex.c \ stm32l1xx_hal_rtc.c \ stm32l1xx_hal_rtc_ex.c \ stm32l1xx_hal_spi.c \ stm32l1xx_hal_uart.c \ system_stm32l1xx.c SRCS+= \ stm32l1xx_it.c \ stm32l1xx_hal_msp.c CFLAGS+= -I$(STM32) CFLAGS+= -I$(STM32)/l151ccux CFLAGS+= -DSTM32L151xC .endif # RS485 Framing .if ${MK_RS485FRAME} == "yes" SRCS+= \ rs485frame.c CFLAGS+= -I$(SRCTOP)/rs485hid .endif # USB CDC .if ${MK_USB_CDC} == "yes" .PATH: $(STM32)/usb SRCS.USB_CDC+= \ misc.c \ usb_device.c \ usbd_cdc.c \ usbd_cdc_if.c \ usbd_conf.c \ usbd_core.c \ usbd_ctlreq.c \ usbd_desc.c \ usbd_ioreq.c CFLAGS+= -I$(STM32)/usb .endif # USB HID .if ${MK_USB_HID} == "yes" .PATH: $(STM32)/usb CFLAGS+= -I$(.OBJDIR) SRCS.USB_HID+= \ usb_hid_def.c \ usbd_conf.c \ usbd_core.c \ usbd_ctlreq_nodesc.c \ usbd_ioreq.c CFLAGS+= -I$(STM32)/usb .endif .if ${MK_USB} == "yes" && ${MK_STM32F103} == "yes" SRCS.USB+= \ si_usb.c \ stm32f1xx_ll_usb.c .endif .if ${MK_USB} == "yes" && ${MK_NODE151} == "yes" SRCS.USB_CDC+= \ si_usb.c \ stm32l1xx_ll_usb.c .endif