Hello, I'm new on this forum, so forgive me for any kind of mistakes.
I have strange issue with my Moteino board. I ordered 10 pcs of 5V version. Then I decided to change fuses from external oscillator to internal 8MHz and power it with 3.3V for battery save. Every single device has only additional SPI FLASH memory included. There are no RFM modules.
For flashing optibootloader and fuses I used Visual Studio Code with Platformio extension. There is nothing special, Platformio just makes avrdude calls easier. So I created configuration for 3.3V:
[env:moteino8mhz]
platform = atmelavr
board = moteino8mhz
framework = arduino
upload_speed = 57600
[env:moteino8mhz_fuses_usbasp]
platform = atmelavr
board = moteino8mhz
framework = arduino
upload_protocol = usbasp
upload_port = /dev/ttyUSB1
board_fuses.lfuse = 0xD2
board_fuses.hfuse = 0xDC
board_fuses.efuse = 0xFE
board_bootloader.file = bootloader/Dualoptiboot_v5.0_atmega328_8mhz_57600baud_BlinkD9.hex
board_bootloader.lfuse = 0xD2
board_bootloader.hfuse = 0xDC
board_bootloader.efuse = 0xFE
Bootloader was flashed by USBasp (SPI connection) with success. Then I tried to flash simple blink D9 app by FTDI FT232 adapter with 3.3V jumper activated:
- VCC 3.3V(ftdi) -> 3.3V pin (moteino) - I tested also 5V (ftdi) -> Vin (moteino ftdi pins)
- GND (ftdi) -> GND (moteino)
- RX (ftdi) -> TX (moteino)
- TX (ftdi) -> RX (moteino)
- DTR (ftdi) -> DTR (moteino)
Then I got following errors:
Processing moteino8mhz (platform: atmelavr; board: moteino8mhz; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/moteino8mhz.html
PLATFORM: Atmel AVR (3.2.0) > LowPowerLab Moteino (8Mhz)
HARDWARE: ATMEGA328P 8MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr 5.1.0
- tool-avrdude 1.60300.200527 (6.3.0)
- toolchain-atmelavr 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/moteino8mhz/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 0.4% (used 9 bytes from 2048 bytes)
Flash: [ ] 2.9% (used 936 bytes from 32256 bytes)
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: /dev/ttyUSB1
Uploading .pio/build/moteino8mhz/firmware.hex
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x94
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x80
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x94
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x90
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x94
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x90
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x94
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x90
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x94
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x80
avrdude done. Thank you.
The wirdest thing is that 6/10 of received modules was flashed successfully. 4 of them failed with above issue.
Then I decided to revert optiboot to original version and try to flash the same firmware with following configuration:
[env:moteino]
platform = atmelavr
board = moteino
framework = arduino
[env:moteino_fuses_usbasp]
platform = atmelavr
board = moteino
framework = arduino
upload_protocol = usbasp
upload_port = /dev/ttyUSB1
board_fuses.lfuse = 0xDE
board_fuses.hfuse = 0xDC
board_fuses.efuse = 0xFD
board_bootloader.file = bootloader/DualOptiboot_V5.0_atmega328_BlinkD9.hex
board_bootloader.lfuse = 0xDE
board_bootloader.hfuse = 0xDC
board_bootloader.efuse = 0xFD
And surprisingly it was possible to flash blinking app. When I switched to first (3.3V bootloader and fuses) I had the same issue again.
I tried two different FTDI boards with the same, faulty results. So I guess these 4 Moteino has some on-board issues (maybe soldering issue).
So I have question for more experienced users. What can I check on these 4 boards to fix this issue?
Best regards!