Set stack size depending on the number of enabled interfaces.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-12-24 01:42:33 +01:00
parent f8cb36c2cf
commit c59fb91540
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3
4 changed files with 6 additions and 6 deletions

View file

@ -144,7 +144,7 @@ int sm_wrap() {
if (sm_indicator == 0) {
return PICOKEY_OK;
}
uint8_t input[4096];
uint8_t input[2048];
size_t input_len = 0;
memset(input, 0, sizeof(input));
mbedtls_mpi ssc;
@ -232,7 +232,7 @@ void sm_update_iv() {
}
int sm_verify() {
uint8_t input[4096];
uint8_t input[2048];
memset(input, 0, sizeof(input));
uint16_t input_len = 0;
int r = 0;
@ -241,7 +241,7 @@ int sm_verify() {
if (data_len % sm_blocksize) {
data_len += sm_blocksize;
}
if (data_len + (add_header ? sm_blocksize : 0) > 4096) {
if (data_len + (add_header ? sm_blocksize : 0) > sizeof(input)) {
return PICOKEY_WRONG_LENGTH;
}
mbedtls_mpi ssc;

View file

@ -30,7 +30,7 @@ typedef QueueHandle_t queue_t;
#define queue_is_empty(a) (uxQueueMessagesWaiting(*(a)) == 0)
#define queue_try_remove(a,b) xQueueReceive(*(a), b, 0)
extern TaskHandle_t hcore0, hcore1;
#define multicore_launch_core1(a) xTaskCreatePinnedToCore((void(*)(void *))a, "core1", 4096*5, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 2, &hcore1, 1)
#define multicore_launch_core1(a) xTaskCreatePinnedToCore((void(*)(void *))a, "core1", 4096*ITF_TOTAL*2, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 2, &hcore1, 1)
#define multicore_reset_core1() do { if (hcore1) { eTaskState e = eTaskGetState(hcore1); if (e <= eSuspended) { vTaskDelete(hcore1); }} }while(0)
#define sleep_ms(a) vTaskDelay(a / portTICK_PERIOD_MS)
static inline uint32_t board_millis(void) {

View file

@ -342,7 +342,7 @@ int main(void) {
#endif
#ifdef ESP_PLATFORM
xTaskCreatePinnedToCore(core0_loop, "core0", 4096*5, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 1, &hcore0, 0);
xTaskCreatePinnedToCore(core0_loop, "core0", 4096*ITF_TOTAL*2, NULL, CONFIG_TINYUSB_TASK_PRIORITY - 1, &hcore0, 0);
#else
core0_loop();
#endif

View file

@ -99,7 +99,7 @@ extern "C" {
#endif
#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_VENDOR_TX_BUFSIZE 4096
#define CFG_TUD_VENDOR_TX_BUFSIZE 2048
//------------- CLASS -------------//
#define CFG_TUD_CDC 0