Samsung / TizenRT

TizenRT is a lightweight RTOS-based platform to support low-end IoT devices
Apache License 2.0
561 stars 560 forks source link

[do not merge]build/tools/amebasmart/image_tool: Support USB download and external … #6260

Closed jiangxiaoyunjoy closed 1 day ago

jiangxiaoyunjoy commented 1 week ago

…flash download

  1. Tested with rtl8730e->loadable_ext configuration To test USB download feature, use command "sudo ./os/dbuild.sh download port=ttyACM0 ALL"
  2. common_download.sh, board_metadata.txt, defconfig are modified to test external flash download feature, and it is for test only. Scripts for external flash will be provided by Samsung.
  3. Download time is about 14s on Linux, while it is 12s on Windows for loadable_ext configuration.
  4. Redundant log will be removed in the final version.
sunghan-chang commented 1 week ago

@r-prabu could you verify this and let us know result?

Tirtha-Samsung commented 1 week ago

Hi @jiangxiaoyunjoy , We are trying to download using USB, but it is failing. Could you please explain what are the things needed to download?

Tirtha-Samsung commented 1 week ago
test@Jammy:~/TizenRT/flash/TizenRT/os$ ./dbuild.sh download port=ttyACM0 ALL
Check Docker Image
Docker Image Version : tizenrt/tizenrt:2.0.0

 Port ttyACM0 is selected

 ############################################
 WARNINGS:
 1. Make sure the board is in DOWNLOAD MODE.
 2. Make sure NO other application like putty,
 is occupying ttyACM0.
 ############################################

================================ < Flash Partition Information > ================================
NAME       :           bl1      reserved           ftl            ss        kernel          app1          app2        kernel          app1          app2        userfs      reserved      external     bootparam
SIZE(in KB):            60            40            12           400          1844          4808           384          1844          4808           384           512          1160           120             8
Addr       :     0x8000000     0x800F000     0x8019000     0x801C000     0x8080000     0x824D000     0x86FF000     0x875F000     0x892C000     0x8DDE000     0x8E3E000     0x8EBE000     0x8FE0000     0x8FFE000
=================================================================================================

==========================
Checking flash size(PASS)
==========================
Starting Download...

==========================
Downloading bl1 binary
==========================
Save info to setting.txt

==========================
Downloading kernel binary
==========================
Save info to setting.txt

==========================
Downloading app1 binary
==========================
Save info to setting.txt

==========================
Downloading app2 binary
==========================
Save info to setting.txt

==========================
Downloading userfs binary
==========================
rtl8730e_smartfs.bin not present

==========================
Downloading external binary
==========================
Save info to setting.txt

==========================
Start USB download
Tue Jul 2 06:28:53 UTC 2024
==========================
Number of images: 5
Found ACM device         ......    OK
Open serial port         ......    OK

USB download...
Close serial port        ......    OK
Open serial port         ......    OK
error: fault during download.
Uburn DownloadFloader    ......    Fail
USB Prepare              ......    Fail
Complete USB download
Tue Jul 2 06:28:54 UTC 2024

==========================
Downloading bootparam binary
==========================
Save info to setting.txt

Download COMPLETE!
jiangxiaoyunjoy commented 1 week ago

hi @Tirtha-Samsung,

Pls try the test flow as below: Clean build and re-configure current configuration -> select rtl8730e ->select loadable_ext configuration -> build with current configuration -> exit when the build is completed enter "sudo ./os/dbuild.sh download port=ttyACM0 ALL" to download images via USB port

It seems the transmission of the flash loader was failed, could you try more times and let me know the reproduce rate?

Thank you~

jiangxiaoyunjoy commented 1 week ago
$ sudo ./dbuild.sh download port=ttyACM0 ALL
Check Docker Image
Docker Image Version : tizenrt/tizenrt:2.0.0

 Port ttyACM0 is selected

 ############################################
 WARNINGS:
 1. Make sure the board is in DOWNLOAD MODE.
 2. Make sure NO other application like putty,
 is occupying ttyACM0.
 ############################################

================================ < Flash Partition Information > ================================
NAME       :           bl1      reserved           ftl            ss        kernel          app1          app2        kernel          app1          app2        userfs      reserved     bootparam      external
SIZE(in KB):            60            40            12           400          1844          4808           384          1844          4808           384           512          1280             8           120
Addr       :     0x8000000     0x800F000     0x8019000     0x801C000     0x8080000     0x824D000     0x86FF000     0x875F000     0x892C000     0x8DDE000     0x8E3E000     0x8EBE000     0x8FFE000     0x9000000
=================================================================================================

==========================
Checking flash size(PASS)
==========================
Starting Download...

==========================
Downloading bl1 binary
==========================
Save info to setting.txt

==========================
Downloading kernel binary
==========================
Save info to setting.txt

==========================
Downloading app1 binary
==========================
Save info to setting.txt

==========================
Downloading app2 binary
==========================
Save info to setting.txt

==========================
Downloading userfs binary
==========================
rtl8730e_smartfs.bin not present

==========================
Downloading bootparam binary
==========================
Save info to setting.txt

==========================
Downloading external binary
==========================
Save info to setting.txt

==========================
Start USB download
Tue Jul 2 09:32:55 UTC 2024
==========================
Number of images: 6
Found ACM device         ......    OK
Open serial port         ......    OK

USB download...
Close serial port        ......    OK
Open serial port         ......    OK
Close serial port        ......    OK
Open serial port         ......    OK
USB Prepare              ......    OK
Flash protection         ......    OK
===================================================
km4_boot_all.bin download to 0x8000000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
kernel_rtl8730e_200204.trpk download to 0x8080000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
app1_rtl8730e_190412.trpk download to 0x824d000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
app2_rtl8730e_190412.trpk download to 0x86ff000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
bootparam.bin download to 0x8ffe000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
rtk_ext_flash_data.bin download to 0x9000000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
EVB reset                ......    OK
Close serial port        ......    OK
Complete USB download
Tue Jul 2 09:33:09 UTC 2024

Download COMPLETE!
r-prabu commented 1 week ago

hi @Tirtha-Samsung,

Pls try the test flow as below: Clean build and re-configure current configuration -> select rtl8730e ->select loadable_ext configuration -> build with current configuration -> exit when the build is completed enter "sudo ./os/dbuild.sh download port=ttyACM0 ALL" to download images via USB port

It seems the transmission of the flash loader was failed, could you try more times and let me know the reproduce rate?

Thank you~

@jiangxiaoyunjoy we are also following the same above steps, but we are facing the issue always. Not able to download even once.

gSahitya-samsung commented 6 days ago

Verified! But need to check build issue with latest public code.

tizenrt@tizenrt ~/projects/TizenRT ((HEAD detached at 29af6694b)) $ sudo ./os/dbuild.sh download port=ttyACM0 ALL
Check Docker Image
Docker Image Version : tizenrt/tizenrt:2.0.0

 Port ttyACM0 is selected

 ############################################
 WARNINGS:
 1. Make sure the board is in DOWNLOAD MODE.
 2. Make sure NO other application like putty,
 is occupying ttyACM0.
 ############################################

================================ < Flash Partition Information > ================================
NAME       :           bl1      reserved           ftl            ss        kernel          app1          app2        kernel          app1          app2        userfs      reserved      external     bootparam
SIZE(in KB):            60            40            12           400          1844          4808           384          1844          4808           384           512          1160           120             8
Addr       :     0x8000000     0x800F000     0x8019000     0x801C000     0x8080000     0x824D000     0x86FF000     0x875F000     0x892C000     0x8DDE000     0x8E3E000     0x8EBE000     0x8FE0000     0x8FFE000
=================================================================================================

==========================
Checking flash size(PASS)
==========================
Starting Download...

==========================
Downloading bl1 binary
==========================
Save info to setting.txt

==========================
Downloading kernel binary
==========================
Save info to setting.txt

==========================
Downloading app1 binary
==========================
Save info to setting.txt

==========================
Downloading app2 binary
==========================
Save info to setting.txt

==========================
Downloading userfs binary
==========================
rtl8730e_smartfs.bin not present

==========================
Downloading external binary
==========================
Save info to setting.txt

==========================
Start USB download
Wed Jul 3 06:47:16 UTC 2024
==========================
Number of images: 5
Found ACM device         ......    OK
Open serial port         ......    OK

USB download...
Close serial port        ......    OK
Open serial port         ......    OK
Close serial port        ......    OK
Open serial port         ......    OK
USB Prepare              ......    OK
Flash protection         ......    OK
===================================================
km4_boot_all.bin download to 0x8000000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
kernel_rtl8730e_200204.trpk download to 0x8080000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
app1_rtl8730e_190412.trpk download to 0x824d000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
app2_rtl8730e_190412.trpk download to 0x86ff000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
===================================================
rtk_ext_flash_data.bin download to 0x8fe0000
===================================================
USB erase                ......    OK
USB download             ......    OK
USB checksum             ......    OK
Image download           ......    OK
EVB reset                ......    OK
Close serial port        ......    OK
Complete USB download
Wed Jul 3 06:47:31 UTC 2024

==========================
Downloading bootparam binary
==========================
Save info to setting.txt
sunghan-chang commented 1 day ago

@jiangxiaoyunjoy This was merged by PR #6220 . Let's close this.