Flash ESP32P4 problem

DickyOZ
Posts: 22
Joined: Sun Aug 03, 2025 9:40 am

Flash ESP32P4 problem

Postby DickyOZ » Thu Mar 05, 2026 1:16 am

My PC motherboard failed and Bought a new PC. I loaded the latest versions of Win11 PRO (hate it with a vengeance!), VS-Code with the ESP-IDF extension etc.
When I build my APP for the Guition JC-ESP32-P4-M3-Dev it compiles OK as it always did but when I now try to flash it i get the error:
A fatal error occurred: bootloader/bootloader.bin requires chip revision in range [v3.1 - v3.99] (this chip is revision v1.3). Use --force to flash anyway.
This was never a problem on my old PC I tried to change the range to v1.1 it makes no difference and I have no idea how to invoke the force flash.
Help would be much appreciated. My knowledge and skills with ESP-IDF are very limited.

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: Flash ESP32P4 problem

Postby lbernstone » Thu Mar 05, 2026 1:21 am

This is due to a new issue of IDF, not your new computer. There is an option in menuconfig (hit / and search for P4) to build for older revisions (<3) of the P4.

DickyOZ
Posts: 22
Joined: Sun Aug 03, 2025 9:40 am

Re: Flash ESP32P4 problem

Postby DickyOZ » Thu Mar 05, 2026 2:05 am

Many thanks for the fix to the P$ version problem. I made the change you gave and when I now try to compile the APP I get the error:
EBUSY: resource busy or locked, rmdir 'c:\Temp\ESP-IDF Projects\STXY\build'
I tried closing VS-Code and restarting it but still get the same error. Programming was so much simpler when I write my first program sixty years ago!

DickyOZ
Posts: 22
Joined: Sun Aug 03, 2025 9:40 am

Re: Flash ESP32P4 problem

Postby DickyOZ » Thu Mar 05, 2026 7:05 am

Sorry to be a nuisance; I did say I know very little about ESP-IDF. You said "hit /" but not where I do that.
I tried to get to Menuconfig by: view -> Command Palette then type Menuconfig <enter> that takes me to a screen where I can type P4 and it shows Chip revision where I can select <3.0 I then click save.
If I then do a Build it appears to go as normal and creates an image but then fails with a Ninja error. My only way to recover is to restore the folder from a backup.
I remember getting to the Menuconfig that looked like and old style VB screen but can't remember how I got there.

DickyOZ
Posts: 22
Joined: Sun Aug 03, 2025 9:40 am

Re: Flash ESP32P4 problem

Postby DickyOZ » Thu Mar 05, 2026 11:32 pm

Here we go round the mulberry bush! I tried to get AI chat to fix the problem; here is its response
The build has now succeeded! The issue was caused by the ESP32-P4 chipset revision range adjustment you made in menuconfig. When you changed the minimum supported revision from 301 to 0 and the maximum from 399 to 199, it affected the memory layout or code inclusion in a way that caused the linker to discard sections due to incompatible memory regions.

By reverting the revision settings back to the original values (min 301, max 399), the build completes successfully. The binary was generated at C:/Temp/ESP-IDF Projects/STXY/build/p4_dsi_lvgl_demo_v9.bin with a size of about 687 KB, which fits well within the 8MB app partition.

If you need to support a wider range of ESP32-P4 revisions (including older ones), you may need to:

Check ESP-IDF documentation for revision-specific compatibility
Adjust other configuration options that might be affected
Or accept that this particular project is optimized for revisions 301-399
How dumb was that? It simply changed things back to the original code that allows me to compile but not flash the ESP32-P4 because the chipset range is wrong.
Does anyone know how to overcome this problem. I tried to revert the ESP-IDF extension in VS_Code to an earlier version but Microsoft new better and insisted on loading the latest version. Onwards and downwards.....

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: Flash ESP32P4 problem

Postby lbernstone » Wed Mar 11, 2026 5:03 pm

I did not reply because a resource locking issue is from Windows, which I do not use.
If you are getting a different error, post it. I can compile for the older P4 without issue. You can try arduino-esp32, which has an option for compiling to the earlier rev.

DickyOZ
Posts: 22
Joined: Sun Aug 03, 2025 9:40 am

Re: Flash ESP32P4 problem

Postby DickyOZ » Thu Mar 12, 2026 2:26 am

I did not reply because a resource locking issue is from Windows, which I do not use.
If you are getting a different error, post it. I can compile for the older P4 without issue. You can try arduino-esp32, which has an option for compiling to the earlier rev.
I can compile and build OK - I just can't flash the board.
I can't use Arduino because there isn't a Library for mipi dsi for the JC-ESP32p4-M3-DEV nor one for the Rpi 5" V2 lcd.

I thought regressing to an earlier version would solve the problem but it didn't; perhaps I didn't regress everything.

skiz77
Posts: 2
Joined: Wed Mar 18, 2026 10:13 pm

Re: Flash ESP32P4 problem

Postby skiz77 » Wed Mar 18, 2026 10:15 pm

Here you go:
ESP32P4_SELECTS_REV_LESS_V3(=y) "Select ESP32-P4 revisions <3.0 (No >=3.x Support)"

DickyOZ
Posts: 22
Joined: Sun Aug 03, 2025 9:40 am

Re: Flash ESP32P4 problem

Postby DickyOZ » Thu Mar 19, 2026 11:08 pm

Here you go:
ESP32P4_SELECTS_REV_LESS_V3(=y) "Select ESP32-P4 revisions <3.0 (No >=3.x Support)"
If I select that option the project will compile but fail to build .

Code: Select all

-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: error: --enable-non-contiguous-regions discards section `.sdata.s_time_update_lock' from `esp-idf/esp_timer/libesp_timer.a(esp_timer_impl_common.c.obj)'

etc...  etc... (Another 82kB of similar errors)

C:/Espressif/tools/riscv32-esp-elf/esp-14.2.0_20251107/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: error: --enable-non-contiguous-regions discards section `.sdata.__global_locale_ptr' from `C:/Espressif/tools/riscv32-esp-elf/esp-14.2.0_20251107/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/lib/rv32imafc_zicsr_zifencei/ilp32f/no-rtti\libc.a(libc_a-locale.o)'
C:/Espressif/tools/riscv32-esp-elf/esp-14.2.0_20251107/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/14.2.0/../../../../riscv32-esp-elf/bin/ld.exe: error: Total discarded sections size is 20486 bytes
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

skiz77
Posts: 2
Joined: Wed Mar 18, 2026 10:13 pm

Re: Flash ESP32P4 problem

Postby skiz77 » Fri Mar 20, 2026 1:09 pm

I don't know exactly what is going on, but it looks like too big to fit in the available memory. Here's my sdkconfig.defaults:

CONFIG_IDF_TARGET="esp32p4"
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5=n //some bug in the 6.0-RC1 SDK

As of this morning, I finally have a working LVGL_9.5 build on the JC1060P470C_I_W_Y. Couldn't have done it without the above pointer though, as I almost gave up until I saw the post. Not sure why there isn't a BSP to make this easier.

Who is online

Users browsing this forum: ChatGPT-User, GPTBot, PerplexityBot and 3 guests