| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | CFLAGS += \
 | 
					
						
							|  |  |  | 	-DHSE_VALUE=8000000 \
 | 
					
						
							|  |  |  | 	-DSTM32F303xC \
 | 
					
						
							|  |  |  | 	-mthumb \
 | 
					
						
							| 
									
										
										
										
											2019-09-11 16:56:26 +07:00
										 |  |  | 	-mabi=aapcs \
 | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 	-mcpu=cortex-m4 \
 | 
					
						
							|  |  |  | 	-mfloat-abi=hard \
 | 
					
						
							|  |  |  | 	-mfpu=fpv4-sp-d16 \
 | 
					
						
							| 
									
										
										
										
											2019-09-05 22:41:58 +07:00
										 |  |  | 	-nostdlib -nostartfiles \
 | 
					
						
							| 
									
										
										
										
											2019-09-10 12:57:43 -04:00
										 |  |  | 	-DCFG_TUSB_MCU=OPT_MCU_STM32F3 | 
					
						
							| 
									
										
										
										
											2019-09-05 22:41:58 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-27 00:15:43 +07:00
										 |  |  | # mcu driver cause following warnings
 | 
					
						
							|  |  |  | CFLAGS += -Wno-error=unused-parameter | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-05 22:41:58 +07:00
										 |  |  | ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F3xx_HAL_Driver | 
					
						
							|  |  |  | ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F3xx | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # All source paths should be relative to the top level.
 | 
					
						
							| 
									
										
										
										
											2019-09-12 10:41:03 +07:00
										 |  |  | LD_FILE = hw/bsp/$(BOARD)/STM32F303VCTx_FLASH.ld | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | SRC_C += \
 | 
					
						
							| 
									
										
										
										
											2019-09-05 22:41:58 +07:00
										 |  |  | 	$(ST_CMSIS)/Source/Templates/system_stm32f3xx.c \
 | 
					
						
							|  |  |  | 	$(ST_HAL_DRIVER)/Src/stm32f3xx_hal.c \
 | 
					
						
							|  |  |  | 	$(ST_HAL_DRIVER)/Src/stm32f3xx_hal_cortex.c \
 | 
					
						
							|  |  |  | 	$(ST_HAL_DRIVER)/Src/stm32f3xx_hal_rcc.c \
 | 
					
						
							| 
									
										
										
										
											2019-09-11 16:56:26 +07:00
										 |  |  | 	$(ST_HAL_DRIVER)/Src/stm32f3xx_hal_rcc_ex.c \
 | 
					
						
							| 
									
										
										
										
											2019-09-05 22:41:58 +07:00
										 |  |  | 	$(ST_HAL_DRIVER)/Src/stm32f3xx_hal_gpio.c | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | SRC_S += \
 | 
					
						
							| 
									
										
										
										
											2019-09-05 23:36:31 +07:00
										 |  |  | 	$(ST_CMSIS)/Source/Templates/gcc/startup_stm32f303xc.s | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | INC += \
 | 
					
						
							| 
									
										
										
										
											2019-09-05 22:41:58 +07:00
										 |  |  | 	$(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
 | 
					
						
							|  |  |  | 	$(TOP)/$(ST_CMSIS)/Include \
 | 
					
						
							|  |  |  | 	$(TOP)/$(ST_HAL_DRIVER)/Inc \
 | 
					
						
							|  |  |  | 	$(TOP)/hw/bsp/$(BOARD) | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-01 14:27:17 +07:00
										 |  |  | # For TinyUSB port source
 | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | VENDOR = st | 
					
						
							| 
									
										
										
										
											2019-09-09 16:14:38 -04:00
										 |  |  | CHIP_FAMILY = stm32_fsdev | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-01 14:27:17 +07:00
										 |  |  | # For freeRTOS port source
 | 
					
						
							|  |  |  | FREERTOS_PORT = ARM_CM4F | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # For flash-jlink target
 | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | JLINK_DEVICE = stm32f303vc | 
					
						
							| 
									
										
										
										
											2019-05-01 14:27:17 +07:00
										 |  |  | JLINK_IF = swd | 
					
						
							| 
									
										
										
										
											2019-03-22 22:06:48 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Path to STM32 Cube Programmer CLI, should be added into system path 
 | 
					
						
							|  |  |  | STM32Prog = STM32_Programmer_CLI | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # flash target using on-board stlink
 | 
					
						
							|  |  |  | flash: $(BUILD)/$(BOARD)-firmware.elf | 
					
						
							|  |  |  | 	$(STM32Prog) --connect port=swd --write $< --go |