Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can’t flash Arduino on WSL2: No device found on ttyACM0 #207

Open
mferuscomelo opened this issue Jan 27, 2023 · 0 comments
Open

Can’t flash Arduino on WSL2: No device found on ttyACM0 #207

mferuscomelo opened this issue Jan 27, 2023 · 0 comments

Comments

@mferuscomelo
Copy link

Hello everyone,

I'd like to upload an Arduino script to my MKR WiFi 1010, but run into the error "No device found on ttyACM0." I'm running VS Code in WSL2 and can view the port under PIO Home > Devices. PIO's serial monitor also works on the port without issue, which I tested after uploading code to my board using the Arduino IDE.

Here's my trace for the verbose upload:

 *  Executing task: platformio run --verbose --target upload --environment mkrwifi1010 

pyenv shell 3.9.5
Processing mkrwifi1010 (platform: atmelsam; board: mkrwifi1010; framework: arduino; monitor_speed: 9600; lib_deps: arduino-libraries/ArduinoMqttClient@^0.1.6, arduino-libraries/WiFiNINA@^1.8.13)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/mkrwifi1010.html
PLATFORM: Atmel SAM (8.1.0) > Arduino MKR WiFi 1010
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink)
PACKAGES: 
 - framework-arduino-samd @ 1.8.13 
 - framework-cmsis @ 1.40500.0 (4.5.0) 
 - framework-cmsis-atmel @ 1.2.2 
 - tool-bossac @ 1.10700.190624 (1.7.0) 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoMqttClient @ 0.1.6 (License: Unknown, Path: /home/mferuscomelo/Programming/smart_home_mkr1010/.pio/libdeps/mkrwifi1010/ArduinoMqttClient)
|-- WiFiNINA @ 1.8.13 (License: Unknown, Path: /home/mferuscomelo/Programming/smart_home_mkr1010/.pio/libdeps/mkrwifi1010/WiFiNINA)
|   |-- SPI @ 1.0 (License: Unknown, Path: /home/mferuscomelo/.platformio/packages/framework-arduino-samd/libraries/SPI)
Building in release mode
MethodWrapper(["checkprogsize"], [".pio/build/mkrwifi1010/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  11.7% (used 3824 bytes from 32768 bytes)
Flash: [=         ]  15.0% (used 39228 bytes from 262144 bytes)
.pio/build/mkrwifi1010/firmware.elf  :
section            size        addr
.text             38684        8192
.data               544   536870912
.bss               3280   536871456
.ARM.attributes      40           0
.comment            126           0
.debug_frame       3088           0
.stabstr            441           0
Total             46203
<lambda>(["upload"], [".pio/build/mkrwifi1010/firmware.bin"])
AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
BeforeUpload(["upload"], [".pio/build/mkrwifi1010/firmware.bin"])
Auto-detected: /dev/ttyACM0
Forcing reset using 1200bps open/close on port /dev/ttyACM0
Waiting for the new upload port...
bossac --info --debug --port "ttyACM0" --write --verify --reset --erase -U true .pio/build/mkrwifi1010/firmware.bin
No device found on ttyACM0
Set binary mode
Send auto-baud
Set binary mode
*** [upload] Error 1
================================================================================================================================= [FAILED] Took 70.63 seconds =================================================================================================================================

 *  The terminal process "platformio 'run', '--verbose', '--target', 'upload', '--environment', 'mkrwifi1010'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

To be able to develop in WSL, I need to execute the following command in an elevated command prompt: usbipd wsl attach --busid 1-1, which then allows WSL to view the port. Once done, I execute sudo chmod 666 /dev/ttyACM0 on WSL.

Running stty -F /dev/ttyACM0 -a gives me the following output:

speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 0; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc

What could be preventing the code from being uploaded to the Arduino? Please let me know if you need any more information.

Thanks in advance!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant