From a5087e16f645715b2631b80a6dfe8a8aaa5749c0 Mon Sep 17 00:00:00 2001 From: Doug Brown Date: Sun, 6 Aug 2023 20:35:29 -0700 Subject: [PATCH] Add cmake source/options includes for M258KE port --- hal/m258ke/m258ke_options.cmake | 28 +++++++++++++++ hal/m258ke/m258ke_sources.cmake | 60 +++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 hal/m258ke/m258ke_options.cmake create mode 100644 hal/m258ke/m258ke_sources.cmake diff --git a/hal/m258ke/m258ke_options.cmake b/hal/m258ke/m258ke_options.cmake new file mode 100644 index 0000000..281a52e --- /dev/null +++ b/hal/m258ke/m258ke_options.cmake @@ -0,0 +1,28 @@ +# M258KE-specific include paths +target_include_directories(SIMMProgrammer.elf PRIVATE + hal/m258ke +) + +# M258KE-specific compiler definitions +target_compile_definitions(SIMMProgrammer.elf PRIVATE +) + +# M258KE-specific compiler options +target_compile_options(SIMMProgrammer.elf PRIVATE + -mcpu=cortex-m23 -march=armv8-m.base -mthumb +) + +# M258KE-specific linker options +target_link_options(SIMMProgrammer.elf PRIVATE + -mcpu=cortex-m23 -march=armv8-m.base -mthumb + -T ${CMAKE_SOURCE_DIR}/hal/m258ke/nuvoton/gcc_arm.ld + --specs=nano.specs +) + +# M258KE-specific command/target to generate .bin file from the ELF file. This program +# is flashed using a bootloader, so there's no need to generate a HEX file. +add_custom_command(OUTPUT SIMMProgrammer.bin + COMMAND ${CMAKE_OBJCOPY} -O binary SIMMProgrammer.elf SIMMProgrammer.bin + DEPENDS SIMMProgrammer.elf +) +add_custom_target(SIMMProgrammer_bin ALL DEPENDS SIMMProgrammer.bin) diff --git a/hal/m258ke/m258ke_sources.cmake b/hal/m258ke/m258ke_sources.cmake new file mode 100644 index 0000000..53ccb3d --- /dev/null +++ b/hal/m258ke/m258ke_sources.cmake @@ -0,0 +1,60 @@ +set(HWSOURCES + hal/m258ke/nuvoton/core_cm23.h + hal/m258ke/nuvoton/cmsis_armcc.h + hal/m258ke/nuvoton/cmsis_armclang.h + hal/m258ke/nuvoton/cmsis_compiler.h + hal/m258ke/nuvoton/cmsis_gcc.h + hal/m258ke/nuvoton/cmsis_version.h + + hal/m258ke/nuvoton/NuMicro.h + hal/m258ke/nuvoton/M251.h + hal/m258ke/nuvoton/system_M251.c + hal/m258ke/nuvoton/system_M251.h + hal/m258ke/nuvoton/startup_M251.S + + hal/m258ke/nuvoton/acmp_reg.h + hal/m258ke/nuvoton/bpwm_reg.h + hal/m258ke/nuvoton/clk_reg.h + hal/m258ke/nuvoton/crc_reg.h + hal/m258ke/nuvoton/crypto_reg.h + hal/m258ke/nuvoton/dac_reg.h + hal/m258ke/nuvoton/eadc_reg.h + hal/m258ke/nuvoton/ebi_reg.h + hal/m258ke/nuvoton/fmc_reg.h + hal/m258ke/nuvoton/gpio_reg.h + hal/m258ke/nuvoton/i2c_reg.h + hal/m258ke/nuvoton/lcd_reg.h + hal/m258ke/nuvoton/opa_reg.h + hal/m258ke/nuvoton/pdma_reg.h + hal/m258ke/nuvoton/psio_reg.h + hal/m258ke/nuvoton/pwm_reg.h + hal/m258ke/nuvoton/qspi_reg.h + hal/m258ke/nuvoton/rtc_reg.h + hal/m258ke/nuvoton/sc_reg.h + hal/m258ke/nuvoton/spi_reg.h + hal/m258ke/nuvoton/sys_reg.h + hal/m258ke/nuvoton/timer_reg.h + hal/m258ke/nuvoton/tk_reg.h + hal/m258ke/nuvoton/uart_reg.h + hal/m258ke/nuvoton/ui2c_reg.h + hal/m258ke/nuvoton/usbd_reg.h + hal/m258ke/nuvoton/uspi_reg.h + hal/m258ke/nuvoton/uuart_reg.h + hal/m258ke/nuvoton/wdt_reg.h + hal/m258ke/nuvoton/wwdt_reg.h + + hal/m258ke/nuvoton/usbd.c + hal/m258ke/nuvoton/usbd.h + + hal/m258ke/board.c + hal/m258ke/board_hw.h + hal/m258ke/descriptors.c + hal/m258ke/gpio.c + hal/m258ke/gpio_hw.h + hal/m258ke/hardware.h + hal/m258ke/parallel_bus.c + hal/m258ke/spi.c + hal/m258ke/spi_private.h + hal/m258ke/usbcdc.c + hal/m258ke/usbcdc_hw.h +)