Initial work for McHCK mk20dx128vlf5 port.
This commit is contained in:
parent
c203d23be5
commit
acf8cb979c
12 changed files with 89 additions and 37 deletions
|
@ -25,7 +25,7 @@ set( _CMAKE_TOOLCHAIN_PREFIX arm-none-eabi- )
|
|||
|
||||
#| Chip Name (Linker)
|
||||
#|
|
||||
#| "mk20dx128" # Teensy 3.0
|
||||
#| "mk20dx128" # Teensy 3.0 and McHCK mk20dx128
|
||||
#| "mk20dx256" # Teensy 3.1
|
||||
|
||||
message( STATUS "Chip Selected:" )
|
||||
|
@ -35,7 +35,7 @@ set( MCU "${CHIP}" ) # For loading script compatibility
|
|||
|
||||
#| Chip Size Database
|
||||
#| Teensy 3.0
|
||||
if ( "${CHIP}" MATCHES "mk20dx128" )
|
||||
if ( "${CHIP}" MATCHES "mk20dx128" OR "${CHIP}" MATCHES "mk20dx128vlf5" )
|
||||
set( SIZE_RAM 16384 )
|
||||
set( SIZE_FLASH 131072 )
|
||||
|
||||
|
@ -65,7 +65,7 @@ endif ()
|
|||
#| You _MUST_ set this to match the board you are using
|
||||
#| type "make clean" after changing this, so all files will be rebuilt
|
||||
#|
|
||||
#| "cortex-m4" # Teensy 3.0, 3.1
|
||||
#| "cortex-m4" # Teensy 3.0, 3.1, McHCK
|
||||
set( CPU "cortex-m4" )
|
||||
|
||||
message( STATUS "CPU Selected:" )
|
||||
|
@ -83,9 +83,14 @@ message( STATUS "Compiler Source Files:" )
|
|||
message( "${COMPILER_SRCS}" )
|
||||
|
||||
|
||||
#| USB Defines
|
||||
set( VENDOR_ID "0x16C0" )
|
||||
set( PRODUCT_ID "0x0487" )
|
||||
#| USB Defines, this is how the loader programs detect which type of chip base is used
|
||||
if ( "${CHIP}" MATCHES "mk20dx128" OR "${CHIP}" MATCHES "mk20dx256" )
|
||||
set( VENDOR_ID "0x16C0" )
|
||||
set( PRODUCT_ID "0x0487" )
|
||||
elseif ( "${CHIP}" MATCHES "mk20dx128vlf5" )
|
||||
set( VENDOR_ID "0x2323" )
|
||||
set( PRODUCT_ID "0x0001" )
|
||||
endif ()
|
||||
|
||||
|
||||
#| Compiler flag to set the C Standard level.
|
||||
|
@ -113,11 +118,6 @@ set( TUNING "-mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar
|
|||
set( OPT "s" )
|
||||
|
||||
|
||||
#| Output Format
|
||||
#| srec, ihex, binary
|
||||
set( FORMAT "ihex" )
|
||||
|
||||
|
||||
#| Processor frequency.
|
||||
#| Normally the first thing your program should do is set the clock prescaler,
|
||||
#| so your program will run at the correct speed. You should also set this
|
||||
|
@ -140,7 +140,11 @@ set( LINKER_FLAGS "-mcpu=${CPU} -Wl,-Map=${TARGET}.map,--cref -Wl,--gc-sections
|
|||
|
||||
|
||||
#| Hex Flags (XXX, CMake seems to have issues if you quote the arguments for the custom commands...)
|
||||
set( HEX_FLAGS -O ${FORMAT} -R .eeprom )
|
||||
set( HEX_FLAGS -O ihex -R .eeprom )
|
||||
|
||||
|
||||
#| Binary Flags
|
||||
set( BIN_FLAGS -O binary )
|
||||
|
||||
|
||||
#| Lss Flags
|
||||
|
|
|
@ -286,8 +286,16 @@ set_target_properties( ${TARGET_ELF} PROPERTIES
|
|||
)
|
||||
|
||||
|
||||
#| Convert the .ELF into a .bin to load onto the McHCK
|
||||
set( TARGET_BIN ${TARGET}.dfu.bin )
|
||||
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
||||
COMMAND ${CMAKE_OBJCOPY} ${BIN_FLAGS} ${TARGET_ELF} ${TARGET_BIN}
|
||||
COMMENT "Creating binary file to load: ${TARGET_BIN}"
|
||||
)
|
||||
|
||||
|
||||
#| Convert the .ELF into a .HEX to load onto the Teensy
|
||||
set( TARGET_HEX ${TARGET}.hex )
|
||||
set( TARGET_HEX ${TARGET}.teensy.hex )
|
||||
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
||||
COMMAND ${CMAKE_OBJCOPY} ${HEX_FLAGS} ${TARGET_ELF} ${TARGET_HEX}
|
||||
COMMENT "Creating iHex file to load: ${TARGET_HEX}"
|
||||
|
@ -323,8 +331,8 @@ add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
|||
|
||||
#| After Changes Size Information
|
||||
add_custom_target( SizeAfter ALL
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} ${FORMAT} ${TARGET_ELF} ${SIZE_RAM} " SRAM"
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} ${FORMAT} ${TARGET_HEX} ${SIZE_FLASH} "Flash"
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} ihex ${TARGET_ELF} ${SIZE_RAM} " SRAM"
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} ihex ${TARGET_HEX} ${SIZE_FLASH} "Flash"
|
||||
DEPENDS ${TARGET_ELF}
|
||||
COMMENT "Chip usage for ${CHIP}"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue