Adafruit Trinket M0: west flash > How to? #flash #west


@yasokada
 
Edited

My environment:
Ubuntu 18.04 LTS
board: Adafruit Trinket M0
RTOS: Zephyr 2.1.0-rc1

I was trying to use Adafruit Trinket M0.

### connections

https://docs.zephyrproject.org/latest/boards/arm/adafruit_trinket_m0/doc/index.html

> Flash
> ...
> 2. Connect the Trinket M0 to your host computer using USB
> 3. 
Connect a 3.3 V USB to serial adapter to the board and to the host. See the Serial Port section above for the board’s pin connections.

With the above step 2, the device is '/dev/ttyACM0'.
With the above step 3, the device may depends on the used "USB to serial adapter". For example, I use some FTDI adapter, which becomes '/dev/ttyUSB0'.

When I try "west flash", the Zephyr will use "/dev/ttyACM0'. 
This is defined at 'scripts/west_commands/runners/bossac.py' as 
DEFAULT_BOSSAC_PORT = '/dev/ttyACM0'.

So, my understanding is that :

> 2. Connect the Trinket M0 to your host computer using USB
is for west flash.

> 3. Connect a 3.3 V USB to serial adapter to the board and to the host. See the Serial Port section above for the board’s pin connections.
is not clear what to use.

With these information, I thought I can flash by using USB connected at the above step 2.

### west flash

I tried to west flash for Trinket M0.

1. connect USB to Trinket M0
2. sudo chmod +777 /dev/ttyACM0 (to add permission to write flash)
3. west flash

I have following error. What is wrong?

```
$ west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner bossac
bossac: invalid option -- 'o'
Try 'bossac -h' or 'bossac --help' for more information
```

Q1. I do not understand why step 3 is necessary.
Q2. If the step 3 is used for west flash, how can I change /dev/ttyACM0 to /dev/ttyUSB0 for west flash?
Q3. If step 3 is not relevant to west flash, what is wrong with the above procedure?


Join users@lists.zephyrproject.org to automatically receive all group messages.