Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fix an issue in nordic CMake file #1486

Merged
merged 1 commit into from
Oct 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions vendors/nordic/boards/nrf52840-dk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,17 @@ if(AFR_ENABLE_DEMOS OR AFR_ENABLE_TESTS)
"FLASH_PH_START=0x0$<SEMICOLON>FLASH_PH_SIZE=0x100000$<SEMICOLON>RAM_PH_START=0x20000000$<SEMICOLON>RAM_PH_SIZE=0x40000$<SEMICOLON>FLASH_START=0x27000$<SEMICOLON>FLASH_SIZE=0xda000$<SEMICOLON>RAM_START=0x200046F8$<SEMICOLON>RAM_SIZE=0x3B908"
)

find_program(gcc_objectcopy objcopy HINTS "${AFR_COMPILER_DIR}")
find_program(gcc_size arm-none-eabi-size HINTS "${AFR_COMPILER_DIR}")

if(NOT gcc_objectcopy)
message(FATAL_ERROR "Cannot find objcopy.")
endif()

if(NOT gcc_size)
message(FATAL_ERROR "Cannot find arm-none-eabi-size.")
endif()

function(nrf52840_build)
set( build_target ${ARGV0} )
set( build_mkld_flags ${${ARGV1}} )
Expand All @@ -513,13 +524,6 @@ if(AFR_ENABLE_DEMOS OR AFR_ENABLE_TESTS)
COMMAND VERBATIM "${AFR_COMPILER_DIR}/../../../bin/mkld" ${build_mkld_flags} "${CMAKE_BINARY_DIR}/${build_target}.ld"
)

find_program(gcc_objectcopy objcopy)
find_program(gcc_size arm-none-eabi-size)

if(NOT gcc_objectcopy )
message(FATAL_ERROR "Cannot find objcopy.")
endif()

set(output_file "$<TARGET_FILE_DIR:${build_target}>/${build_target}.hex")

add_custom_command(
Expand Down