Skip to content

Using appfs on latest ESP-IDF #23

@renzenicolai

Description

@renzenicolai

Hi Jeroen,

I've tried to port appfs to the latest ESP-IDF for use on the MCH2022 event badge.

The application side works now and I can store files in the appfs partition, however my attempt at adding appfs support to the latests bootloader version results in a crash.

My attempt can be found here:

https://github.com/badgeteam/mch2022-firmware-esp32/blob/appfs-bootloader/factory_test/bootloader_components/my_boot_hooks/hooks.c

The appfs partition and the app to be started are found and sections are being loaded, however during the loading process a fatal exception occurs, probably because the code snippets I copied over from this repository don't match the methods found in the latest bootloader version.

The log:

E (2473) main: booting gnuboy from appfs
I (13) boot: ESP-IDF v5.0-dev-914-g5624dffc52 2nd stage bootloader
I (14) boot: chip revision: 3
I (14) qio_mode: Enabling default flash chip QIO
I (18) boot.esp32: SPI Speed      : 80MHz
I (23) boot.esp32: SPI Mode       : QIO
I (27) boot.esp32: SPI Flash Size : 16MB
I (32) boot: Enabling RNG early entropy source...
W (37) appfsboot: AppFS boot
I (41) appfsboot: End of partition table
I (45) appfsboot: AppFs found
I (57) appfs: Meta page 0: invalid (serial 0)
I (57) appfs: Meta page 1: valid (serial 7)
I (59) appfs: Using page 1 as current.
I (63) appfsboot: Trying to boot gnuboy as indicated by RTC mem...
I (70) appfs: File 0 has 8 pages.
I (74) appfs: Mapping flash addr 320000 to mem addr 3F400000 for page 0
I (81) appfs: Mapping flash addr 330000 to mem addr 3F410000 for page 1
I (89) appfs: Mapping flash addr 340000 to mem addr 3F420000 for page 2
I (96) appfs: Mapping flash addr 350000 to mem addr 3F430000 for page 3
I (103) appfs: Mapping flash addr 360000 to mem addr 3F440000 for page 4
I (111) appfs: Mapping flash addr 370000 to mem addr 3F450000 for page 5
I (118) appfs: Mapping flash addr 380000 to mem addr 3F460000 for page 6
I (125) appfs: Mapping flash addr 390000 to mem addr 3F470000 for page 7
I (133) appfsboot: Segment 0: map to 3F400020 size 3E95C
I (139) appfsboot: Segment 1: load to 3FFB0000 size 1694
I (145) appfsboot: Segment 2: map to 400D0020 size 23CE0
I (151) appfsboot: Segment 3: load to 3FFB1694 size F40
I (157) appfsboot: Segment 4: load to 40080000 size 18184
Fatal exception (0): IllegalInstruction
epc1=0x40080a30, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000

I hope you find the time to have a quick look into this as I think having appfs support on the latest ESP-IDF might be useful for more people than just me and my project.

Greetings,
Renze

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions