Freematics ONE can't upload any sketch

Inquiry and support for Freematics products
Post Reply
OleksandrStepanov
Posts: 5
Joined: Tue Feb 27, 2018 3:17 am

Freematics ONE can't upload any sketch

Post by OleksandrStepanov »

Hello everyone,

I have Freematics V4 device, with BLE and SIM5360E on board.
I have managed to upload sketches on it some time ago. I have used default Arduino IDE, but then switched to Sloeber IDE, it's Eclipse-based IDE for Arduino development which is much more convenient.

I didn't upload on it for a while (~1 month), and there were several updates on my Mac:

I have updated to macOS High Sierra (10.13.3) from macOS Sierra(10.12.X).
I have updated Java to ver.8 build 161 from ver.8 build 151
I can't upload Sketches to the board anymore. Not sure what happened, but when I try to upload any sketch there I see next in the console (not Serial Monitor):

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/Users/xxx/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
User configuration file is "/Users/xxx/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.SLAB_USBtoUART
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
....

I have already tried to update USB driver from the latest version from https://www.silabs.com/products/develop ... cp-drivers.
Updated all boards and libraries in the Arduino itself.

I have googled, that one of possible solution would be to burn bootloader. But when I try to Burn bootloader from Arduino IDE (Tools->Burn bootloader), it fails with next:
avrdude: Error: Could not find USBtiny device (0x2341/0x49)

Any help is appreciated.
With regards.
stanley
Site Admin
Posts: 1018
Joined: Sat Mar 01, 2014 3:15 am

Re: Freematics ONE can't upload any sketch

Post by stanley »

It is likely the atmega328's bootloader is overwritten. ICSP pinouts (SCK/MISO/MOSI/RST/5V/GND) are available on PCB and you can re-flash the arduino bootloader with a USBasp.

Check PCB print here.
https://freematics.com/pages/wp-content ... 68x891.png
OleksandrStepanov
Posts: 5
Joined: Tue Feb 27, 2018 3:17 am

Re: Freematics ONE can't upload any sketch

Post by OleksandrStepanov »

Hi Stanley.

Could you suggest the proper scheme of connection USBasp with pinouts, please? I have found several in internet, but not sure which one is right. I'm sure you have done this before, so would like to check with you.

With regards.
OleksandrStepanov
Posts: 5
Joined: Tue Feb 27, 2018 3:17 am

Re: Freematics ONE can't upload any sketch

Post by OleksandrStepanov »

Hello Stanley,

Ok, I have bought USBasp, connected all six pinouts (5V, GND, SCK, MISO, MOSI, RST) and still no luck.
When I try to run next command:

./avrdude -c usbasp -p m328 -C ../etc/avrdude.conf

I get next:

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

I have already double-checked, that I have connected PINs in the right order, I mean 5V->5V, GND->GND etc.
What else could be wrong?

PS: In case it matters: when I connect the board (freematics), it's led turns on, and then blinks 3 times.
OleksandrStepanov
Posts: 5
Joined: Tue Feb 27, 2018 3:17 am

Re: Freematics ONE can't upload any sketch

Post by OleksandrStepanov »

Hi Stanley,

I have bought USBasp, connected its pinouts (SCK/MISO/MOSI/RST/5V/GND) with the respective ones on Freematics board, but when I try to burn bootloader from Arduino, I get the error message:

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

It looks like it doesn't recognise Freematcis board. I have used the scheme of pinouts on USBasp from this blog post:
http://blog.freematics.com/2014/freemat ... ing-guide/

Could you suggest, please, what could be wrong?
Could it be, because chip on my Freematics board just died due to short circuit? But will led blink in this case on connecting?

With regards.
stanley
Site Admin
Posts: 1018
Joined: Sat Mar 01, 2014 3:15 am

Re: Freematics ONE can't upload any sketch

Post by stanley »

This happens when the wiring is wrong. Be aware of MISO and MOSI should reverse on master and slave devices.
OleksandrStepanov
Posts: 5
Joined: Tue Feb 27, 2018 3:17 am

Re: Freematics ONE can't upload any sketch

Post by OleksandrStepanov »

So, finally the problem is solved.
It appears, that chip was somehow burnt, so simply dead and not responding.
Solution: changed chip, and burnt bootloader. And now it works again.
I would recommend, next avrdude command to identify burnt chip:

./avrdude -c usbasp -p atmega328p -C ../etc/avrdude.conf -B5

This command reads device signature. If it doesn't respond something like:

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)

... it is most probably dead.
stwendl
Posts: 3
Joined: Tue Jul 24, 2018 3:13 am

Re: Freematics ONE can't upload any sketch

Post by stwendl »

same here,

just received a freematics one+. Connected to my macs usb port. lights on device blink 3 times and a solid blue light stays on. MacOs does not see usb device. Tried different cables too.

Unit is not responsive, can not program.

One odd thing is the package came with a cut. Perhaps customs inspection?
stwendl
Posts: 3
Joined: Tue Jul 24, 2018 3:13 am

Re: Freematics ONE can't upload any sketch

Post by stwendl »

So it looks like the usb cables were at fault. Found one that actually made the device show up in the system profiler. However no port was created in /dev yet. Had already installed the slabs drivers
Post Reply