Good afternoon,
I started a project on a ESP32S3 using the ESP32-S3-DevKitC-1 and created a new project using hello_world
as an example.
In the app_main, the function esp_flash_get_size is executed (It is the same in the hello_world project) using the arguments :
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
}
However, in my project, the compiler send me the error Invalid argument on this line. So I get an error in my project.
In the hello_world project, I do not have this error..
Could you please help me ??
Maybe I have to add a component or something ??
Best regards
Problem using the method esp_flash_get_size
-
- Posts: 229
- Joined: Thu Jul 14, 2022 5:15 am
Re: Problem using the method esp_flash_get_size
According to the documentation, the first argument is a `esp_flash_t *chip` where `chip` is:ThomasESP32 wrote: ↑Fri Jan 13, 2023 1:29 pmCode: Select all
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) { printf("Get flash size failed"); return; }
It says here that `chip` must be successfully initialized first by calling `esp_flash_init`. It doesn't say anything about passing a NULL.chip – Pointer to identify flash chip. Must have been successfully initialised via `esp_flash_init()`
Last edited by mbratch on Mon Jan 16, 2023 5:38 pm, edited 1 time in total.
Re: Problem using the method esp_flash_get_size
I do not think it could be a component problem but ofcouse in your CMake file you must have nvs component. Then remember to initialise the flash with esp_flash_init() or nvs_flash_init().
This could be a problem in your code.
For example wifi functions will not work without the intialization of nvs flash memory of esp as it stores calibration data.
This could be a problem in your code.
For example wifi functions will not work without the intialization of nvs flash memory of esp as it stores calibration data.
-
- Posts: 229
- Joined: Thu Jul 14, 2022 5:15 am
Re: Problem using the method esp_flash_get_size
Ok thank you,
could you please explain me how to use the esp_flash_init function ?
I have a ESP32-S3-DevKitC-1 kit, I just would like to get the flash memory available.
Do you have any example or something ?
Best regards
could you please explain me how to use the esp_flash_init function ?
I have a ESP32-S3-DevKitC-1 kit, I just would like to get the flash memory available.
Do you have any example or something ?
Best regards
Re: Problem using the method esp_flash_get_size
I guess I should have asked this initially to be sure... are you using external SPI flash component? There are different manufacturers and there are differences in the SPI commands in some cases. Thus, there's a bit of work required on your part to configure it to your specific needs. The documentation for SPI Flash API discusses this to some extent. Unfortunately, I don't see any examples from Espressif for any specific component using this API.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 117 guests