ambiot / ambd_sdk

Release SDK for AmebaD
99 stars 53 forks source link

make flash #30

Closed RomanLuchyshyn closed 1 year ago

RomanLuchyshyn commented 1 year ago

OS Linux (Ubuntu 20)

When I run make flash it fails with next output:

make flash make -C asdk gdb make[1]: Entering directory '/home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk' cp /home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/gnu_script/acut_loader/ /home/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/gnu_script/ cp: cannot stat '/home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/gnu_script/acut_loader/': No such file or directory make[1]: *** [Makefile:311: gdb] Error 1 make[1]: Leaving directory '/home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk'

Orionxer commented 1 year ago

I encountered this problem too under Ubuntu 18.04. I have tried Ubuntu 20.04 and 22.04 but the error still exists.

S10143806H commented 1 year ago

Hi @RomanLuchyshyn and @Orionxer ,

The root cause is indicated in the log: ../project_lp/asdk/gnu_utility/gnu_script/acut_loader/*': No such file or directory, which means the folder acut_loader is currently empty for makefile to process further.

The bug has been fixed here. Please test and verify the results.

Thank you.

RomanLuchyshyn commented 1 year ago

Hi @S10143806H , Fixed in *_lp project but still exists in _hp project.

Other bug: realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/gnu_utility/prepend_ota_header.sh: line 118: ./checksum: Permission denied checksum is not executable nut must be.

S10143806H commented 1 year ago

Hi @RomanLuchyshyn, Seems like my method is not the final fix. You can temporarily apply the same change on your /hp folder.

For the permission denied error, please refer to the readme: | Please run the following command to grant the execution permission for all corresponding files: | chmod -R 777 {path}/project/realtek_amebaD_va0_example/GCC-RELEASE/

image

RomanLuchyshyn commented 1 year ago

Hi @S10143806H , Yes, I know it have fixed it. But from side proper permissions should be fixed in the repo but not by user. I have already fixed a lot of such small bugs. It's too complicated fix permissions for each build. Everything has to work from box.

RomanLuchyshyn commented 1 year ago

The next issue that I've just found is: make flash ... Load flash loader. /home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/gnu_script/rtl_gdb_flash_write.txt:27: Error in sourced command file: gnu_utility/gnu_script/target_FPGA.axf: No such file or directory.

There is SetupGDB_FPGA.sh instead of target_FPGA.axf

S10143806H commented 1 year ago

Hi @RomanLuchyshyn, I did not encounter your newly mentioned issue. image Upon cd to \lp folder and make all, the makefile direct to the \asdk folder and execute the commands below.

    make bootloader
    make copy_flashloader

Then execute make flash again, and you will find the target_FPGA.axf.

And if you are currently struggling to upload image from Linux system, you can try the methods here before our final bug fix.

S10143806H commented 1 year ago

Hi @RomanLuchyshyn, Please refer to the final bug fix in the commit: https://github.com/ambiot/ambd_sdk/commit/be744260b9230cf01eafcc741d0bd4504cf8c59e. I have added the necessary configuration files for make flash in both \lp and \hp, and verified on Windows and Linux OS. Please update again upon test and verification. Thanks.

RomanLuchyshyn commented 1 year ago

Hi @S10143806H , Thanks you very much.It seems it works. At least now make flash gives some useful output

Breakpoint 1, RtlFlashProgram () at /cygdrive/c/Work/SDKs/Git_SDKs/sdk_6.2/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/flashloader/rtl_flash_download.c:88 88 in /cygdrive/c/Work/SDKs/Git_SDKs/sdk_6.2/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/flashloader/rtl_flash_download.c dump for check

Breakpoint 2, RtlFlashProgram () at /cygdrive/c/Work/SDKs/Git_SDKs/sdk_6.2/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/flashloader/rtl_flash_download.c:120 120 in /cygdrive/c/Work/SDKs/Git_SDKs/sdk_6.2/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/flashloader/rtl_flash_download.c

And make debug also works on km0:

make debug make -C asdk debug make[1]: Entering directory '/home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk' /home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/../toolchain/linux/asdk-6.4.1/linux/newlib/bin/arm-none-eabi-gdb -x /home//ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/gnu_script/rtl_gdb_debug.txt GNU gdb (Realtek ASDK-6.4.1 Build 3026) 7.12.50.20170111-git Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-pc-linux --target=arm-none-eabi". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word". warning: No executable has been specified and target does not support determining executable automatically. Try using the "file" command. 0x000820e8 in ?? () Notification of completion for asynchronous execution commands is off. (gdb) l 200 RTC_32KAutoCalibConfig(1, RTC_32K_AUTOCAL_MINUTES); 201 } 202 //RTC_AlarmCmd(DISABLE); 203 }

S10143806H commented 1 year ago

Hi @RomanLuchyshyn, Great! I will proceed to close the issue. Thank you.