0

Trinket M0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0

by dsetin19 on Mon Feb 04, 2019 7:19 pm

Mu-editor saves the edited main.py file but the code doesn't execute - just a couple of simple print statements. The dot star stays on and is what looks like a multi color white and red - kind of pinkish. I have erased the device and reloaded everything (i.e., boot loader and circuit python) but nothing seems to help. The device was working fine at one point - don't know what has happened.

dsetin19
 
Posts: 12
Joined: Thu Apr 03, 2014 7:32 pm

Re: Trinket M0

by adafruit_support_carter on Mon Feb 04, 2019 7:44 pm

Can you open the serial window in Mu and see the REPL prompt?

adafruit_support_carter
 
Posts: 11064
Joined: Tue Nov 29, 2016 2:45 pm

Re: Trinket M0

by dsetin19 on Mon Feb 04, 2019 8:59 pm

Ctrl + C in Mu does not show the REPL in the serial window and the print statements also do not show in the serial window. If I make a change in Mu (e.g., add another print statement) and save the code, the changed code is saved but does not execute. I think the DotStar color is trying to say something but I don't know what it is. Here is the code

print("T0")
print("T1")
print("T2")
print("T3")
print("T4")

I know, really exciting.

I think I must have done something to mess things up because initially everything was working. BTW I did try a different USB cable with the same results.

dsetin19
 
Posts: 12
Joined: Thu Apr 03, 2014 7:32 pm

Re: Trinket M0

by dsetin19 on Tue Feb 05, 2019 12:20 pm

I think the problem has been solved.

More info:

UF2 Bootloader v2.0.0-adafruit.5 SFHWRO
Model: Trinket M0
Board-ID: SAMD21E18A-Trinket-v0

Adafruit CircuitPython 3.1.2 on 2019-01-07; Adafruit Trinket M0 with samd21e18

Modified code:

import time

while True:
print("T1")
print("T2")
print("T3")
time.sleep(2)

Device running on a Linux system with Emacs being used to modify the code. The REPL can be shown when using Putty and the code also executes. I have used Emacs to modify the code. The code also executes as advertised in Mu.

dsetin19
 
Posts: 12
Joined: Thu Apr 03, 2014 7:32 pm

Re: Trinket M0

by adafruit_support_carter on Tue Feb 05, 2019 1:02 pm

Sounds like it's working as expected now. What was the fix?

adafruit_support_carter
 
Posts: 11064
Joined: Tue Nov 29, 2016 2:45 pm

Re: Trinket M0

by dsetin19 on Tue Feb 05, 2019 6:01 pm

There is no issues with this version of the code:

while True:
print("T1")
print("T2")
print("T3")
print("T4")

However, when the code is modified as follows

print("T1")
print("T2")
print("T3")
print("T4")

and then saved, the print statements are not shown in the Serial area of the Mu editor and instead the following appears :

Adafruit CircuitPython 3.1.2 on 2019-01-07; Adafruit Trinket M0 with samd21e18
>>> 1
1
>>> AT
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'AT' is not defined
>>> AT
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'AT' is not defined
>>> AT
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'AT' is not defined
>>> ~x~~x~

and the DotStar color indicates that the REPL is running.

When the code is changed back to

while True:
print("T1")
print("T2")
print("T3")
print("T4")

and saved, the Mu editor saves the code but the DotStar color still indicates that the REPL is running and there is no output to the Serial area.

At this point, if PuTTY tries to connect to the serial port, the following error occurs:

PuTTY Fatal Error

Unable to open connection to /dev/ttyACM0:
Unable to open serial port

At this point, if CIRCUITPY is ejected, the USB is unplugged, and then plugged in again there are no issues with the code.

So it seems that, if the code only contains a series of print statements

print("T1")
print("T2")
print("T3")
print("T4")

which, I admit is unusual, the device goes into REPL mode and the USB port becomes becomes unusable.

Thanks for the replies to this post.

dsetin19
 
Posts: 12
Joined: Thu Apr 03, 2014 7:32 pm

Re: Trinket M0

by adafruit_support_carter on Wed Feb 06, 2019 12:43 pm

Looks like you have modemmanager interfering with things. See the blue info box here:
https://learn.adafruit.com/welcome-to-c ... al-console

adafruit_support_carter
 
Posts: 11064
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.