Update esp32c3 for esp-idf v5.5

This commit is contained in:
ccrause 2025-09-05 07:44:26 +02:00 committed by FPK
parent bf533ab2ac
commit 41fa38d217
7 changed files with 88 additions and 21 deletions

View File

@ -556,7 +556,9 @@ implementation
end;
if (current_settings.controllertype=ct_esp32c3) then
begin
if idf_version>=50200 then
if idf_version>=50300 then
CheckAddUnit('esp32c3idf_50300')
else if idf_version>=50200 then
CheckAddUnit('esp32c3idf_50200')
else if idf_version>=50000 then
CheckAddUnit('esp32c3idf_50000')

View File

@ -1631,33 +1631,41 @@ begin
end;
{$endif XTENSA}
{$ifdef RISCV32}
if idf_version>=50300 then
begin
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -L $IDF_PATH/components/riscv/ld';
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+'rom.api.ld';
end;
if current_settings.controllertype=ct_esp32c2 then
if idf_version>=50200 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.rvfp.ld -T '+cntrlr+'.rom.newlib.ld -T '+cntrlr+'.rom.version.ld -T '+cntrlr+'.rom.newlib-nano.ld -T '+cntrlr+'.rom.heap.ld'
else if idf_version>=50000 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.rvfp.ld -T '+cntrlr+'.rom.newlib.ld -T '+cntrlr+'.rom.version.ld -T '+cntrlr+'.rom.newlib-time.ld -T '+cntrlr+'.rom.newlib-nano.ld -T '+cntrlr+'.rom.heap.ld'
else
begin
//Currently not supported
end;
Comment(V_Error,'Unsupported esp-idf version specified');
if current_settings.controllertype=ct_esp32c3 then
if idf_version>=50200 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.libgcc.ld -T '+cntrlr+'.rom.newlib.ld -T '+cntrlr+'.rom.version.ld -T '+cntrlr+'.rom.eco3.ld'
else if idf_version>=50000 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.libgcc.ld -T '+cntrlr+'.rom.newlib.ld -T '+cntrlr+'.rom.version.ld -T '+cntrlr+'.rom.eco3.ld'
else if idf_version>=40400 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.libgcc.ld -T '+cntrlr+'.rom.newlib.ld -T '+cntrlr+'.rom.version.ld -T '+cntrlr+'.rom.newlib-time.ld -T '+cntrlr+'.rom.eco3.ld'
begin
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.libgcc.ld -T '+cntrlr+'.rom.newlib.ld -T '+cntrlr+'.rom.version.ld -T '+cntrlr+'.rom.eco3.ld';
if idf_version<50000 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.newlib-time.ld';
if idf_version>=50000 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.eco3_bt_funcs.ld';
if idf_version>=50300 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' --allow-multiple -T'+cntrlr+'.rom.bt_funcs.ld -T '+cntrlr+'.rom.ble_master.ld -T '+cntrlr+'.rom.ble_50.ld -T '+cntrlr+'.rom.ble_smp.ld -T '+
cntrlr+'.rom.ble_dtm.ld -T '+cntrlr+'.rom.ble_test.ld -T '+cntrlr+'.rom.ble_scan.ld';
if idf_version>=50500 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.libc.ld';
end
else
begin
//Currently not supported
end;
Comment(V_Error,'Unsupported esp-idf version specified');
if current_settings.controllertype=ct_esp32c6 then
if idf_version>=50200 then
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.rom.rvfp.ld -T '+cntrlr+'.rom.newlib.ld -T '+cntrlr+'.rom.version.ld -T '+cntrlr+'.rom.phy.ld -T '+cntrlr+'.rom.coexist.ld -T '+cntrlr+'.rom.net80211.ld -T '+cntrlr+'.rom.pp.ld -T '+cntrlr+'.rom.wdt.ld -T '+cntrlr+'.rom.systimer.ld -T '+cntrlr+'.rom.newlib-normal.ld -T '+cntrlr+'.rom.heap.ld'
else
begin
//Currently not supported
end;
Comment(V_Error,'Unsupported esp-idf version specified');
{$endif RISCV32}
Info.ExeCmd[1]:=Info.ExeCmd[1]+' -T '+cntrlr+'.peripherals.ld'
end;

View File

@ -947,7 +947,7 @@ ifeq ($(ARCH),riscv32)
CPU_SPECIFIC_COMMON_UNITS=$(SYSUTILSUNIT) $(MATHUNIT) $(CLASSESUNIT) $(FGLUNIT) $(MACPASUNIT) $(TYPINFOUNIT) $(TYPESUNIT) $(RTLCONSTSUNIT) $(GETOPTSUNIT) $(LINEINFOUNIT)
ifeq ($(SUBARCH),rv32imc)
override FPCOPT+=-Cprv32imc
CPU_UNITS=esp32c2 esp32c3 esp32c3idf_40400 esp32c2idf_50000 esp32c3idf_50000 esp32c2idf_50200 esp32c3idf_50200
CPU_UNITS=esp32c2 esp32c3 esp32c3idf_40400 esp32c2idf_50000 esp32c3idf_50000 esp32c2idf_50200 esp32c3idf_50200 esp32c3idf_50300
CPU_UNITS_DEFINED=1
endif
ifeq ($(SUBARCH),rv32imac)

View File

@ -82,7 +82,7 @@ ifeq ($(ARCH),riscv32)
CPU_SPECIFIC_COMMON_UNITS=$(SYSUTILSUNIT) $(MATHUNIT) $(CLASSESUNIT) $(FGLUNIT) $(MACPASUNIT) $(TYPINFOUNIT) $(TYPESUNIT) $(RTLCONSTSUNIT) $(GETOPTSUNIT) $(LINEINFOUNIT)
ifeq ($(SUBARCH),rv32imc)
override FPCOPT+=-Cprv32imc
CPU_UNITS=esp32c2 esp32c3 esp32c3idf_40400 esp32c2idf_50000 esp32c3idf_50000 esp32c2idf_50200 esp32c3idf_50200
CPU_UNITS=esp32c2 esp32c3 esp32c3idf_40400 esp32c2idf_50000 esp32c3idf_50000 esp32c2idf_50200 esp32c3idf_50200 esp32c3idf_50200
CPU_UNITS_DEFINED=1
endif
ifeq ($(SUBARCH),rv32imac)

View File

@ -28,7 +28,8 @@ unit esp32c3;
procedure PASCALMAIN; external name 'PASCALMAIN';
procedure esp_deep_sleep_start;external;
procedure putchar(c : char);external;
// deprecated since v5.3, consider moving this to SDK version dependent unit
procedure putchar(c : char);external name 'esp_rom_uart_tx_one_char';
function getchar : char;external;
function __getreent : pointer;external;
procedure fflush(f : pointer);external;

View File

@ -21,12 +21,10 @@ interface
{$linklib app_update,static}
{$linklib bootloader_support,static}
{$linklib coexist,static}
{$linklib core,static}
{$linklib driver,static}
{$linklib efuse,static}
{$linklib esp_app_format,static}
{$linklib esp_coex,static}
{$linklib esp_common,static}
{$linklib esp_hw_support,static}
{$linklib esp_mm,static}

View File

@ -0,0 +1,58 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2021 by Florian Klaempfl
member of the Free Pascal development team.
System unit for FreeRTOS systems
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit esp32c3idf_50300;
{$ENDIF FPC_DOTTEDUNITS}
interface
{$linklib esp_driver_gpio, static}
{$linklib app_update,static}
{$linklib bootloader_support,static}
{$linklib core,static}
{$linklib driver,static}
{$linklib efuse,static}
{$linklib esp_app_format,static}
{$linklib esp_common,static}
{$linklib esp_hw_support,static}
{$linklib esp_mm,static}
{$linklib esp_partition,static}
{$linklib esp_phy,static}
{$linklib esp_pm,static}
{$linklib esp_ringbuf,static}
{$linklib esp_rom,static}
{$linklib esp_system,static}
{$linklib esp_timer,static}
{$linklib freertos,static}
{$linklib hal,static}
{$linklib heap,static}
{$linklib log,static}
{$linklib newlib,static}
{$linklib pthread,static}
{$linklib riscv,static}
{$linklib soc,static}
{$linklib spi_flash,static}
{$linklib vfs,static}
{$linklib c,static}
{$linklib m,static}
{$linklib gcc,static}
{$linklib esp_gdbstub,static}
{$linklib espcoredump,static}
implementation
end.