@@ -19,9 +19,9 @@ internal class Esp32Firmware : FirmwarePackage
19
19
public const int CLRAddress = 0x10000 ;
20
20
21
21
/// <summary>
22
- /// ESP32 nanoCLR is available for 2MB, 4MB, 8MB and 16MB flash sizes
22
+ /// ESP32 nanoCLR is available for 2MB, 4MB, 8MB, 16MB, 32MB and 64MB flash sizes if supported.
23
23
/// </summary>
24
- private List < int > SupportedFlashSizes => [ 0x200000 , 0x400000 , 0x800000 , 0x1000000 ] ;
24
+ private List < int > SupportedFlashSizes => [ 0x200000 , 0x400000 , 0x800000 , 0x1000000 , 0x2000000 , 0x4000000 ] ;
25
25
26
26
internal string BootloaderPath ;
27
27
@@ -76,15 +76,26 @@ internal async System.Threading.Tasks.Task<ExitCodes> DownloadAndExtractAsync(Es
76
76
{
77
77
BootloaderPath = "bootloader.bin" ;
78
78
79
+ // Boot loader goes to 0x1000, except for ESP32_C3/C6/H2/S3, which goes to 0x0
80
+ // and ESP32_P4 where it goes at 0x2000
81
+ int BootLoaderAddress = 0x1000 ;
82
+ if ( deviceInfo . ChipType == "ESP32-C3"
83
+ || deviceInfo . ChipType == "ESP32-C6"
84
+ || deviceInfo . ChipType == "ESP32-H2"
85
+ || deviceInfo . ChipType == "ESP32-S3" )
86
+ {
87
+ BootLoaderAddress = 0 ;
88
+ }
89
+ if ( deviceInfo . ChipType == "ESP32-P4" )
90
+ {
91
+ BootLoaderAddress = 0x2000 ;
92
+ }
93
+
79
94
// get ESP32 partitions
80
95
FlashPartitions = new Dictionary < int , string >
81
96
{
82
- // bootloader goes to 0x1000, except for ESP32_C3/C6/H2/S3, which goes to 0x0
83
- {
84
- deviceInfo . ChipType == "ESP32-C3"
85
- || deviceInfo . ChipType == "ESP32-C6"
86
- || deviceInfo . ChipType == "ESP32-H2"
87
- || deviceInfo . ChipType == "ESP32-S3" ? 0x0 : 0x1000 , Path . Combine ( LocationPath , BootloaderPath ) } ,
97
+ // BootLoader goes to an address depending on chip type
98
+ { BootLoaderAddress , Path . Combine ( LocationPath , BootloaderPath ) } ,
88
99
89
100
// nanoCLR goes to 0x10000
90
101
{ CLRAddress , Path . Combine ( LocationPath , "nanoCLR.bin" ) } ,
0 commit comments