Skip to content

Commit 4551c58

Browse files
authored
Merge pull request #9 from adafruit/cherry-pick-v4.2
Cherry pick v4.2
2 parents 371f382 + 0d4a03b commit 4551c58

File tree

17 files changed

+602
-8
lines changed

17 files changed

+602
-8
lines changed

Diff for: boards.txt

+400
Large diffs are not rendered by default.

Diff for: cores/esp32/esp32-hal-adc.c

+6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ static uint8_t __analogVRefPin = 0;
4343
#endif
4444

4545
static uint8_t __analogAttenuation = 3;//11db
46+
47+
#if CONFIG_IDF_TARGET_ESP32
4648
static uint8_t __analogWidth = 3;//12 bits
49+
#elif CONFIG_IDF_TARGET_ESP32S2
50+
static uint8_t __analogWidth = 4;//13 bits
51+
#endif
52+
4753
static uint8_t __analogClockDiv = 1;
4854

4955
void __analogSetClockDiv(uint8_t clockDiv){

Diff for: platform.txt

+17-8
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,18 @@ build.loop_core=
9494
build.event_core=
9595
build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.loop_core} {build.event_core} {build.defines} {build.extra_flags.{build.mcu}}
9696

97-
# Check if custom partitions exist
98-
recipe.hooks.prebuild.1.pattern=bash -c "[ ! -f "{build.source.path}"/partitions.csv ] || cp -f "{build.source.path}"/partitions.csv "{build.path}"/partitions.csv"
99-
recipe.hooks.prebuild.2.pattern=bash -c "[ -f "{build.path}"/partitions.csv ] || cp "{runtime.platform.path}"/tools/partitions/{build.partitions}.csv "{build.path}"/partitions.csv"
97+
# Check if custom partitions exist: source > variant > build.partitions
98+
recipe.hooks.prebuild.1.pattern=bash -c "[ ! -f {build.source.path}/partitions.csv ] || cp -f {build.source.path}/partitions.csv {build.path}/partitions.csv"
99+
recipe.hooks.prebuild.2.pattern=bash -c "[ -f {build.path}/partitions.csv ] || [ ! -f {build.variant.path}/partitions.csv ] || cp {build.variant.path}/partitions.csv {build.path}/partitions.csv"
100+
recipe.hooks.prebuild.3.pattern=bash -c "[ -f {build.path}/partitions.csv ] || cp {runtime.platform.path}/tools/partitions/{build.partitions}.csv {build.path}/partitions.csv"
101+
100102
recipe.hooks.prebuild.1.pattern.windows=cmd /c if exist "{build.source.path}\partitions.csv" COPY /y "{build.source.path}\partitions.csv" "{build.path}\partitions.csv"
101-
recipe.hooks.prebuild.2.pattern.windows=cmd /c if not exist "{build.path}\partitions.csv" COPY "{runtime.platform.path}\tools\partitions\{build.partitions}.csv" "{build.path}\partitions.csv"
103+
recipe.hooks.prebuild.2.pattern.windows=cmd /c if not exist "{build.path}\partitions.csv" if exist "{build.variant.path}\partitions.csv" COPY "{build.variant.path}\partitions.csv" "{build.path}\partitions.csv"
104+
recipe.hooks.prebuild.3.pattern.windows=cmd /c if not exist "{build.path}\partitions.csv" COPY "{runtime.platform.path}\tools\partitions\{build.partitions}.csv" "{build.path}\partitions.csv"
105+
106+
# Check if custom bootloader exist: source > variant > build.boot
107+
recipe.hooks.prebuild.4.pattern=bash -c "[ -f {build.source.path}/bootloader.bin ] && cp -f {build.source.path}/bootloader.bin {build.path}/{build.project_name}.bootloader.bin || ( [ -f {build.variant.path}/bootloader.bin ] && cp {build.variant.path}/bootloader.bin {build.path}/{build.project_name}.bootloader.bin || cp -f {runtime.platform.path}/tools/sdk/{build.mcu}/bin/bootloader_{build.boot}_{build.flash_freq}.bin {build.path}/{build.project_name}.bootloader.bin )"
108+
recipe.hooks.prebuild.4.pattern.windows=cmd /c IF EXIST "{build.source.path}\bootloader.bin" ( COPY /y "{build.source.path}\bootloader.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( IF EXIST "{build.variant.path}\bootloader.bin" ( COPY "{build.variant.path}\bootloader.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( COPY /y "{runtime.platform.path}\tools\sdk\{build.mcu}\bin\bootloader_{build.boot}_{build.flash_freq}.bin" "{build.path}\{build.project_name}.bootloader.bin" ) )
102109

103110
## Compile c files
104111
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
@@ -119,8 +126,9 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-Wl,--Map={build
119126
recipe.objcopy.partitions.bin.pattern={tools.gen_esp32part.cmd} -q "{build.path}/partitions.csv" "{build.path}/{build.project_name}.partitions.bin"
120127

121128
## Create bin
122-
recipe.objcopy.bin.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip {build.mcu} elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
123-
recipe.objcopy.bin.pattern.linux=python "{tools.esptool_py.path}/{tools.esptool_py.cmd}" --chip {build.mcu} elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
129+
recipe.objcopy.bin.pattern_args=--chip {build.mcu} elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
130+
recipe.objcopy.bin.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args}
131+
recipe.objcopy.bin.pattern.linux=python "{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args}
124132

125133
## Save bin
126134
recipe.output.tmp_file={build.project_name}.{build.mcu}.bin
@@ -136,6 +144,7 @@ recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss|\.noinit)\s+([0-9]+).*
136144
tools.esptool_py.upload.protocol=esp32
137145
tools.esptool_py.upload.params.verbose=
138146
tools.esptool_py.upload.params.quiet=
139-
tools.esptool_py.upload.pattern="{path}/{cmd}" --chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/{build.mcu}/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin"
140-
tools.esptool_py.upload.pattern.linux=python "{path}/{cmd}" --chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{runtime.platform.path}/tools/sdk/{build.mcu}/bin/bootloader_{build.boot}_{build.flash_freq}.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin"
147+
tools.esptool_py.upload.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{build.path}/{build.project_name}.bootloader.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" {upload.extra_flags}
148+
tools.esptool_py.upload.pattern="{path}/{cmd}" {upload.pattern_args}
149+
tools.esptool_py.upload.pattern.linux=python "{path}/{cmd}" {upload.pattern_args}
141150
tools.esptool_py.upload.network_pattern={network_cmd} -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"

Diff for: variants/adafruit_feather_esp32s2/bootloader.bin

22.2 KB
Binary file not shown.

Diff for: variants/adafruit_feather_esp32s2/partitions.csv

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,

Diff for: variants/adafruit_feather_esp32s2/pins_arduino.h

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
7+
#define USB_VID 0x239A
8+
#define USB_PID 0x80EB
9+
#define USB_MANUFACTURER "Adafruit"
10+
#define USB_PRODUCT "Adafruit Feather ESP32-S2"
11+
#define USB_SERIAL ""
12+
13+
14+
#define EXTERNAL_NUM_INTERRUPTS 46
15+
#define NUM_DIGITAL_PINS 48
16+
#define NUM_ANALOG_INPUTS 20
17+
18+
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
19+
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
20+
#define digitalPinHasPWM(p) (p < 46)
21+
22+
static const uint8_t PIN_NEOPIXEL = 33;
23+
static const uint8_t PIN_NEOPIXEL_POWER = 21;
24+
static const uint8_t LED_BUILTIN = 13;
25+
26+
static const uint8_t TX = 39;
27+
static const uint8_t RX = 38;
28+
29+
static const uint8_t SDA = 3;
30+
static const uint8_t SCL = 4;
31+
32+
static const uint8_t SS = 42;
33+
static const uint8_t MOSI = 35;
34+
static const uint8_t SCK = 36;
35+
static const uint8_t MISO = 37;
36+
37+
static const uint8_t A0 = 18;
38+
static const uint8_t A1 = 17;
39+
static const uint8_t A2 = 16;
40+
static const uint8_t A3 = 15;
41+
static const uint8_t A4 = 14;
42+
static const uint8_t A5 = 8;
43+
44+
static const uint8_t T1 = 1;
45+
static const uint8_t T2 = 2;
46+
static const uint8_t T3 = 3;
47+
static const uint8_t T4 = 4;
48+
static const uint8_t T5 = 5;
49+
static const uint8_t T6 = 6;
50+
static const uint8_t T7 = 7;
51+
static const uint8_t T8 = 8;
52+
static const uint8_t T9 = 9;
53+
static const uint8_t T10 = 10;
54+
static const uint8_t T11 = 11;
55+
static const uint8_t T12 = 12;
56+
static const uint8_t T13 = 13;
57+
static const uint8_t T14 = 14;
58+
59+
static const uint8_t DAC1 = 17;
60+
static const uint8_t DAC2 = 18;
61+
62+
#endif /* Pins_Arduino_h */

Diff for: variants/adafruit_feather_esp32s2/tinyuf2.bin

130 KB
Binary file not shown.

Diff for: variants/adafruit_funhouse_esp32s2/bootloader.bin

22.3 KB
Binary file not shown.

Diff for: variants/adafruit_funhouse_esp32s2/partitions.csv

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,

Diff for: variants/adafruit_funhouse_esp32s2/pins_arduino.h

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
7+
#define USB_VID 0x239A
8+
#define USB_PID 0x80F9
9+
10+
#define USB_MANUFACTURER "Adafruit"
11+
#define USB_PRODUCT "Adafruit Funhouse ESP32-S2"
12+
#define USB_SERIAL ""
13+
14+
15+
#define EXTERNAL_NUM_INTERRUPTS 46
16+
#define NUM_DIGITAL_PINS 48
17+
#define NUM_ANALOG_INPUTS 20
18+
19+
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
20+
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
21+
#define digitalPinHasPWM(p) (p < 46)
22+
23+
static const uint8_t PIN_DOTSTAR_DATA = 14;
24+
static const uint8_t PIN_DOTSTAR_CLOCK = 15;
25+
static const uint8_t LED_BUILTIN = 37;
26+
27+
static const uint8_t TX = 2;
28+
static const uint8_t RX = 3;
29+
30+
static const uint8_t TFT_BACKLIGHT = 21;
31+
static const uint8_t TFT_DC = 39;
32+
static const uint8_t TFT_CS = 40;
33+
static const uint8_t TFT_RESET = 41;
34+
35+
static const uint8_t SPEAKER = 42;
36+
static const uint8_t BUTTON_DOWN = 3;
37+
static const uint8_t BUTTON_SELECT = 4;
38+
static const uint8_t BUTTON_UP = 5;
39+
static const uint8_t SENSOR_PIR = 16;
40+
static const uint8_t SENSOR_LIGHT = 18;
41+
42+
static const uint8_t SDA = 34;
43+
static const uint8_t SCL = 33;
44+
45+
static const uint8_t SS = 40;
46+
static const uint8_t MOSI = 35;
47+
static const uint8_t SCK = 36;
48+
static const uint8_t MISO = 37;
49+
50+
static const uint8_t A0 = 17;
51+
static const uint8_t A1 = 2;
52+
static const uint8_t A2 = 3;
53+
static const uint8_t A3 = 18; // light sensor
54+
55+
static const uint8_t T1 = 1;
56+
static const uint8_t T2 = 2;
57+
static const uint8_t T3 = 3;
58+
static const uint8_t T4 = 4;
59+
static const uint8_t T5 = 5;
60+
static const uint8_t T6 = 6;
61+
static const uint8_t T7 = 7;
62+
static const uint8_t T8 = 8;
63+
static const uint8_t T9 = 9;
64+
static const uint8_t T10 = 10;
65+
static const uint8_t T11 = 11;
66+
static const uint8_t T12 = 12;
67+
static const uint8_t T13 = 13;
68+
static const uint8_t T14 = 14;
69+
70+
static const uint8_t DAC1 = 17;
71+
static const uint8_t DAC2 = 18;
72+
73+
#endif /* Pins_Arduino_h */

Diff for: variants/adafruit_funhouse_esp32s2/tinyuf2.bin

132 KB
Binary file not shown.

Diff for: variants/adafruit_magtag29_esp32s2/bootloader.bin

22.2 KB
Binary file not shown.

Diff for: variants/adafruit_magtag29_esp32s2/partitions.csv

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,

Diff for: variants/adafruit_magtag29_esp32s2/tinyuf2.bin

130 KB
Binary file not shown.

Diff for: variants/adafruit_metro_esp32s2/bootloader.bin

22.2 KB
Binary file not shown.

Diff for: variants/adafruit_metro_esp32s2/partitions.csv

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,

Diff for: variants/adafruit_metro_esp32s2/tinyuf2.bin

128 KB
Binary file not shown.

0 commit comments

Comments
 (0)