Unable to upload any Sketch to the things node (TTN-002-868-1.0)

I have recently purchased the things node (TTN-002-868-1.0). I managed to install Arduino IDE, libraries and the Sparkfun Pro Micro board. Processor set to ATmega32U4, 3,3V.

I have connected the device to my computer. Windows 10 has recognized the device. Drivers are available. However when retrieving board info through Arduino - “Get Board info”. I got unknown board, SN: Upload any sketch to obtain it.
So I uploaded an empty sketch. When uploading any sketch, empty or one of the example sketches I got this (See below), resulting in a bricked device. I am able to set the device back into bootmode and reconnect to my computer, however all sketches i’m trying to upload give the same results.
I’m able to erase the chip through avrdude. (avrdude -patmega32u4 -cavr109 -PCOM4 -b57600 -e -C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf")
After erasing the chip i can connect and upload again, but after uploading any new sketch I’m having the same issues.

I have used different computers (Mac and PC) and different USB cables.

I’m out of options. Your advise is highly appreciated.

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

     Using Port                    : COM4
     Using Programmer              : avr109
     Overriding Baud Rate          : 57600
     AVR Part                      : ATmega32U4
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
       flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : butterfly
     Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = “CATERIN”; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: reading input file “C:\Users\pascal\AppData\Local\Temp\arduino_build_685288/sketch_jun20a.ino.hex”
avrdude: writing flash (3618 bytes):

Writing | ################################################## | 100% 0.30s

avrdude: 3618 bytes of flash written
avrdude: verifying flash memory against C:\Users\pascal\AppData\Local\Temp\arduino_build_685288/sketch_jun20a.ino.hex:
avrdude: load data flash data from input file C:\Users\pascal\AppData\Local\Temp\arduino_build_685288/sketch_jun20a.ino.hex:
avrdude: input file C:\Users\pascal\AppData\Local\Temp\arduino_build_685288/sketch_jun20a.ino.hex contains 3618 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x003a
0xf9 != 0xb9
avrdude: verification error; content mismatch

Hi,

did you install the library in the arduino IDE ?

52%20AM

Hi,

yes, libraries and boards are installed.

image
image
image

You should see your device now on a port when connected (yours seems blanked out ?)

load the device info sketch from examples.
set the right FP

50%20PM

check compile (just to see if everything ok)

50%20PM

upload sketch
IF you see this

44%20PM

that means your computer lost the (virtual) port … try again but this time hold reset button (from the node - take it out of the enclosure)

x963

press and release when you see computer starts searching again for port.

when upload finishes check port - still connected ?
ok then start arduino IDE monitor and you should see this

node2

note the AppEUI and the DevEUI … you’ll need them later to register the device in the TTN console

x1434
I had one on my desk :wink:

After unbricking the device, it will show up in Arduino IDE on COM4

image

Get board info: image

Opened Example:
![image|613x500]((upload://y6HsUspeV0wVz2bwmab0Q9CrPDS.txt) (15.9 KB) Cg8T5AdSWQn.png)

Changed freqPlan and Compiled
image

Uploaded:
Error. avrdude: verification error, first mismatch at byte 0x002a
0x77 != 0x37

Device is bricked again.

See Log file Arduino log.txt (15.9 KB)

Forcing reset using 1200bps open/close on port COM4
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}

that’s your main problem… so go for the ‘reset’ trick as mentioned before
this is a ‘feature’ of a virtual com port

  • get board info giving ‘unknown board’ is normal

Sorry I’m new to this, but with the reset trick, you mean pushing the reset button during the search for ports? I did, but the result is exactly the same.

Forcing reset using 1200bps open/close on port COM4
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {COM4, } => {COM4, }
Found upload port: COM4

1 Like

After uploading, the connection between device and Arduino IDE is lost. Device is bricked. The only way to unbrick is through commandline: avrdude -patmega32u4 -cavr109 -PCOM4 -b57600 -e -C"C:\Users\pascal\AppData\Local\Arduino15\packages\SparkFun\hardware\avr\1.1.12\avrdude.conf"

if its lost after the device info sketch upload… select again the port and then start monitor
If that all doesn’t work, send your device back DOA

Can’t select the port anymore after upload. Windows doesn’t recognize the device anymore. Only after erasing the chip, the device can be connected again.

you can try plug it out/in and then see if it can find the virtual port and if so, start the monitor.

that was my last idea… :sunglasses:

Nope… disconnected and connected again. Windows does not show COM port anymore.

So I propably should return the device to reseller?

yes… I think So too unfortunately, or contact someone with some experience with Arduino’s and TTN and let him check the device… what you think is best solution.

Ok, thank you for your help!

your welcome

These symptoms occur if you select the wrong device/oscillator combination. Have you checked the documentation on which device to select?

:thinking:

Hi,

Yes I have checked the documentation: https://www.thethingsnetwork.org/docs/devices/node/
It states: SparkFun Pro Micro - 3.3V/8Mhz](https://www.sparkfun.com/products/12587
Processor: ATmega32U4 (3.3V, 8Mhz). To be sure, i have taken a photo of the chip.

20190619_154047