Error While building for M4_image.bin

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error While building for M4_image.bin

1,895 Views
vinothkumars
Senior Contributor IV

Hi.

Will you please give some fix for this build error,

ddr_release/rear_view_camera.elf section `.ncache' will not fit in region `m_data2'

region `m_data2' overflowed by 3874816 bytes

sek@IVm:~/Documents/VINOTH/IndiEV-IMX8-A9/source$ make bootloader -j4
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=9
TARGET_PRODUCT=mek_8q_car
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a9
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-74-generic-x86_64-Ubuntu-16.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=2.1.1-auto-ga-rc1
OUT_DIR=out
============================================
ninja: no work to do.
ninja: no work to do.
No need to regenerate ninja file
No need to regenerate ninja file
[ 33% 1/3] Building M4 image for UBoot ...
FAILED: UBOOT_M4_BIN
/bin/bash -c "cmake_version=\$(cmake --version | head -n 1 | tr \" \" \"\\n\" | tail -n 1); req_version=\"3.13.0\"; if [ \"\$(echo \"\$cmake_version \$req_version\" | tr \" \" \"\\n\" | sort -V | head -n 1)\" != \"\$req_version\" ]; then echo \"please upgrade cmake version to 3.13.0 or newer\"; exit 1; fi; mkdir -p out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QM; cmake -DCMAKE_TOOLCHAIN_FILE=\"../../../../../../tools/cmake_toolchain_files/armgcc.cmake\" -G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE=ddr_release -S vendor/nxp/mcu-sdk-auto/SDK_MEK-MIMX8QM/boards/mekmimx8qm/demo_apps/rear_view_camera/cm4_core1/armgcc -B out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QM 1>/dev/null || exit 1; make -j2 SHELL=/bin/bash -C out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QM 1>/dev/null || exit 1; mkdir -p out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QX; cmake -DCMAKE_TOOLCHAIN_FILE=\"../../../../../tools/cmake_toolchain_files/armgcc.cmake\" -G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE=ddr_release -S vendor/nxp/mcu-sdk-auto/SDK_MEK-MIMX8QX/boards/mekmimx8qx/demo_apps/rear_view_camera/armgcc -B out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QX 1>/dev/null || exit 1; make -j2 SHELL=/bin/bash -C out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QX 1>/dev/null || exit 1"
CMake Deprecation Warning at /home/emb-vinosek/cmake-3.13.2/Modules/CMakeForceCompiler.cmake:69 (message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
/home/emb-vinosek/Documents/VINOTH/IndiEV-IMX8-A9/source/vendor/nxp/mcu-sdk-auto/SDK_MEK-MIMX8QM/tools/cmake_toolchain_files/armgcc.cmake:33 (CMAKE_FORCE_C_COMPILER)
/home/emb-vinosek/Documents/VINOTH/IndiEV-IMX8-A9/source/out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QM/CMakeFiles/3.13.2/CMakeSystem.cmake:6 (include)


CMake Deprecation Warning at /home/emb-vinosek/cmake-3.13.2/Modules/CMakeForceCompiler.cmake:83 (message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
/home/emb-vinosek/Documents/VINOTH/IndiEV-IMX8-A9/source/vendor/nxp/mcu-sdk-auto/SDK_MEK-MIMX8QM/tools/cmake_toolchain_files/armgcc.cmake:34 (CMAKE_FORCE_CXX_COMPILER)
/home/emb-vinosek/Documents/VINOTH/IndiEV-IMX8-A9/source/out/target/product/mek_8q/obj/MCU_OBJ/MIMX8QM/CMakeFiles/3.13.2/CMakeSystem.cmake:6 (include)


/home/emb-vinosek/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: ddr_release/rear_view_camera.elf section `.ncache' will not fit in region `m_data2'
/home/emb-vinosek/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: region `m_data2' overflowed by 3874816 bytes
collect2: error: ld returned 1 exit status
make[2]: *** [ddr_release/rear_view_camera.elf] Error 1
make[1]: *** [CMakeFiles/rear_view_camera.elf.dir/all] Error 2
make: *** [all] Error 2
ninja: build stopped: subcommand failed.
15:09:52 ninja failed with: exit status 1

#### failed to build some targets (18 seconds) ####

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply
6 Replies

1,566 Views
vinothkumars
Senior Contributor IV

Hi,

Define the OV5640 camera in M4 Core.

1. Configure the camera

  • source/vendor/nxp/mcu-sdk-auto/SDK_MEK-MIMX8QM/boards/mekmimx8qm/demo_apps/rear_view_camera/ cm4_core1/isi_config.h

- #define CAMERA_DEVICE CAMERA_DEVICE_MAX9286

+ #define CAMERA_DEVICE CAMERA_DEVICE_OV5640

2. Resolve build error

  • After I changed I got the build error,

/home/sek/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: ddr_release/rear_view_camera.elf section `.ncache' will not fit in region `m_data2'


/home/sek/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: region `m_data2' overflowed by 3874816 bytes

fixed by,

- m_data2 (RW) : ORIGIN = 0x89000000, LENGTH = 0x01800000
+ m_data2 (RW) : ORIGIN = 0x89000000, LENGTH = 0x01BB2000

But, I got kernel crash,

[   39.354186] kernel BUG at /home/emb-vinosek/Documents/VINOTH/IndiEV-IMX8-A9/source/vendor/nxp-opensource/kernel_imx/include/linux/dma-mapping.h:408!

I have the following questions regarding my implementation,

1. Is it everything OK ?

2. Do I needs to do some more configuration ?

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply

1,566 Views
jinchen1227
Contributor II

If you increase m_data2, I think you should check the reserved-memory in Android device tree if there is any duplicate region. 

0 Kudos
Reply

1,566 Views
vinothkumars
Senior Contributor IV

Hi Chen King,

Thank you for  your reply and I fixed this issue and this is my patch,

-  m_data2 (RW) : ORIGIN = 0x89002800, LENGTH = 0x017FD800

+ m_data2 (RW) : ORIGIN = 0x89000000, LENGTH = 0x07000000

Thank You,

Vinoth S,

Regards,
Vinothkumar Sekar
0 Kudos
Reply

1,566 Views
igorpadykov
NXP Employee
NXP Employee

Hi VinothS

for iar "ncache" examples one can look at SDK_EVK-MIMX8M Mini, in

board.c, function BOARD_InitMemory()

Welcome | MCUXpresso SDK Builder 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,566 Views
vinothkumars
Senior Contributor IV

Hi,

As per nxp release node (android_p9.0.0_2.1.1-auto-ga_doc/Android_Release_Notes),

camera MAX9826 is tested with imx8qm-mek. But, provided camera is ov5640 (i.MX 8 Series Accessory Boards | NXP )

So, I configured for ov5640.

source/vendor/nxp/mcu-sdk-auto/SDK_MEK-MIMX8QM/boards/mekmimx8qm/demo_apps/rear_view_camera/ cm4_core1/isi_config.h

- #define CAMERA_DEVICE CAMERA_DEVICE_MAX9286

+ #define CAMERA_DEVICE CAMERA_DEVICE_OV5640

After I changed the camera device only I got the build error. eventhough I fix this error by increasing m_data2 length, got kernel crash when using M4 console to start RVC.

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply

1,566 Views
vinothkumars
Senior Contributor IV

Thank you Igorpadykov for your reply.

I fixed this build error by increasing the m_data2 lenght in the file MIMX8QM6xxxFF_cm4_core1_ddr_ram.ld

- m_data2 (RW) : ORIGIN = 0x89000000, LENGTH = 0x01800000
+ m_data2 (RW) : ORIGIN = 0x89000000, LENGTH = 0x01BB2000

I followed this thread https://community.nxp.com/message/1051954?commentID=1051954#comment-1051954 

Is it right way, What I am doing ?

Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply