platformio / platform-freescalekinetis

Freescale Kinetis: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/freescalekinetis
Apache License 2.0
4 stars 8 forks source link

** [upload] /dev/ttyACM0/firmware.bin: Not a directory #5

Closed khoa-io closed 5 years ago

khoa-io commented 7 years ago

Hi all. I'm trying to run an example on a Freescale board. Building is OK but I can't upload file to the board. Here is my upload command and its output:

pio run --target upload --upload-port /dev/ttyACM0 -v
[Thu Aug 17 20:47:00 2017] Processing frdm_kl46z (platform: freescalekinetis; upload_port: /dev/ttyACM0; board: frdm_kl46z; framework: mbed)
---------------------------------------------------------------------------------------------------------
Collected 22 compatible libraries
Looking for dependencies...
Project does not have dependencies
MethodWrapper(["upload"], [".pioenvs/frdm_kl46z/firmware.bin"])
Use manually specified: /dev/ttyACM0
MethodWrapper(["upload"], [".pioenvs/frdm_kl46z/firmware.bin"])
*** [upload] /dev/ttyACM0/firmware.bin: Not a directory
======================================= [ERROR] Took 1.32 seconds =======================================

I searched a lot on Google but there's no information can help me. So I create an issue here. Thank you!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/48364464-upload-dev-ttyacm0-firmware-bin-not-a-directory?utm_campaign=plugin&utm_content=tracker%2F38212797&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38212797&utm_medium=issues&utm_source=github).
ivankravets commented 7 years ago

this board should have media disk. Upload port should be a path to it.

khoa-io commented 7 years ago

I don't think this board have one. This is output of ls -la /dev/ttyACM0:

crw-rw----. 1 root dialout 166, 0 Aug 17  2017 /dev/ttyACM0

It's a character device! p/s: Link from board: freescale.com/FRDM-KL46Z.

khoa-io commented 7 years ago

If I don't specify --upload-port /dev/ttyACM0 then following error happens:

Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [upload] Explicit exit, status 1

I'm using Fedora and I looked in /run/media/<user> but it's empty!

MarcelRobitaille commented 6 years ago

For anyone else having this issue, I had to mount the drive in order to flash it. Check in something like gnome-disks if you have a drive show up and mount it. Platformio should find it when you try to upload agian.

ivankravets commented 5 years ago

@Iambecomeroot thanks for the solution!