File tree Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ msgstr ""
193
193
194
194
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
195
195
#: ports/cxd56/common-hal/pulseio/PulseIn.c
196
+ #: ports/espressif/common-hal/coproc/Coproc.c
196
197
#: ports/nrf/common-hal/pulseio/PulseIn.c
197
198
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
198
199
#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c
@@ -485,6 +486,7 @@ msgstr ""
485
486
msgid "Already have all-matches listener"
486
487
msgstr ""
487
488
489
+ #: ports/espressif/common-hal/coproc/__init__.c
488
490
#: shared-module/memorymonitor/AllocationAlarm.c
489
491
#: shared-module/memorymonitor/AllocationSize.c
490
492
msgid "Already running"
@@ -1015,7 +1017,7 @@ msgstr ""
1015
1017
msgid "Firmware is invalid"
1016
1018
msgstr ""
1017
1019
1018
- #: ports/espressif/common-hal/coproc/__init__ .c
1020
+ #: ports/espressif/common-hal/coproc/Coproc .c
1019
1021
#: ports/espressif/common-hal/dualbank/__init__.c
1020
1022
msgid "Firmware is too big"
1021
1023
msgstr ""
Original file line number Diff line number Diff line change 27
27
#include "shared-bindings/coproc/Coproc.h"
28
28
#include "shared-bindings/coproc/CoprocMemory.h"
29
29
30
+ #include "py/runtime.h"
31
+
32
+ #if defined(CONFIG_IDF_TARGET_ESP32S2 )
33
+ #include "esp32s2/ulp.h"
34
+ #define ULP_COPROC_RESERVE_MEM (CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM)
35
+ #elif defined(CONFIG_IDF_TARGET_ESP32S3 )
36
+ #include "esp32s3/ulp.h"
37
+ #define ULP_COPROC_RESERVE_MEM (CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM)
38
+ #endif
39
+
40
+ #define RTC_SLOW_MEM_END ((uint32_t)RTC_SLOW_MEM + ULP_COPROC_RESERVE_MEM)
41
+
30
42
void common_hal_coproc_coproc_construct (coproc_coproc_obj_t * self ,
31
43
const uint8_t * buf , const size_t buf_len , coproc_memory_obj_t * coproc_memory ) {
32
44
// set CoprocMemory object
45
+ if (coproc_memory != NULL ) {
46
+ if (coproc_memory -> address < ((uint32_t )RTC_SLOW_MEM + buf_len ) ||
47
+ coproc_memory -> address > (RTC_SLOW_MEM_END - coproc_memory -> len )) {
48
+ mp_raise_ValueError_varg (translate ("%q out of range" ), MP_QSTR_CoprocMemory );
49
+ }
50
+ }
33
51
self -> coproc_memory = coproc_memory ;
34
52
35
53
// load buffer
54
+ if (buf_len > ULP_COPROC_RESERVE_MEM ) {
55
+ mp_raise_RuntimeError (translate ("Firmware is too big" ));
56
+ }
36
57
self -> buf_len = buf_len ;
37
58
self -> buf = (uint8_t * )m_malloc (self -> buf_len , false);
38
59
memcpy (self -> buf , buf , self -> buf_len );
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ CONFIG_ESP32S2_DATA_CACHE_LINE_32B=y
42
42
# CONFIG_ESP32S2_TRAX is not set
43
43
CONFIG_ESP32S2_TRACEMEM_RESERVE_DRAM=0x0
44
44
CONFIG_ESP32S2_ULP_COPROC_ENABLED=y
45
- CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM=4096
45
+ CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM=8176
46
46
CONFIG_ESP32S2_ULP_COPROC_RISCV=y
47
47
CONFIG_ESP32S2_DEBUG_OCDAWARE=y
48
48
# CONFIG_ESP32S2_DEBUG_STUBS_ENABLE is not set
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32
68
68
# CONFIG_ESP32S3_TRAX is not set
69
69
CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0
70
70
CONFIG_ESP32S3_ULP_COPROC_ENABLED=y
71
- CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=4096
71
+ CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=8176
72
72
CONFIG_ESP32S3_ULP_COPROC_RISCV=y
73
73
CONFIG_ESP32S3_BROWNOUT_DET=y
74
74
CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y
You can’t perform that action at this time.
0 commit comments