pine64 / bl_iot_sdk

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

Linker script (flash_build.py) not working if project folder is placed outside of SDK. #90

Closed piratepanda47 closed 3 years ago

piratepanda47 commented 3 years ago

If an example app is placed outside of default SDK location then linker script fails. It looks like the absolute paths are being used in script and it fails to locate the "eflash_loader_cfg.ini" file. (The SDK and CHIP environment variables are set)

Log error is mentioned below.

CC build_out/yloop/src/device.o CC build_out/yloop/src/local_event.o AR build_out/yloop/libyloop.a LD build_out/sdk_app_cli.elf Generating BIN File to /home/username/workspace/sdk_app_cli/build_out/sdk_app_cli.bin Requirement already satisfied: fdt>=0.2.0 in /home/username/.local/lib/python3.8/site-packages (from -r /home/username/apps/bl_iot_sdk/image_conf/requirements.txt (line 2)) (0.3.0) Requirement already satisfied: pycryptodomex>=3.9.8 in /home/username/.local/lib/python3.8/site-packages (from -r /home/username/apps/bl_iot_sdk/image_conf/requirements.txt (line 3)) (3.10.1) Requirement already satisfied: toml>=0.10.2 in /home/username/.local/lib/python3.8/site-packages (from -r /home/username/apps/bl_iot_sdk/image_conf/requirements.txt (line 4)) (0.10.2) Requirement already satisfied: configobj>=5.0.6 in /home/username/.local/lib/python3.8/site-packages (from -r /home/username/apps/bl_iot_sdk/image_conf/requirements.txt (line 5)) (5.0.6) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from configobj>=5.0.6->-r /home/username/apps/bl_iot_sdk/image_conf/requirements.txt (line 5)) (1.14.0) Traceback (most recent call last): File "flash_build.py", line 1397, in shutil.copy(eflash_loader_cfg_org, eflash_loader_cfg) File "/usr/lib/python3.8/shutil.py", line 415, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.8/shutil.py", line 261, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: '/home/username/apps/bl_iot_sdk/customer_app/sdk_app_cli/build_out/eflash_loader_cfg.ini' make: *** [/home/username/apps/bl_iot_sdk//make_scripts_riscv/project.mk:195: all] Error 1

Snippet "Flash_build.py": line number 1389

if name == 'main': abs_path = os.path.abspath('..') app_path = os.path.join(abs_path, "customer_app", sys.argv[1]) demo_name = sys.argv[1] chip_name = sys.argv[2].lower()

adrienluitot commented 3 years ago

Hello, normally the bin should still be compiled and flashable. Though I made PR to fix this: #87, I'm just waiting for gamelaster to reviews it and merges it, if everything is fine of course. If you want to test it, I think you can pull my code or directly edit the sdk.

piratepanda47 commented 3 years ago

Hello, normally the bin should still be compiled and flashable. Though I made PR to fix this: #87, I'm just waiting for gamelaster to reviews it and merges it, if everything is fine of course. If you want to test it, I think you can pull my code or directly edit the sdk.

Thanks. I will test it over the weekend.

piratepanda47 commented 3 years ago

Hello, normally the bin should still be compiled and flashable. Though I made PR to fix this: #87, I'm just waiting for gamelaster to reviews it and merges it, if everything is fine of course. If you want to test it, I think you can pull my code or directly edit the sdk.

I tested the code changes and it is working. Thanks.