lowpowerlab / dualoptiboot Goto Github PK
View Code? Open in Web Editor NEWCustom Optiboot to add wireless programming capability to Moteino
License: GNU General Public License v3.0
Custom Optiboot to add wireless programming capability to Moteino
License: GNU General Public License v3.0
I just encountered a bug on a project that I traced to DualOptiboot.
The issue was that raw writes to the SPI pins (SK, MO, MI) were not working as expected in the main code. This only occurred on firmware reloads, not during normal power ons making it a particularly devious bug.
I think the issue is that in some situations DualOptiboot exits after loading new firmware but does not disable the SPI pins.
I fixed the problems by adding this line to my code. Perhaps you should check the codepaths and make sure this is done before the bootloader exits.
SPCR &= ~_BV(SPE);
Hi!
While troubleshooting some reset loops occurring when doing soft restarts, I noticed that WDRF is not cleared when turning off the watchdog. WDE is always set when WDRF is set causing a reset loop. Clearing it fixed my problem.
Many thanks for the great code!
void watchdogConfig(uint8_t x) {
if (x == WATCHDOG_OFF)
MCUSR &= ~(_BV(WDRF));
WDTCSR = _BV(WDCE) | _BV(WDE);
WDTCSR = x;
}
Does this support the SAMD21?
This line suggests that it doesn't, but I've read that the Moteino M0 supports OTA updating?
Thanks!
The README refers to the image size as a 4-byte value. However, it is implemented in Optiboot.c as a 2-byte value. This means that images can be no larger than 64KiB, which is smaller than the 128KiB program memory of a MoteinoMEGA. In order to support larger programs, at least one more image size byte should be added.
I burned the Dualoptiboot_v5.0_atmega328_8mhz_57600baud_BlinkD9.hex
to an Arduino pro mini (8MHz) using Sparkfun's pocket AVR programmer with AVRDude.
I changed the fuse values according to this diagram:
https://www.flickr.com/photos/15304611@N03/10585364014
Then I tried to program the board within Arduino IDE version 1.8.13, using an FTDI USB-to-Serial adaptor, with the Blink
program.
Arduino terminal gets stuck at the synchronization stage. It seems that the STK-500 emulator cannot communicate with the board.
Am I doing something wrong? Is there any solution to this problem?
Thank you very much!
The Bootloaders does not work with the 8MHz variant described here:
https://lowpowerlab.com/guide/moteino/moteino-8mhz/
Please drop a 8MHz variant of the bootloader here.
It would also be good to describe the Fuse settings in a formal way as document in github instead on various places in the forum or website.
The header bytes are described as:
"FLXIMG:9999:XXXXXXXXXXX where: ... -'9999' are 4 size bytes indicating how long the new flash image is (how many bytes to read)"
Should these four size bytes be in big or little endian format? Neither of them seem to work on my setup, so I assume that I'm doing something else wrong, but I would like to eliminate this as an issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.