1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

25 Commits

Author SHA1 Message Date
David Gauchard
ef7c26ac42 hotfix: 2.7.2=>2.7.3 eboot: disable "Verify the copy" 2020-07-18 23:12:22 +02:00
Mike Nix
51daecc236
Xmc flash 2 (#7317)
* Remove unnecessary XMC support from eboot

eboot is always run with the flash access speed set to 20MHz, so
there is no need for special treatment of XMC chips.

* After eboot copies the new firmware into place, verify the copy.

If the data written to flash is as expected, the line cmp:0 will be displayed
after the usual @cp:0 from eboot.

* Disable interrupts during the precached part of _SPICommand()

For some reason this was an issue during the reboot after an OTA update.
2020-05-26 20:04:49 -04:00
david gauchard
ea879b6ef6
XMC in eboot: hotfix: disabling (#7277) 2020-05-07 15:32:16 +02:00
Mike Nix
9b41d9ac5e
XMC flash support - WIP (#6725)
* Move the spi vendor list from Esp.h to its own header in eboot.

* Fix ifdef issue with spi_vendors.h

* Add initFlashQuirks() for any chip specific flash initialization.

Called from user_init().

* namespace experimental for initFlashQuirks()

* Slow down flash access during eboot firmware copy

Part 1 - still some work to do

* Slow down flash access during eboot firmware copy on XMC chips

Part 2 - Identify the chip type.

Note: there may still be issues with the access speed change.
This is very much experimental.

* Commit eboot.elf

Co-authored-by: Develo <deveyes@gmail.com>
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-04-23 12:15:21 -04:00
M Hightower
fe7faf701e Added dependencies for eboot.ld and Makefile to Makefile.
Updated eboot.ld to not fill with zeros through the CS field
on its way to the CRC.
Added size test to elf2bin.py
2020-01-29 13:26:58 -08:00
Earle F. Philhower, III
52d84b1ead
Add a CRC32 over progmem and ESP.checkFlashCRC (#6566)
* Add a CRC32 over progmem and ESP.checkFlashCRC

Automatically embed a CRC32 of the program memory (including bootloader
but excluding any filesystems) in all images in unused space in the
bootloader block.

Add a call, ESP.checkFlashCRC() which returns false if the calculated
CRC doesn't match the one stored in the image (i.e. flash corruption).

Fixes #4165

* Add example that corrupts itself, comments

Show CRC checking catch a 1-bit error in program code by corrupting a
large array, and then return it to clean and verify the CRC matches once
again.

Add comments to the CRC check routine

Clean up pylint complaints on crc32bin.py

* Check linker script for CRC space in bootsector

Add an assertion in the eboot linker file to guarantee that we have at
least 8 bytes of unused space at the end of the boot sector to patch in
the CRC.  If not, the eboot link will fail.

* Add note about what to do if CRC check fails

Per discussion with @d-a-v.

When the CRC check fails, you could *try* to do certain things (but may
not succeed since there is known flash corruption at that point).  List
a few ideas for application authors.

* Only single, flash/ram friendly crc32() function

* Combine the CRC calc and bin generation in 1 step

Per discussion w/@mcspr, combine the CRC calculation with the binary
generation, removing the additional build step.
2019-12-20 14:38:35 -08:00
Earle F. Philhower, III
9985a32914
Add documentation for compressed OTA, fix bug (#6924)
* Add documentation for compressed OTA, fix bug

Fixes #6923

Documents the user steps needed to do a compressed upload, and notes the
2-step process needed for deploying compressed uploads to the field for
the first time.

Fixes a bug in serial output formatting discovered by @AdrianEddy.

Adds additional contributors for uzlib, per @pfalcon.

* Update README for esptool.py, too
2019-12-20 09:22:10 -08:00
Earle F. Philhower, III
1d0bc5efdf
Allow GZIP compressed flash updates (#6820)
* Allow GZIP compressed flash updates

Modified the bootloader to be able to take stored updates in compressed
GZIP format (i.e. the output of "gzip -9 xxx.bin") and decompress them
on-the-fly to their final destination.  This can work for apps and for
filesystems (when used with the 2-step update option).

Allow eboot to be built using -Os/2 optimizations by fixing some portions
which failed when any optimizations were used.  Add -Wall and use data
and function sections to reduce size.  Use -Os to minimize size.

Remove obsolete esptool-ck calls to build a .ROM image, we don't use it.

Move all uninitted variables to RAM from IRAM, allowing 8-bit access.

Hook in @d-a-v and @pfalcon's uzlib port to actually do the
decompression.  Do not use any CRC checking which saves space.  Since we
have overwritten all of flash by the time we know id the CRC matches,
there's nothing we could have done anyway.

Adjust the Updater class to support GZIP files and not attempt to patch
them.

Bootloader builds to 0xd90 out of 0xfff bytes.

* Add @d-a-v's patch for httpupdate

https://github.com/esp8266/Arduino/pull/6820#pullrequestreview-326541014

* Update uzlib to point to pfalcon++

For now, because there are some self-test failures with @d-a-v's esp8266
branch (whose cool new features we don't actually use in eboot now)
start with pfalcon's 2.9 release and add the 2 patches (clcidx to code
from IRAM/RODATA, and the Windows test file renaming) needed to build
and run successfully.

* Add (c) notice for uzlib to README
2019-12-18 09:17:38 -08:00
Earle F. Philhower, III
1189417d9f
Rebuild eboot.elf to include #6823 changes (#6890)
Just ran a "make" in the bootloaders/eboot dir to regenerate the
eboot.elf file we use to link binaries with.

Fixes #6863
2019-12-08 13:07:51 -07:00
Mike Nix
5b500e4e34 Move eboot_command_clear to after firmware copy. (#6823)
The eboot command was cleared from the rtc mem before the firmware copy
making it possible for a power failure during an OTA update to brick the
esp until the firmware was loaded via USB because of a partial firmware
copy that would never be restarted.

Moving the eboot_command_clear to after the copy ensures that any partial
copy is restarted at next power on.
2019-11-21 22:37:12 -03:00
Develo
3d70f43277
cleanup/unify flash sector size define value (#5327)
* cleanup/unify sector size define value

* replicate spi_flash_sec_size.h file for host tests

* further flash geometry cleanup, remove host test duplicate file
2018-11-24 02:59:12 -03:00
Ivan Grokhotkov
32bd42b028 Store git version of the core in the compiled binary (#2099)
* Store git version of the core in the compiled binary

* Don't update version number when using boards manager package
2016-06-06 14:37:39 +08:00
Ivan Grokhotkov
8a3386bfbf Bootloader: don't touch RTC memory if it doesn't contain a valid command (#619) 2016-03-28 00:24:27 +03:00
Ivan Grokhotkov
91ca9ba75b Make sure WDT is re-enabled in eboot even in case of error (#517) 2015-07-23 16:39:56 +03:00
Ivan Grokhotkov
481cee6460 Disable WDT in eboot while copying new sketch (#517) 2015-07-23 16:34:11 +03:00
John Doe
b605ab316e add synchronous ota 2015-07-10 22:21:48 +03:00
Ivan Grokhotkov
5763dbba3b Code review 2015-07-06 21:04:08 +03:00
John Doe
f3f500936d make eboot erase/read/write sector by sector
that makes possible having sketches with size up to the free size
2015-07-06 12:34:29 +03:00
Ivan Grokhotkov
d24fa4636c Add some headers 2015-06-05 14:07:49 +03:00
Ivan Grokhotkov
73740d6e6d Clean up eboot 2015-06-05 14:07:35 +03:00
Ivan Grokhotkov
a4126b1235 Fix typo 2015-06-05 14:07:30 +03:00
Ivan Grokhotkov
bdf24031eb Fix uboot startup 2015-06-01 13:33:56 +03:00
Ivan Grokhotkov
d5b578b161 reading eboot commands via RTC, flash erase/copy 2015-06-01 02:08:48 +03:00
Ivan Grokhotkov
de28edb82f Fix eboot makefile 2015-05-29 19:35:31 +03:00
Ivan Grokhotkov
48e0d44860 Add eboot 2015-05-29 19:27:03 +03:00