]> granicus.if.org Git - esp-idf/commit
bootloader/early boot: Error out if >192KB of static DRAM is allocated (temporary...
authorAngus Gratton <angus@espressif.com>
Wed, 12 Jul 2017 02:25:13 +0000 (10:25 +0800)
committerAngus Gratton <gus@projectgus.com>
Wed, 12 Jul 2017 05:06:56 +0000 (13:06 +0800)
commit2b0f623259f8af0797cf2a488b0e54762ca34a08
treedaaf80f72edc354d61745a98529c64569af1b71b
parent9487797273bcc61e1a268e27cbbf16ad7fdba3cc
bootloader/early boot: Error out if >192KB of static DRAM is allocated (temporary fix)

Currently the last 128KB of DRAM is reserved for the bootloader & early boot stacks. This means if >192KB of static DRAM
is allocated, the only available heap is this region - which is disabled until the scheduler starts. As a result, you
get either heap corruption on early boot if the static data overlaps startup heap (leading to very weird errors), or
FreeRTOS will fail to start when it can't malloc() anything.

Long term fix is to move the stacks & bootloader data to the very end of RAM, and only reserve that part for early
boot. This is a little fiddly because of also wanting to make sure this memory is not preemptively fragmented when it
gets reintroduced to the heap. This will become more important if/when we have more static allocation options in the
future.

For now, these errors make it clear why the boot has failed.

Ref TW13909
components/bootloader/src/main/bootloader_start.c
components/esp32/cpu_start.c