TinyCircuits Forum

TinyCircuits Products => TinyDuino Processors & TinyShields => Topic started by: dnl on April 26, 2022, 10:09:38 PM

Title: Have to use reset button every time for TinyZero USB device to appear
Post by: dnl on April 26, 2022, 10:09:38 PM
I was working with a TinyZero processor and all was well. Could reliably turn the device on and off and the USB device, 03eb:8008, would always show up and be recognized as /dev/ttyACM0. I could also repeatedly compile and install a program. This worked with or without your 150mAh battery attached.

Here's the relevant USB device data from usb-devices(1):
Code: [Select]
T:  Bus=01 Lev=02 Prnt=02 Port=05 Cnt=04 Dev#= 14 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=03eb ProdID=8008 Rev=01.10
C:  #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=0mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=00 Driver=cdc_acm
I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

At some point, this stopped. The USB device now appears if and only if I use the reset button. It will remain present as long as I don't turn the TinyZero off. It will also remain present until the program installation is complete. Once I turn it off, or install a program, the USB device is no longer present.

The program that I installed does work regardless of the state of the USB device. I've been using your TinyScreenBasicButton program to try to debug this problem.

I've done this on multiple Linux hosts using different OS versions. Both worked hosts earlier, and now both behaves identically. That is, this is NOT a host issue.

This happens with or without your 150mAh battery attached

It appears the initialization sequence without the reset sequence is  corrupted so that the USB device doesn't initialize even though the installed program does work.
Is there some deeper reset I can do?
Is there a way to flash the bootloader again?

Please advise?
Title: Re: Have to use reset button every time for TinyZero USB device to appear
Post by: dnl on May 01, 2022, 01:16:44 AM
PEBKAC

I had a stray unit test program file in the directory that contained a main program.  :(

Removing the file and rebuilding the program allowed the USB device to appear.
Title: Re: Have to use reset button every time for TinyZero USB device to appear
Post by: lennevia on May 02, 2022, 02:49:57 PM
I just saw your email and thought I had recently read about a similar problem (and forgot to respond to it immediately of course, sorry about that). Glad you were able to find the issue!

Cheers,
RĂ©na