package platform.stm32.f4.stm32f4ve

@BuildArtifactPath(cppflags="-DSTM32F407xx -DUSE_STM32F4VE")
static module stm32f4ve_conf extends third_party.bsp.stmf4cube.stm32f4_conf {
	@IncludeExport(path="")
	source "stm32f4xx_hal_conf.h"
}

@Build(stage=1)
@BuildDepends(stm32f4ve_conf)
@BuildDepends(third_party.bsp.stmf4cube.cube)
/*@BuildArtifactPath(cppflags="-I$(EXTERNAL_BUILD_DIR)/third_party/bsp/stmf4cube/cube/STM32CubeF4-1.27.1/Drivers/BSP/STM32F4-Discovery")*/
@BuildDepends(third_party.bsp.stmf4cube.bsp_drivers.stm324xg_eval_sd)
static module bsp extends third_party.bsp.st_bsp_api {
	/* STM32F40x and STM32F41x Errata sheet:
	 *
	 * https://www.st.com/content/ccc/resource/technical/document/errata_sheet/0a/98/58/84/86/b6/47/a2/DM00037591.pdf/files/DM00037591.pdf/jcr:content/translations/en.DM00037591.pdf
	 *
	 *  "2.5.2 Corrupted last bit of data and/or CRC,
	 *  received in Master mode with delayed SCK feedback" */
	option boolean errata_spi_wrong_last_bit=false

	source "clock_config.c"

	@AddPrefix("^BUILD/extbld/third_party/bsp/stmf4cube/cube/STM32CubeF4-1.27.1/")
	source "Projects/STM32F4-Discovery/Templates/Src/system_stm32f4xx.c"

	/*@AddPrefix("^BUILD/extbld/third_party/bsp/stmf4cube/cube/STM32CubeF4-1.27.1/Drivers/BSP/STM32F4-Discovery")*/
	source "stm32f4ve.c"

	@NoRuntime depends third_party.bsp.stmf4cube.bsp_drivers.stm324xg_eval_sd
	@NoRuntime depends third_party.bsp.stmf4cube.cube
	@NoRuntime depends stm32f4ve_conf
	@NoRuntime depends platform.stm32.stm32cube_compat
}

