esp_image: invalid SPI mode 76
Posted: Tue May 15, 2018 9:43 am
Hey there,
I'm currently working on porting OpenPEARL (Informations: https://sourceforge.net/projects/openpearl/ and https://en.wikipedia.org/wiki/PEARL_(pr ... _language)) as part of my bachelor thesis.
The user should be able to write PEARL code, which gets translated to C++. I am using the template-project to build all the ESP components with the ESP makefiles to use the correct compiler and linker flags. This is done once at the installation of OpenPEARL. I am using a modified version of the ESP32 build command to build and link my generated files (hello_world.cc and system.cc) every time I want to build my application:
I'm using this as a flash command:
I added two components (openpearl-common and boardsupport) and I did some changes to the freertos component (added classes needed by OpenPEARL). I also exchanged the main.c with my personal main.cc, which starts the OpenPEARL tasks provided in hello_world.cc.
I'm able to build and flash, but on connection with miniterm I receive the following output:
I am still able to build and flash the template project directly with "make flash monitor", although I'm getting an Guru Meditation Error (but this is a problem I have towork on afterwards )
What could cause an SPI mode this high? What is the SPI mode of the image used for? I thought the SPI mode is used for flashing...
I know this could be a difficult question to answer because of my specific use case and I'm hoping for every small clue you can give me.
I'm currently working on porting OpenPEARL (Informations: https://sourceforge.net/projects/openpearl/ and https://en.wikipedia.org/wiki/PEARL_(pr ... _language)) as part of my bachelor thesis.
The user should be able to write PEARL code, which gets translated to C++. I am using the template-project to build all the ESP components with the ESP makefiles to use the correct compiler and linker flags. This is done once at the installation of OpenPEARL. I am using a modified version of the ESP32 build command to build and link my generated files (hello_world.cc and system.cc) every time I want to build my application:
Code: Select all
xtensa-esp32-elf-gcc -DTARGET=3 -nostdlib -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,-static -Wl,--start-group -mlongcalls -frtti -u call_user_start_cpu0 -Os -I /usr/local/include system.cc hello_world.cc -L/usr/local/lib/OpenPEARLesp32 -lapp_trace -lapp_update -laws_iot -lboardsupport -lbootloader_support -lbt -lcoap -lconsole -lcxx -u __cxa_guard_dummy -ldriver -lesp32 /home/michael/code/hfu/thesis/OpenPEARL/openpearl-code/runtime/esp32/esp-idf/components/esp32/libhal.a -L/home/michael/code/hfu/thesis/OpenPEARL/openpearl-code/runtime/esp32/esp-idf/components/esp32/lib -lcore -lrtc -lnet80211 -lpp -lwpa -lsmartconfig -lcoexist -lwps -lwpa2 -lespnow -lphy -L/home/michael/code/hfu/thesis/OpenPEARL/openpearl-code/runtime/esp32/esp-idf/components/esp32/ld -L/home/michael/code/hfu/thesis/OpenPEARL/openpearl-code/runtime/esp32/esp-idf-template/build/esp32 -T esp32_out.ld -u ld_include_panic_highint_hdl -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld -lesp_adc_cal -lethernet -lexpat -lfatfs -lfreertos -Wl,--undefined=uxTopUsedPriority -lheap -lidf_test -ljsmn -ljson -llibsodium -llog -llwip -lmbedtls -lmdns -lmicro-ecc /home/michael/code/hfu/thesis/OpenPEARL/openpearl-code/runtime/esp32/esp-idf/components/newlib/lib/libc.a /home/michael/code/hfu/thesis/OpenPEARL/openpearl-code/runtime/esp32/esp-idf/components/newlib/lib/libm.a -lnewlib -lnghttp -lnvs_flash -lopenpearl_common -lopenssl -lpthread -lsdmmc -lsoc -lspi_flash -lspiffs -ltcpip_adapter -lulp -lvfs -lwear_levelling -lwpa_supplicant -lxtensa-debug-module -lmain -lgcc -lstdc++ -lgcov -Wl,--end-group -Wl,-EL -o $$fn -Wl,-Map=esp32.map
Code: Select all
python /home/michael/code/hfu/thesis/OpenPEARL/openpearl-code/runtime/esp32/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB1 --baud 115200 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /usr/local/lib/OpenPEARLesp32/bootloader.bin 0x10000 hello_world 0x8000 /usr/local/lib/OpenPEARLesp32/partitions_singleapp.bin
I'm able to build and flash, but on connection with miniterm I receive the following output:
Code: Select all
--- forcing DTR inactive
--- forcing RTS inactive
--- Miniterm on /dev/ttyUSB1 115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x3e (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4684
load:0x40078000,len:0
load:0x40078000,len:12148
entry 0x40078e0c
E (37) esp_image: image at 0x10000 has invalid magic byte
W (37) esp_image: image at 0x10000 has invalid SPI mode 76
E (38) boot: Factory app partition is not bootable
E (43) boot: No bootable app partitions in the partition table
user code done
What could cause an SPI mode this high? What is the SPI mode of the image used for? I thought the SPI mode is used for flashing...
I know this could be a difficult question to answer because of my specific use case and I'm hoping for every small clue you can give me.