I am having some issue writing to flash memory on Arduino Uno.
I burned the optiboot bootloader that ships with the IDE 1.8.3 to the chip, then uploaded the test_dospm sketch to write content to flash memory but appears to reset the device instead.
Any idea why this might be happening?
1 Answer 1
The bootloader which ships with Arduino IDE is version 4 which was already in the Uno from factory. To use the do_spm function you need Optiboot 8 (削除) build with this support enabled. It is not enabled in the default builds, because it doesn't fit in the usual Optiboot size for Uno (削除ここまで).
The hex file of the bootloader is here. Simply replace the hex file in AVR boards package with this one.
-
I can add more details or even build and test the bootloader and provide boards.txt settings since I have this on my TODO list.2020年05月28日 12:05:26 +00:00Commented May 28, 2020 at 12:05
-
Thanks @Juraj, that would be helpful! I am currently diving in the source code/makefile to see what are the option I need to enable to build the bootloader and you were right about the do_spm not being enabled by default.Falla Coulibaly– Falla Coulibaly2020年05月28日 20:51:53 +00:00Commented May 28, 2020 at 20:51
-
@FallaCoulibaly, I discovered that do_spm is in the normal build of Optiboot8. BIGBOOT is not required. I modified the answer.2020年05月30日 17:24:38 +00:00Commented May 30, 2020 at 17:24
-
Thanks, that did the trickFalla Coulibaly– Falla Coulibaly2020年06月04日 08:58:07 +00:00Commented Jun 4, 2020 at 8:58
-
but if somebody ever needs the big version of Optiboot including my
copy_flash_pages
function, here it is github.com/jandrassy/my_boards. aboutcopy_flash_pages
: github.com/Optiboot/optiboot/pull/2692020年06月04日 09:19:07 +00:00Commented Jun 4, 2020 at 9:19