|
6 | 6 | */ |
7 | 7 |
|
8 | 8 | #include "esp_gmf_err.h" |
| 9 | +#include "esp_heap_caps.h" |
| 10 | +#if CONFIG_MBEDTLS_CERTIFICATE_BUNDLE |
| 11 | +#include "esp_crt_bundle.h" |
| 12 | +#endif /* CONFIG_MBEDTLS_CERTIFICATE_BUNDLE */ |
9 | 13 | #include "esp_gmf_io.h" |
10 | 14 | #include "esp_gmf_io_codec_dev.h" |
11 | 15 | #include "esp_gmf_io_embed_flash.h" |
@@ -42,6 +46,19 @@ static esp_gmf_err_t gmf_loader_setup_default_fs_io(esp_gmf_pool_handle_t pool, |
42 | 46 |
|
43 | 47 | esp_gmf_err_t ret = ESP_GMF_ERR_OK; |
44 | 48 | file_io_cfg_t fs_cfg = FILE_IO_CFG_DEFAULT(); |
| 49 | + fs_cfg.cache_caps = MALLOC_CAP_DMA; |
| 50 | + if (dir == ESP_GMF_IO_DIR_READER) { |
| 51 | +#if CONFIG_GMF_IO_INIT_FILE_READER |
| 52 | + fs_cfg.cache_size = CONFIG_GMF_IO_FILE_READ_CACHE_SIZE; |
| 53 | +#endif |
| 54 | + } else { |
| 55 | +#if CONFIG_GMF_IO_INIT_FILE_WRITER |
| 56 | + fs_cfg.cache_size = CONFIG_GMF_IO_FILE_WRITE_CACHE_SIZE; |
| 57 | +#endif |
| 58 | + } |
| 59 | +#if SOC_SDMMC_PSRAM_DMA_CAPABLE |
| 60 | + fs_cfg.cache_caps |= MALLOC_CAP_SPIRAM; |
| 61 | +#endif |
45 | 62 | esp_gmf_io_handle_t hd = NULL; |
46 | 63 | fs_cfg.dir = dir; |
47 | 64 | ret = esp_gmf_io_file_init(&fs_cfg, &hd); |
@@ -114,6 +131,12 @@ static esp_gmf_err_t gmf_loader_setup_default_http_io(esp_gmf_pool_handle_t pool |
114 | 131 | #endif /* CONFIG_GMF_IO_INIT_HTTP_WRITER */ |
115 | 132 | } |
116 | 133 |
|
| 134 | +#ifdef CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY |
| 135 | + http_cfg.cert_pem = NULL; |
| 136 | +#elif defined(CONFIG_MBEDTLS_CERTIFICATE_BUNDLE) |
| 137 | + http_cfg.crt_bundle_attach = esp_crt_bundle_attach; |
| 138 | +#endif |
| 139 | + |
117 | 140 | ret = esp_gmf_io_http_init(&http_cfg, &hd); |
118 | 141 | ESP_GMF_RET_ON_ERROR(TAG, ret, return ret, "Failed to init http io"); |
119 | 142 | ret = esp_gmf_pool_register_io(pool, hd, NULL); |
|
0 commit comments