ImageTool for Linux

Hello All,

Have been away from AmebaIOT for some time now. Very rusty.
Is there such a thing as ImageTool for Linux. Example: I want to build the example ‘wlan_repeater’ in the ambd_sdk into an image. In the past i always had to get a Windows machine laying beside Linux machine & use the ImageTool for Windows . Don’t want to have to switch back and forth between Linux and Windows. Hope this makes sense. I am probably completely missing something here.

Thanks

1 Like

Hi @brcisna , welcome back :slight_smile:

Short answer: Yes. This has been made available and public since the Ameba Arduino SDK starts. You can download this tool at

Note that this is a command line tool that require a few parameters, as a reference, check out this line to see what the parameters it need,

@xidameng , Thank You Kindly.

I was missing the ambd_arduino repo. I was looking through the ambd_sdk which i had downloaded. I need to reread the documentaion better.

1 Like

@xidameng

I read the #140 line in the reply you gave. I am at a loss on how to enter the command line parameters for the ‘upload_image_tool_linux’.
After i compile the firmware image how would i do the command to upload the three images to the BW16 module if it is residing at /dev/ttyUSB0
and to upload the three files -

  • km0_boot_all.bin
  • km4_boot_all.bin
  • km0_km4_image2.bin

In the past i always used the Windows upload tool,but am wanting to get away from having to go back and forth between Linux and Windows ,to Linux only!
I could not see any reference to this in the AN0400 pdf

Thank You again

format:
upload_image_tool_windows.exe "{runtime.tools.ameba_d_tools.path}" "{serial.port}" "{board}" "{build.auto_upload_mode}" "{build.erase_flash}" "1500000" {upload.verbose}

usage example:
upload_image_tool_windows.exe C:\Users\username\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\1.0.8 COM3 ameba_rtl8721d Disable Disable

Choose the image tool corresponding for your OS

1 Like

Hi @brcisna

Please refer to wyy 's reply

Alternatively, you may just compile and upload any sketch on Arduino IDE to your Ameba board, and copy down the log printed on IDE console to see what the real parameters are.

For example, on my case with BW16 board, my log looks like this,

C:\Users\{USERNAME}\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\1.0.8/upload_image_tool_windows.exe C:\Users\{USERNAME}\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\1.0.8 COM4 ameba_rtl8720dn_bw16 Enable Disable 

@xidameng

I am still at a loss on how to use the parameters. Everything you are explaining is Windows centric. I found the path as you mentioned in the Arduino IDe for my enviorment. BUT this doesn’t really do any good in regards to doing the erase or flash for the BW16 board.
Repeating,I am wanting to use souly Linux. Debian Bullseye (11)
Paste of commands and fails:

brcisna@server2:~/MyPrograms/ambd_arduino/ambd_arduino/Arduino_package/ameba_d_tools_linux$ ./upload_image_tool_linux /dev/ttyUSB3
terminate called after throwing an instance of ‘std::invalid_argument’
what(): stoi
Aborted
brcisna@server2:~/MyPrograms/ambd_arduino/ambd_arduino/Arduino_package/ameba_d_tools_linux$ ./upload_image_tool_linux /dev/ttyUSB3
terminate called after throwing an instance of ‘std::invalid_argument’
what(): stoi
Aborted
brcisna@server2:~/MyPrograms/ambd_arduino/ambd_arduino/Arduino_package/ameba_d_tools_linux$ ./upload_image_tool_linux erase /dev/ttyUSB3
terminate called after throwing an instance of ‘std::invalid_argument’
what(): stoi
Aborted
brcisna@server2:~/MyPrograms/ambd_arduino/ambd_arduino/Arduino_package/ameba_d_tools_linux$ ./upload_image_tool_linux erase /dev/ttyUSB3 ameba_rtl8720dn_bw16
terminate called after throwing an instance of ‘std::invalid_argument’
what(): stoi

Has anyone ever considered working up a gui for both Linux and MacOS upload tools?

Thanks again

The linux and windows version of the image tool is compiled from the same source and accepts the same arguments.

You will need to provide these 5 arguments to the image tool in the following order:

  • directory containing the 3 binaries (km0_boot_all.bin, km4_boot_all.bin, km0_km4_image2.bin) to upload and the flashloader binary (imgtool_flashloader_amebad.bin)
  • serial port of connected board
  • board name of connected board (ameba_rtl8720dn_bw16)
  • auto upload option, not supported on older boards (Enable / Disable)
  • flash erase option (Enable / Disable)

This tool is written specifically for use by the Arduino IDE upload process, hence a GUI for it is of low priority