From 9f91f1a8ae7738804d012b1751f6c806a2138d10 Mon Sep 17 00:00:00 2001 From: Raul Munoz Date: Fri, 19 May 2017 15:06:24 -0300 Subject: examples: hello_world_ocram: update CMake structure Updating this CMake struct according hello_world example. Using this new struct we can build debug and release configuration at the same time and use Eclipse. Signed-off-by: Raul Munoz Signed-off-by: Stefan Agner --- .../hello_world_ocram/armgcc/CMakeLists.txt | 183 ++++++++++----------- .../hello_world_ocram/armgcc/build_all.bat | 10 +- .../hello_world_ocram/armgcc/build_all.sh | 10 +- .../hello_world_ocram/armgcc/build_debug.bat | 3 - .../hello_world_ocram/armgcc/build_debug.sh | 3 - .../hello_world_ocram/armgcc/build_release.bat | 3 - .../hello_world_ocram/armgcc/build_release.sh | 3 - .../demo_apps/hello_world_ocram/armgcc/clean.bat | 10 +- .../demo_apps/hello_world_ocram/armgcc/clean.sh | 8 +- .../hello_world_ocram/armgcc/debug/build_debug.bat | 3 + .../hello_world_ocram/armgcc/debug/build_debug.sh | 3 + .../armgcc/release/build_release.bat | 3 + .../armgcc/release/build_release.sh | 3 + .../demo_apps/hello_world_ocram/hardware_init.c | 30 +--- 14 files changed, 123 insertions(+), 152 deletions(-) delete mode 100644 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.bat delete mode 100755 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.sh delete mode 100644 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.bat delete mode 100755 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.sh create mode 100644 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.bat create mode 100755 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.sh create mode 100644 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.bat create mode 100755 examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.sh diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/CMakeLists.txt b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/CMakeLists.txt index 469ae23..acfd668 100644 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/CMakeLists.txt +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/CMakeLists.txt @@ -1,5 +1,8 @@ INCLUDE(CMakeForceCompiler) +SET(ProjectName hello_world_ocram) +PROJECT(${ProjectName}) + # CROSS COMPILER SETTING SET(CMAKE_SYSTEM_NAME Generic) CMAKE_MINIMUM_REQUIRED (VERSION 2.6) @@ -17,119 +20,101 @@ SET(CMAKE_STATIC_LIBRARY_SUFFIX) SET(CMAKE_EXECUTABLE_LIBRARY_PREFIX) SET(CMAKE_EXECUTABLE_LIBRARY_SUFFIX) - +SET(CMAKE_SKIP_INSTALL_RULES TRUE) + # CURRENT DIRECTORY SET(ProjDirPath ${CMAKE_CURRENT_SOURCE_DIR}) +SET(BspRootDirPath ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..) + +# RELEASE/DEBUG LINK FILE +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T MCIMX7D_M4_ocram.ld -static -L ${BspRootDirPath}/platform/devices/MCIMX7D/linker/gcc/") -# DEBUG LINK FILE -set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${ProjDirPath}/../../../../../platform/devices/MCIMX7D/linker/gcc/MCIMX7D_M4_ocram.ld -static") +# DEFAULT ASM FLAGS +SET(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99") -# RELEASE LINK FILE -set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${ProjDirPath}/../../../../../platform/devices/MCIMX7D/linker/gcc/MCIMX7D_M4_ocram.ld -static") +# DEFAULT C FLAGS +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -MMD -MP -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99") + +# DEFAULT LD FLAGS +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 --specs=nano.specs -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mthumb -mapcs -Xlinker --gc-sections -Xlinker -static -Xlinker -z -z max-page-size=4096 -Xlinker muldefs") # DEBUG ASM FLAGS -SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99") +SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g") # DEBUG C FLAGS -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -MMD -MP -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0") # DEBUG LD FLAGS -SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 --specs=nano.specs -lm -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -Os -mthumb -mapcs -Xlinker --gc-sections -Xlinker -static -Xlinker -z -Xlinker muldefs") - -# RELEASE ASM FLAGS -SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99") +SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g") # RELEASE C FLAGS -SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -MMD -MP -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99") - -# RELEASE LD FLAGS -SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 --specs=nano.specs -lm -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -Os -mthumb -mapcs -Xlinker --gc-sections -Xlinker -static -Xlinker -z -Xlinker muldefs") +SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os") # ASM MACRO SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -D__DEBUG") # C MACRO +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCPU_MCIMX7D_M4") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D__DEBUG") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DCPU_MCIMX7D_M4") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D__NDEBUG") -SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DCPU_MCIMX7D_M4") - -# CXX MACRO # INCLUDE_DIRECTORIES -IF(CMAKE_BUILD_TYPE MATCHES Debug) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../..) - INCLUDE_DIRECTORIES(${ProjDirPath}/..) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/CMSIS/Include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/devices) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/devices/MCIMX7D/include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/devices/MCIMX7D/startup) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/drivers/inc) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/utilities/inc) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../..) - INCLUDE_DIRECTORIES(${ProjDirPath}/..) -ELSEIF(CMAKE_BUILD_TYPE MATCHES Release) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../..) - INCLUDE_DIRECTORIES(${ProjDirPath}/..) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/CMSIS/Include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/devices) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/devices/MCIMX7D/include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/devices/MCIMX7D/startup) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/drivers/inc) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../platform/utilities/inc) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../..) - INCLUDE_DIRECTORIES(${ProjDirPath}/..) -ENDIF() +INCLUDE_DIRECTORIES(${ProjDirPath}/../../..) +INCLUDE_DIRECTORIES(${ProjDirPath}/..) +INCLUDE_DIRECTORIES(${BspRootDirPath}/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F) +INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/CMSIS/Include) +INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices) +INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/include) +INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/startup) +INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/drivers/inc) +INCLUDE_DIRECTORIES(${BspRootDirPath}/rtos/FreeRTOS/Source/include) +INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/utilities/inc) # ADD_EXECUTABLE -ADD_EXECUTABLE(hello_world_ocram - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h" - "${ProjDirPath}/../../../../../platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/portable/MemMang/heap_2.c" +ADD_EXECUTABLE(${ProjectName} + "${BspRootDirPath}/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c" + "${BspRootDirPath}/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h" + "${BspRootDirPath}/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S" + "${BspRootDirPath}/rtos/FreeRTOS/Source/portable/MemMang/heap_2.c" "${ProjDirPath}/../FreeRTOSConfig.h" "${ProjDirPath}/../../hello_world/main.c" - "${ProjDirPath}/../../../../../platform/drivers/src/uart_imx.c" - "${ProjDirPath}/../../../../../platform/drivers/inc/uart_imx.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/croutine.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/event_groups.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/FreeRTOS.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/list.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/mpu_wrappers.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/portable.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/projdefs.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/queue.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/semphr.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/StackMacros.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/task.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/include/timers.h" - "${ProjDirPath}/../../../../../platform/drivers/inc/ccm_analog_imx7d.h" - "${ProjDirPath}/../../../../../platform/drivers/inc/ccm_imx7d.h" - "${ProjDirPath}/../../../../../platform/drivers/inc/lmem.h" - "${ProjDirPath}/../../../../../platform/drivers/inc/rdc.h" - "${ProjDirPath}/../../../../../platform/drivers/inc/rdc_defs_imx7d.h" - "${ProjDirPath}/../../../../../platform/drivers/inc/wdog_imx.h" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/croutine.c" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/event_groups.c" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/list.c" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/queue.c" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/tasks.c" - "${ProjDirPath}/../../../../../rtos/FreeRTOS/Source/timers.c" - "${ProjDirPath}/../../../../../platform/drivers/src/ccm_analog_imx7d.c" - "${ProjDirPath}/../../../../../platform/drivers/src/ccm_imx7d.c" - "${ProjDirPath}/../../../../../platform/drivers/src/lmem.c" - "${ProjDirPath}/../../../../../platform/drivers/src/rdc.c" - "${ProjDirPath}/../../../../../platform/drivers/src/wdog_imx.c" - "${ProjDirPath}/../../../../../platform/utilities/src/debug_console_imx.c" - "${ProjDirPath}/../../../../../platform/utilities/inc/debug_console_imx.h" - "${ProjDirPath}/../../../../../platform/utilities/src/print_scan.c" - "${ProjDirPath}/../../../../../platform/utilities/src/print_scan.h" - "${ProjDirPath}/../../../../../platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.c" - "${ProjDirPath}/../../../../../platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.h" + "${BspRootDirPath}/platform/drivers/src/uart_imx.c" + "${BspRootDirPath}/platform/drivers/inc/uart_imx.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/croutine.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/event_groups.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/FreeRTOS.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/list.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/mpu_wrappers.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/portable.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/projdefs.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/queue.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/semphr.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/StackMacros.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/task.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/include/timers.h" + "${BspRootDirPath}/platform/drivers/inc/ccm_analog_imx7d.h" + "${BspRootDirPath}/platform/drivers/inc/ccm_imx7d.h" + "${BspRootDirPath}/platform/drivers/inc/lmem.h" + "${BspRootDirPath}/platform/drivers/inc/rdc.h" + "${BspRootDirPath}/platform/drivers/inc/rdc_defs_imx7d.h" + "${BspRootDirPath}/platform/drivers/inc/wdog_imx.h" + "${BspRootDirPath}/rtos/FreeRTOS/Source/croutine.c" + "${BspRootDirPath}/rtos/FreeRTOS/Source/event_groups.c" + "${BspRootDirPath}/rtos/FreeRTOS/Source/list.c" + "${BspRootDirPath}/rtos/FreeRTOS/Source/queue.c" + "${BspRootDirPath}/rtos/FreeRTOS/Source/tasks.c" + "${BspRootDirPath}/rtos/FreeRTOS/Source/timers.c" + "${BspRootDirPath}/platform/drivers/src/ccm_analog_imx7d.c" + "${BspRootDirPath}/platform/drivers/src/ccm_imx7d.c" + "${BspRootDirPath}/platform/drivers/src/lmem.c" + "${BspRootDirPath}/platform/drivers/src/rdc.c" + "${BspRootDirPath}/platform/drivers/src/wdog_imx.c" + "${BspRootDirPath}/platform/utilities/src/debug_console_imx.c" + "${BspRootDirPath}/platform/utilities/inc/debug_console_imx.h" + "${BspRootDirPath}/platform/utilities/src/print_scan.c" + "${BspRootDirPath}/platform/utilities/src/print_scan.h" + "${BspRootDirPath}/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.c" + "${BspRootDirPath}/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.h" "${ProjDirPath}/../../../pin_mux.c" "${ProjDirPath}/../../../pin_mux.h" "${ProjDirPath}/../../../board.c" @@ -138,25 +123,25 @@ ADD_EXECUTABLE(hello_world_ocram "${ProjDirPath}/../../../clock_freq.h" "${ProjDirPath}/../hardware_init.c" ) -SET_TARGET_PROPERTIES(hello_world_ocram PROPERTIES OUTPUT_NAME "hello_world_ocram.elf") +SET_TARGET_PROPERTIES(${ProjectName} PROPERTIES OUTPUT_NAME "${ProjectName}.elf") -TARGET_LINK_LIBRARIES(hello_world_ocram -Wl,--start-group) +TARGET_LINK_LIBRARIES(${ProjectName} -Wl,--start-group) # LIBRARIES IF(CMAKE_BUILD_TYPE MATCHES Debug) ELSEIF(CMAKE_BUILD_TYPE MATCHES Release) ENDIF() # SYSTEM LIBRARIES -TARGET_LINK_LIBRARIES(hello_world_ocram m) -TARGET_LINK_LIBRARIES(hello_world_ocram c) -TARGET_LINK_LIBRARIES(hello_world_ocram gcc) -TARGET_LINK_LIBRARIES(hello_world_ocram nosys) -TARGET_LINK_LIBRARIES(hello_world_ocram -Wl,--end-group) +TARGET_LINK_LIBRARIES(${ProjectName} m) +TARGET_LINK_LIBRARIES(${ProjectName} c) +TARGET_LINK_LIBRARIES(${ProjectName} gcc) +TARGET_LINK_LIBRARIES(${ProjectName} nosys) +TARGET_LINK_LIBRARIES(${ProjectName} -Wl,--end-group) # MAP FILE -SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker -Map=debug/hello_world_ocram.map") -SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker -Map=release/hello_world_ocram.map") +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -Map=${ProjectName}.map") # BIN AND HEX -ADD_CUSTOM_COMMAND(TARGET hello_world_ocram POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex ${EXECUTABLE_OUTPUT_PATH}/hello_world_ocram.elf ${EXECUTABLE_OUTPUT_PATH}/hello_world_ocram.hex) -ADD_CUSTOM_COMMAND(TARGET hello_world_ocram POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Obinary ${EXECUTABLE_OUTPUT_PATH}/hello_world_ocram.elf ${EXECUTABLE_OUTPUT_PATH}/hello_world_ocram.bin) +ADD_CUSTOM_COMMAND(TARGET ${ProjectName} POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex ${EXECUTABLE_OUTPUT_PATH}/${ProjectName}.elf ${EXECUTABLE_OUTPUT_PATH}/${ProjectName}.hex) +# bin does not support sparse memory area, which our default linker file uses... +#ADD_CUSTOM_COMMAND(TARGET ${ProjectName} POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Obinary ${EXECUTABLE_OUTPUT_PATH}/${ProjectName}.elf ${EXECUTABLE_OUTPUT_PATH}/${ProjectName}.bin) diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.bat b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.bat index 6d41d86..426a29f 100644 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.bat +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.bat @@ -1,5 +1,7 @@ -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug . -mingw32-make -j4 -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release . -mingw32-make -j4 +cd release +call build_release.bat +cd .. +cd debug +call build_debug.bat +cd .. pause diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.sh b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.sh index ebb0c25..99e6267 100755 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.sh +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_all.sh @@ -1,5 +1,7 @@ #!/bin/sh -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug . -make -j4 -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release . -make -j4 +cd debug/ +./build_debug.sh +cd .. +cd release/ +./build_release.sh +cd .. diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.bat b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.bat deleted file mode 100644 index bf3b902..0000000 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.bat +++ /dev/null @@ -1,3 +0,0 @@ -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug . -mingw32-make -j4 -pause diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.sh b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.sh deleted file mode 100755 index 571868b..0000000 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_debug.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug . -make -j4 diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.bat b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.bat deleted file mode 100644 index e229a83..0000000 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.bat +++ /dev/null @@ -1,3 +0,0 @@ -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release . -mingw32-make -j4 -pause diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.sh b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.sh deleted file mode 100755 index 035ce4e..0000000 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/build_release.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release . -make -j4 diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.bat b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.bat index ffea088..fc53949 100644 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.bat +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.bat @@ -1,3 +1,9 @@ -RD /s /Q Debug Release CMakeFiles -DEL /s /Q /F Makefile cmake_install.cmake CMakeCache.txt +cd debug +rd /s /Q CMakeFiles/ +del /s /Q /F Makefile cmake_install.cmake CMakeCache.txt *.elf *.bin *.map *.hex +cd .. +cd release +rd /s /Q CMakeFiles/ +del /s /Q /F Makefile cmake_install.cmake CMakeCache.txt *.elf *.bin *.map *.hex +cd .. pause diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.sh b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.sh index 795ad87..4b188ab 100755 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.sh +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/clean.sh @@ -1,3 +1,7 @@ #!/bin/sh -rm -rf debug release CMakeFiles -rm -rf Makefile cmake_install.cmake CMakeCache.txt +cd debug +rm -rf Makefile cmake_install.cmake CMakeCache.txt CMakeFiles *.elf *.bin *.map *.hex .cproject .project +cd .. +cd release +rm -rf Makefile cmake_install.cmake CMakeCache.txt CMakeFiles *.elf *.bin *.map *.hex +cd .. diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.bat b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.bat new file mode 100644 index 0000000..434e91e --- /dev/null +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.bat @@ -0,0 +1,3 @@ +cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug .. +mingw32-make -j4 +pause diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.sh b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.sh new file mode 100755 index 0000000..3c169d2 --- /dev/null +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/debug/build_debug.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug .. +make -j4 diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.bat b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.bat new file mode 100644 index 0000000..17f773a --- /dev/null +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.bat @@ -0,0 +1,3 @@ +cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .. +mingw32-make -j4 +pause diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.sh b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.sh new file mode 100755 index 0000000..1ad7338 --- /dev/null +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/armgcc/release/build_release.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cmake -DCMAKE_TOOLCHAIN_FILE="../../../../../tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. +make -j4 diff --git a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/hardware_init.c b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/hardware_init.c index 598d2de..9081bfd 100644 --- a/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/hardware_init.c +++ b/examples/imx7_colibri_m4/demo_apps/hello_world_ocram/hardware_init.c @@ -31,43 +31,15 @@ #include "board.h" #include "pin_mux.h" -void RDC_memory_init(void) -{ - uint32_t start, end; -#if defined(__CC_ARM) - extern uint32_t Image$$VECTOR_ROM$$Base[]; - extern uint32_t Image$$ER_m_text$$Limit[]; - extern uint32_t Image$$RW_m_data$$Base[]; - extern uint32_t Image$$RW_m_data$$Limit[]; - - start = (uint32_t)Image$$VECTOR_ROM$$Base & 0xFFFFFF80; - end = (uint32_t)(Image$$ER_m_text$$Limit + (Image$$RW_m_data$$Limit - Image$$RW_m_data$$Base)); - end = (end + 0x7F) & 0xFFFFFF80; -#else - extern uint32_t __FLASH_START[]; - extern uint32_t __FLASH_END[]; - - start = (uint32_t)__FLASH_START & 0xFFFFFF80; - end = ((uint32_t)__FLASH_END + 0x7F) & 0xFFFFFF80; -#endif - - /* Grant all domains read/write access because in DSM mode Linux need to - * save/restore OCRAM content */ - RDC_SetMrAccess(RDC, rdcMrOcram, start, end, 0xFF, true, false); -} - void hardware_init(void) { /* Board specific RDC settings */ BOARD_RdcInit(); - /* Bound part of the OCRAM Memory to M4 Core */ - RDC_memory_init(); - /* Board specific clock settings */ BOARD_ClockInit(); - /* Initialize debug uart */ + /* initialize debug uart */ dbg_uart_init(); } -- cgit v1.2.3