Skip to content

Commit 82eade4

Browse files
committed
Patch libmbedtls to allow EXTERNAL memory use
1 parent 06adcee commit 82eade4

File tree

7 files changed

+17
-1
lines changed

7 files changed

+17
-1
lines changed

.github/workflows/compile-rtk-everywhere.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ jobs:
6868
- name: Install platform
6969
run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }}
7070

71+
-name: Get IDF version
72+
run: |
73+
cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs
74+
$IDF_VERSION = echo "$(ls | grep idf-release)"
75+
echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV"
76+
7177
- name: Get Known Libraries
7278
run: arduino-cli lib install
7379
@@ -95,6 +101,14 @@ jobs:
95101
cd Firmware/RTK_Everywhere/Patch/
96102
cp BleSerial.cpp /home/runner/Arduino/libraries/ESP32_BleSerial/src/BleSerial.cpp
97103
104+
- name: Patch libmbedtls
105+
run: |
106+
cd Firmware/RTK_Everywhere/Patch/
107+
cp libmbedtls.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedtls.a
108+
cp libmbedtls_2.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedtls_2.a
109+
cp libmbedcrypto.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedcrypto.a
110+
cp libmbedx509.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedx509.a
111+
98112
- name: Setup Python
99113
uses: actions/setup-python@v4
100114
with:
4.36 MB
Binary file not shown.
108 KB
Binary file not shown.
1.29 MB
Binary file not shown.
670 KB
Binary file not shown.

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
#include <NetworkClientSecure.h>
7272
#include <NetworkUdp.h>
7373

74+
bool RTK_CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC = false; // Flag used by the special build of libmbedtls (libmbedcrypto) to select external memory
75+
7476
#ifdef COMPILE_ETHERNET
7577
#include <ETH.h>
7678
#endif // COMPILE_ETHERNET

Firmware/RTK_Everywhere/System.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void beginPsram()
1212
systemPrintf("PSRAM Size (bytes): %d\r\n", ESP.getPsramSize());
1313
if (ESP.getPsramSize() > 0)
1414
{
15-
online.psram = true;
15+
RTK_CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC = online.psram = true;
1616

1717
heap_caps_malloc_extmem_enable(
1818
settings.psramMallocLevel); // Use PSRAM for memory requests larger than X bytes

0 commit comments

Comments
 (0)