-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to flash code on Micro with WSL2? #70
Comments
I wonder if their is a web based flash platform like the esp32 people have https://espressif.github.io/esptool-js/ Perhaps platformio could do it. I can build the files and in the BUILD folder I can see the files including a .hex file. Perhaps we can use windows to flash the .hex file to the coralMicro. I can't remember if the Arduino IDE flashes the .hex or .elf files. We could use a debugger. Anyone got ideas. |
I found the flashtool of coral arduino. Its located at Details
usage: flashtool.exe [-h] [--build_dir BUILD_DIR] [--elf_path ELF_PATH]
[--app APP] [--example EXAMPLE] [--subapp SUBAPP] [--ram]
[--noreset] [--serial SERIAL] [--list] [--ums]
[--usb_ip_address USB_IP_ADDRESS]
[--dns_server DNS_SERVER]
[--ethernet_config ETHERNET_CONFIG]
[--wifi_ssid WIFI_SSID] [--wifi_psk WIFI_PSK]
[--wifi_config WIFI_CONFIG] [--ethernet_speed {10,100}]
[--debug] [--jlink_path JLINK_PATH] [--cached]
[--noprogram] [--nodata]
Coral Dev Board Micro flashtool
optional arguments:
-h, --help show this help message and exit
Flashing options:
--build_dir BUILD_DIR, -b BUILD_DIR
Path to the coralmicro build output. (default:
C:\Users\caspe\AppData\Local\Temp\_MEI120522\..\build)
--elf_path ELF_PATH Path to the .stripped binary (ELF file) to flash. This
must be the full path and filename. Usually used for
out-of-tree projects only. (default: None)
--app APP, -a APP Name of the coralmicro in-tree "app" to flash. This
must be a project directory name available in
build/apps/. (default: None)
--example EXAMPLE, -e EXAMPLE
Name of the coralmicro in-tree "example" to flash.
This must be a project directory name available in
build/examples/. (default: None)
--subapp SUBAPP The target name you want to flash. This is needed only
when using --app or --example and the target name is
different than the project directory name given to
those arguments. (default: None)
--ram Flashes the app to the RAM only, instead of to flash
memory. This means the app will be overrwritten upon
reset. Without this flag, it flashes to the flash
memory and resets the board to load it. (default:
False)
--noreset Prevents resetting the board after flashing it.
(default: False)
--serial SERIAL The board serial number you want to flash. This is
necessary only if you have multiple Coral Dev Board
Micro devices connected. (default: None)
--list Prints all detected Coral Dev Board Micro devices.
(Does not flash the board.) (default: False)
--ums Puts the device in a state where it acts as an LFS
mountable USB drive.
(Does not flash the board.) (default: False)
Board network settings:
--usb_ip_address USB_IP_ADDRESS
The board IP address for Ethernet-over-USB
connections. (default: 10.10.10.1)
--dns_server DNS_SERVER
The DNS server to use for network address resolution.
By default, the board uses the DNS specified by the
DHCP server, so this should be specified if using a
static IP with --ethernet_config. (default: None)
--ethernet_config ETHERNET_CONFIG
Path to a text file that specifies Ethernet network IP
settings to use on the board (if you are not using a
DHCP server for IP assignment). The config file must
specify the board IP address, subnet mask, and
gateway, each on a separate line. For example:
ip=192.0.2.100
subnet_mask=255.255.255.0
gateway=192.0.2.1
You should also specify the DNS server with
--dns_server. (default: None)
--wifi_ssid WIFI_SSID
The Wi-Fi network that the board should log into.
Requires the Coral Wireless Add-on Board (or similar).
(default: None)
--wifi_psk WIFI_PSK The Wi-Fi password to use with --wifi_ssid. (default:
None)
--wifi_config WIFI_CONFIG
Path to a text file that specifies the Wi-Fi network
and password. This is an alternative to using the
--wifi_ssid and --wifi_psk arguments. The config file
must specify the ssid and psk on a separate line (but
only ssid is required). For example:
ssid=your-wifi-ssid
psk=your-wifi-password
(default: None)
--ethernet_speed {10,100}
The maximum ethernet speed in Mbps. Must be one of:
10, 100. Requires the Coral PoE Add-on Board (or
similar). (default: None)
Debugging options:
--debug Loads the app into RAM, starts the JLink debug server,
and attaches GDB. You must have a JTAG debugger
attached to the board, which requires an add-on board
with the JTAG pins exposed, such as the Coral Wireless
Add-on. For details, see www.coral.ai/docs/dev-board-
micro/wireless-addon/#jtag. (default: False)
--jlink_path JLINK_PATH
Path to JLink if --debug is enabled. (default:
/opt/SEGGER/JLink)
Advanced options:
--cached Flashes using cached target files, which can speed up
the flashing process. You must first run
scripts/cache_build.py. (default: False)
--noprogram Prevents flashing the program code (only data is
flashed, unless --nodata is also specified). (default:
False)
--nodata Prevents flashing the app data (only program code is
flashed, unless --noprogram is also specified).
(default: False) |
Very cool, have you managed to flash the code using the arduino IDE? I will test using the Ubuntu link from windows and also copying the code to the same folder. .... a few minutes later... First issue is the arduino build uses .elf files and the linux build uses .hex files. so i don't think this good idea is going to work. It does bring up that flashing a .hex file should not be that hard on windows. Arduino windows coralmicro Files Linux coral-micro files |
@cyborgdennett what about compiling the coralMicro on WSL but for Arduino. They both use the gcc compiler so it should be able to be done, then when using the Arduino IDE the exported files should be in the correct .elf format. |
I've hit this same issue as well last week and found a solution. Basically, at the moment you need to compile and use your own kernel for WSL2; one which supports According to WSL Issue #8302, the kernel config options
In my fully-updated WSL2 installation of Debian (on 2024-04-04) these options were not enabled; you can check that with
When you start a new WSL2 terminal now, you should see the new kernel being used:
Now follow the steps from the However, the manual approach with
|
I have this in .wslconfig: [wsl2] But when I uname -r |
Description
Hello, I have been trying to get the Micro flashed from WSL.
I have not succeeded.
I posted some comments on another issue I thought would be related to my problem, but maybe that wasn't the case fully.
See below for further explanation an what I tried to solve the issue on my own.
Current status is: the
flashtool.py
is callingthird_party/nxp/blhost
binary with the file to flash to the controller. But this program saysError: UsbHidPeripheral() cannot open USB HID device (vid=0x1fc9, pid=0x013d, sn=).
I have used
ubsipd
to forward the usb ports to WSL.Any help would be highly appreciated.
After the error, the Coral Micro is not anylonger found is
lsusb
, so I think during the flashing the usb connection stops or somethingOriginally posted by @cyborgdennett in #44 (comment)
Then it will go through this step.
next error is as follow:
Originally posted by @cyborgdennett in #44 (comment)
The -a will make the usbipd service to keep looking for the busid even after it is disonnected for a short while.
I changed line 543 of flashtool.py to: subprocess.DEVNELL->sys.stderr
to see output:
Error: UsbHidPeripheral() cannot open USB HID device (vid=0x1fc9, pid=0x013d, sn=).
checking usbipd wsl list in powershell, I get the following two addresses:
18d1:9308 Coral
1fc9:013d USB device(when connecting while holding button)
I guess the problem is that
usbipd
only can attach a single vidpid.My version of usbipd is 2.4.1, I see the latest is 3.2.0, let me update and check if that works
Edit:
just updated to 3.2.0 and same issue.
Looking at the output of usbipd I get
So as you can see, it attaches and detaches, but when the usb gets an new
vidpid
address, the tool is not made to work with that. I guess what I can do is make a ticket for the usbipd repoOriginally posted by @cyborgdennett in #44 (comment)
Click to expand!
Issue Type
Documentation Feature Request
Operating System
Windows 10
Coral Device
Dev Board Micro
Other Devices
No response
Programming Language
No response
Relevant Log Output
No response
The text was updated successfully, but these errors were encountered: