Browse Source

Add support for esp-idf v4.4

ccrause 1 year ago
parent
commit
8e717f4142

+ 6 - 1
compiler/pmodules.pas

@@ -525,7 +525,12 @@ implementation
         if not(curr.is_unit) and (target_info.system=system_riscv32_freertos) then
           if (current_settings.controllertype=ct_esp32c3) then
             begin
-              CheckAddUnit('esp32c3idf_50000')
+              if idf_version>=50000 then
+                CheckAddUnit('esp32c3idf_50000')
+              else if idf_version>=40400 then
+                CheckAddUnit('esp32c3idf_40400')
+              else
+                Comment(V_Warning, 'Unsupported esp-idf version');
             end;
 {$endif XTENSA}
       end;

+ 1 - 1
rtl/freertos/Makefile

@@ -922,7 +922,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=esp32c3 esp32c3idf_50000
+CPU_UNITS=esp32c3 esp32c3idf_40400 esp32c3idf_50000
 CPU_UNITS_DEFINED=1
 endif
 ifeq ($(CPU_UNITS_DEFINED),)

+ 1 - 1
rtl/freertos/Makefile.fpc

@@ -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=esp32c3 esp32c3idf_50000
+CPU_UNITS=esp32c3 esp32c3idf_40400 esp32c3idf_50000
 CPU_UNITS_DEFINED=1
 endif
 ifeq ($(CPU_UNITS_DEFINED),)

+ 49 - 0
rtl/freertos/riscv32/esp32c3idf_40400.pp

@@ -0,0 +1,49 @@
+{
+    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_40400;
+{$ENDIF FPC_DOTTEDUNITS}
+
+interface
+
+{$linklib app_update,static}
+{$linklib bootloader_support,static}
+{$linklib driver,static}
+{$linklib efuse,static}
+{$linklib esp_common,static}
+{$linklib esp_hw_support,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}
+
+implementation
+
+end.