pine64 / bl_iot_sdk

BL602 SDK (Pine64 fork)
https://pine64.github.io/bl602-docs/
Apache License 2.0
134 stars 59 forks source link

[Compile error for my] #88

Closed TobeChan closed 3 years ago

TobeChan commented 3 years ago

image

i already set sdk path:

export BL60X_SDK_PATH=/home/Administrator/bl_iot_sdk-master

export CONFIG_CHIP_NAME=BL602

BL60X_SDK_PATH is my work path

but compile show "/home/rjwang/work/bl_iot_sdk.release/components"

i had check mk file,but can't find any problem.

please help my deal with this problem,thx.

best wish

TobeChan commented 3 years ago

msys2

TobeChan commented 3 years ago

use exsting version.txt file LD build_out/sdk_app_ble_sync.elf e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: E:/msys64/home/Administrator/bl_iot_sdk-master/components/bl602/bl602_wifi/lib\libbl602_wifi.a(cfg_task.o): in function dump_cfg_entries': /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_task.c:24: undefined reference to_ld_bl_static_cfg_entry_start' e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_task.c:28: undefined reference to _ld_bl_static_cfg_entry_end' e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_task.c:24: undefined reference to_ld_bl_static_cfg_entry_start' e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_task.c:27: undefined reference to _ld_bl_static_cfg_entry_end' e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: E:/msys64/home/Administrator/bl_iot_sdk-master/components/bl602/bl602_wifi/lib\libbl602_wifi.a(cfg_api.o): in functioncfg_api_element_set': /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_api.c:91: undefined reference to _ld_bl_static_cfg_entry_start' e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_api.c:91: undefined reference to_ld_bl_static_cfg_entry_end' e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_api.c:164: undefined reference to _ld_bl_static_cfg_entry_start' e:/msys64/home/administrator/bl_iot_sdk-master/toolchain/riscv/msys/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld.exe: /home/rjwang/work/bl_iot_sdk.release/components/bl602/bl602_wifi/ip/cfg/cfg_api.c:167: undefined reference to_ld_bl_static_cfg_entry_end' collect2.exe: error: ld returned 1 exit status make: *** [/home/Administrator/bl_iot_sdk-master/make_scripts_riscv/project.mk:426: /home/Administrator/bl_iot_sdk-master/customer_app/sdk_app_ble_sync/build_out/sdk_app_ble_sync.elf] Error 1

gamelaster commented 3 years ago

Hello, Firstly, try to set CONFIG_LINK_ROM=1. Then, you can try to build from official repository which is here

TobeChan commented 3 years ago

i set CONFIG_LINK_ROM:=1 in proj_config.mk, but not useful

gamelaster commented 3 years ago

Then try to build from original repository.

TobeChan commented 3 years ago

ok ,thanks!

chaseadam commented 2 years ago

I experienced the same thing when using this and upstream (linked above) as well when trying out the bl602_demo_wifi in the repo. Turns out it was linking against flash.ld instead of flash_rom.ld (which provides the references). This works fine for sdk_app_helloworld I am guessing because there are no references to these.

sdk_app_helloworld/build_out/bl602/component_project_vars.mk:COMPONENT_LDFLAGS +=  -L$(BUILD_DIR_BASE)/bl602 -L $(BL60X_SDK_PATH)/components/bl602/bl602/evb/ld -T flash.ld -lbl602
sdk_app_helloworld/build_out/bl602/component_project_vars.mk:COMPONENT_LINKER_DEPS += $(BL60X_SDK_PATH)/components/bl602/bl602/evb/ld/flash.ld

This appears to come from components/bl602/bl602/evb/evb.mk which uses the variable mentioned to determine which linker script to choose:

ifeq ($(CONFIG_LINK_ROM),1)
LINKER_SCRIPTS := flash_rom.ld
else
LINKER_SCRIPTS := flash.ld
endif

Using CONFIG_LINK_ROM=1 make allowed the build to complete successfully.

Also setting the variable in proj_config.mk was successful as well:

diff --git a/customer_app/bl602_demo_wifi/proj_config.mk b/customer_app/bl602_demo_wifi/proj_config.mk
index e1d6c6f1..21a7df82 100755
--- a/customer_app/bl602_demo_wifi/proj_config.mk
+++ b/customer_app/bl602_demo_wifi/proj_config.mk
@@ -49,3 +49,5 @@ endif

 #blog enable components format :=blog_testc cli vfs helper
 LOG_ENABLED_COMPONENTS:=blog_testc hal_drv loopset looprt bloop
+
+CONFIG_LINK_ROM:=1