one binary for wroom and wrover ?
one binary for wroom and wrover ?
Is there a way to create a binary which recognizes and the supports psram, available on wrover based boards ?
And still works if there is no psram found, like wroom based boards ?
Otherwise we had to support 2 versions which ends in a lot of work/time for user and developer.
And still works if there is no psram found, like wroom based boards ?
Otherwise we had to support 2 versions which ends in a lot of work/time for user and developer.
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: one binary for wroom and wrover ?
Hmm, I don't think we have that yet... in theory, we could just add an option to skip adding PSRAM to the heap when we detect an issue with initializing PSRAM, in contrast to panic'ing as we do now. Would that work for you?
Re: one binary for wroom and wrover ?
That would be a good solution, and I would like to get it soon
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: one binary for wroom and wrover ?
I need the same thing, so I could have easier management for OTA updates.
Vader [BEN]
Vader [BEN]
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
Re: one binary for wroom and wrover ?
I've done a first simple test.
At least in my application, everything runs fine.
Its tested on a WROOM board and on a WROVER board.
Usuallly, things looking that easy to implement, have some sideeffects, ........
In components/esp32/Kconfig
And in components/esp32/cpu_start.c
At least in my application, everything runs fine.
Its tested on a WROOM board and on a WROVER board.
Usuallly, things looking that easy to implement, have some sideeffects, ........
In components/esp32/Kconfig
Code: Select all
config SPIRAM_MODE_ON_NOPSRAM
bool "Abort on no SPI RAM available"
default "y"
help
If no SPI RAM is found, startup aborts
or ignores if disabled
choice SPIRAM_USE
Code: Select all
bool psramFound = false;
.
.
.
#if CONFIG_SPIRAM_BOOT_INIT
esp_spiram_init_cache();
if (esp_spiram_init() != ESP_OK) {
#if SPIRAM_MODE_ON_NOPSRAM
ESP_EARLY_LOGE(TAG, "Failed to init external RAM!");
abort();
#else
ESP_EARLY_LOGE(TAG, "Ignored no SPI RAM found");
#endif
}
else psramFound = true;
#endif
.
.
.
#if CONFIG_SPIRAM_MEMTEST
if(psramFound){
bool ext_ram_ok=esp_spiram_test();
if (!ext_ram_ok) {
ESP_EARLY_LOGE(TAG, "External RAM failed memory test!");
abort();
}
}
#endif
.
.
.
#if CONFIG_SPIRAM_BOOT_INIT && (CONFIG_SPIRAM_USE_CAPS_ALLOC || CONFIG_SPIRAM_USE_MALLOC)
if(psramFound){
esp_err_t r=esp_spiram_add_to_heapalloc();
if (r != ESP_OK) {
ESP_EARLY_LOGE(TAG, "External RAM could not be added to heap!");
.
.
.
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: one binary for wroom and wrover ?
That is pretty similar to the merge request I have in the queue; it should be eventually merged in ESP-IDF.
Re: one binary for wroom and wrover ?
Just had the problem, that binary, based on my settings crashed on wroom.
At the end it turned out, the reason was uart_driver_delete which should "reset" an uart defined for gpio16/17 (tx,rx)
In my case it is 3rd uart, which is not used (yet), so its easy to remove.
Could there come up a problem, because ?
- gpio16/17 are available pins on wroom based boards
- gpio16/17 are used for PSRAM on wrover based boards
- something happens in esp_spiram_init_cache() or esp_spiram_init() with GPIO16/17 which is not reset in case of "no PSRAM found"
At the end it turned out, the reason was uart_driver_delete which should "reset" an uart defined for gpio16/17 (tx,rx)
In my case it is 3rd uart, which is not used (yet), so its easy to remove.
Could there come up a problem, because ?
- gpio16/17 are available pins on wroom based boards
- gpio16/17 are used for PSRAM on wrover based boards
- something happens in esp_spiram_init_cache() or esp_spiram_init() with GPIO16/17 which is not reset in case of "no PSRAM found"
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: one binary for wroom and wrover ?
That's a bug, I think. Mind making an issue for that on Github so I won't forget and we can track it?
Re: one binary for wroom and wrover ?
Tried to reproduce it in a short example and failed.
Looks like being a bug in my sources
Looks like being a bug in my sources
Who is online
Users browsing this forum: No registered users and 90 guests