牛卧堂MCU技术交流

标题: MA35D1 Yocto编译官方M4 BSP recipe错误 [打印本页]

作者: MasterPhi    时间: 2024-4-12 23:07
标题: MA35D1 Yocto编译官方M4 BSP recipe错误
在使用meta-ma35d1 bitbake core-image-minimal时,recipe m4proj-M4-BSP-r0发生错误:
  1. Log data follows:
  2. | DEBUG: Executing python function sstate_task_prefunc
  3. | DEBUG: Python function sstate_task_prefunc finished
  4. | DEBUG: Executing shell function do_deploy
  5. | cp: cannot stat '/P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/image//usr/m4proj/*': No such file or directory
  6. | WARNING: exit code 1 from a shell command.
  7. | ERROR: Execution of '/P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/temp/run.do_deploy.1416967' failed with exit code 1
  8. ERROR: Task (/P4510/code/ma35d1/poky/../meta-nvt/meta-ma35d1/recipes-bsp/m4proj/m4proj_0.90.bb:do_deploy) failed with exit code '1'
  9. NOTE: Tasks Summary: Attempted 2118 tasks of which 2115 didn't need to be rerun and 1 failed.
复制代码


进一步查看gcc_log.txt发现有两种类型的错误,第一种找不到symbol,怀疑源码文件不全:
  1. Building target: Share_memory_sdram.elf
  2. Invoking: Cross ARM GNU C Linker
  3. arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g -T "/P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/Library/Device/Nuvoton/ma35d1_rtp/Source/GCC/gcc_arm.ld" -Xlinker --gc-sections -Wl,-Map,"Share_memory_sdram.map" --specs=nano.specs -o "Share_memory_sdram.elf" ./User/porting/mbox_whc.o ./User/porting/openamp.o ./User/porting/rsc_table.o  ./User/main.o  ./CMSIS/CMSIS/GCC/_syscalls.o ./CMSIS/CMSIS/GCC/startup_ma35d1_rtp.o  ./CMSIS/CMSIS/system_ma35d1_rtp.o   
  4. ./User/porting/mbox_whc.o: In function `Mbox_Poll':
  5. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/mbox_whc.c:57: undefined reference to `WHC_Send'
  6. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/mbox_whc.c:68: undefined reference to `WHC_Send'
  7. ./User/porting/mbox_whc.o: In function `WHC0_IRQHandler':
  8. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/mbox_whc.c:89: undefined reference to `WHC_Recv'
  9. ./User/porting/openamp.o: In function `OPENAMP_shmem_init':
  10. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:50: undefined reference to `metal_init'
  11. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:52: undefined reference to `metal_register_generic_device'
  12. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:58: undefined reference to `metal_device_open'
  13. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:65: undefined reference to `metal_io_init'
  14. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:81: undefined reference to `metal_io_init'
  15. ./User/porting/openamp.o: In function `MA35D1_OpenAMP_Init':
  16. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:107: undefined reference to `rproc_virtio_create_vdev'
  17. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:113: undefined reference to `rproc_virtio_wait_remote_ready'
  18. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:115: undefined reference to `rproc_virtio_init_vring'
  19. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:122: undefined reference to `rproc_virtio_init_vring'
  20. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:130: undefined reference to `rpmsg_virtio_init_shm_pool'
  21. ./User/porting/openamp.o: In function `OPENAMP_create_endpoint':
  22. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:151: undefined reference to `rpmsg_create_ept'
  23. ./User/porting/openamp.o: In function `OPENAMP_send_data':
  24. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/porting/openamp.c:176: undefined reference to `WHC_Send'
  25. ./User/porting/openamp.o:(.rodata+0x0): undefined reference to `metal_default_log_handler'
  26. ./User/main.o: In function `SYS_Init':
  27. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/main.c:39: undefined reference to `CLK_SetModuleClock'
  28. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/main.c:40: undefined reference to `CLK_EnableModuleClock'
  29. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/main.c:41: undefined reference to `CLK_EnableModuleClock'
  30. ./User/main.o: In function `main':
  31. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/git/SampleCode/OpenAMP/Share_Memory_SDRAM/main.c:70: undefined reference to `UART_Open'
  32. collect2: error: ld returned 1 exit status
  33. make: *** [makefile:47: Share_memory_sdram.elf] Error 1
复制代码


第二种是ld参数错误,-T ""括号为空,未设置gcc_arm.ld路径:
  1. Building target: Share_memory_demo.elf
  2. Invoking: Cross ARM GNU C Linker
  3. arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g -T "" -Xlinker --gc-sections -Wl,-Map,"Share_memory_demo.map" --specs=nano.specs -o "Share_memory_demo.elf" ./User/porting/mbox_whc.o ./User/porting/openamp.o ./User/porting/rsc_table.o  ./User/main.o  ./CMSIS/CMSIS/system_ma35d1_rtp.o   
  4. /P4510/code/ma35d1/poky/build/tmp-glibc/work/numaker_iot_ma35d16f90-poky-linux/m4proj/M4-BSP-r0/recipe-sysroot-native/usr/share/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: read in flex scanner failed
  5. collect2: error: ld returned 1 exit status
  6. make: *** [makefile:46: Share_memory_demo.elf] Error 1
复制代码




作者: MasterPhi    时间: 2024-4-17 04:46
本帖最后由 MasterPhi 于 2024-4-17 05:02 编辑

手动克隆MA35D1_RTP_BSP repo并编译出现相同错误:
  1. /home/me/tool/NuEclipse/eclipse/eclipse -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data Temp -cleanBuild all -import SampleCode/CortexM4/MPU/GCC

  2. .....

  3. Building target: MPU.elf
  4. Invoking: Cross ARM GNU C Linker
  5. arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g -T "" -Xlinker --gc-sections -Wl,-Map,"MPU.map" -o "MPU.elf" ./User/main.o  ./CMSIS/CMSIS/system_ma35d1_rtp.o
  6. /home/me/tool/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: read in flex scanner failed
  7. collect2: error: ld returned 1 exit status
  8. make: *** [makefile:45: MPU.elf] Error 1

复制代码





欢迎光临 牛卧堂MCU技术交流 (http://nuvoton-mcu.com/) Powered by Discuz! X3.2