Errors in esp_log while Compiling

nopnop2002
Posts: 112
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: Errors in esp_log while Compiling

Postby nopnop2002 » Tue Oct 15, 2024 11:25 pm

Code: Select all

#include <stdio.h>
#include <inttypes.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"

static const char *TAG = "MAIN";

void app_main()
{
    int CoreID = xPortGetCoreID();
    ESP_LOGI(TAG, "start CoreID=%d",CoreID);
    ESP_LOGI(TAG, "This is only a string");
}
>so what about this line?

No problem.

Code: Select all

$ idf.py build
Executing action: all (aliases: build)
Running ninja in directory /home/nop/rtos/test/build
Executing "ninja all"...
[1/1] cd /home/nop/rtos/test/build/boo...s/test/build/bootloader/bootloader.bin
Bootloader binary size 0x6880 bytes. 0x780 bytes (7%) free.
[8/9] Generating binary image from built executable
esptool.py v4.8.1
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
Generated /home/nop/rtos/test/build/test.bin
[9/9] cd /home/nop/rtos/test/build/esp...bin /home/nop/rtos/test/build/test.bin
test.bin binary size 0x2b6e0 bytes. Smallest app partition is 0x100000 bytes. 0xd4920 bytes (83%) free.

Project build complete. To flash, run:
 idf.py flash
or
 idf.py -p PORT flash
or
 python -m esptool --chip esp32 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/test.bin
or from the "/home/nop/rtos/test/build" directory
 python -m esptool --chip esp32 -b 460800 --before default_reset --after hard_reset write_flash "@flash_args"


Albybe
Posts: 10
Joined: Fri May 29, 2020 10:45 pm

Re: Errors in esp_log while Compiling

Postby Albybe » Wed Oct 16, 2024 12:18 am

I FOUND IT I FOUND IT!!!!

I THINK I FOUND IT!!!!

I got https_mbedtls to compile without errors!!!

WHY IT'S NOT WRITTEN BIG LETTERS IN ESPRESSIF DOCS?!?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Just put this line in the sdkconfig file in the project root directory:

CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y

!!!!!!

So, I'm dumb and ignorant and I can be wrong, but my interpretation is: "because of the fact Espressif and/or compiler and/or..I don't know who else.... made a non functioning mess in this 5 version, there is the option COMPILE LIKE WE ARE ALL GOOD PROGRAMMERS AND DO NOT PUBLISH ERROS THAT STATE THAT WE ARE NOT SO GOOD ACTUALLY". :D

Now let's see if my project compile as well with this option... but not now... now I'm tired.. I'm going for a "Martini Bianco on the rocks" ;)
UFF.... three days thinking there is something wrong in my code while it's the expressif code bugged (or someone else.. etc.) mismartching things in their libraries...
but they do not tell so they appear professionals. Guys, "errare humanum est" just tell us guys, we understand.. we all made a mess sometimes (Actually I always do! :D ) "...sed perseverare, diabolicum" :D :D

Am I wrong? ....three days fuck.... threee complete days around this bugged logging system.... (I apoligize, I could be wrong, but this is my ignorant at the moment suspect jejejjeje..)

Thanks, Albybe.
Last edited by Albybe on Wed Oct 16, 2024 12:30 am, edited 2 times in total.

Albybe
Posts: 10
Joined: Fri May 29, 2020 10:45 pm

Re: Errors in esp_log while Compiling

Postby Albybe » Wed Oct 16, 2024 12:27 am

Thank you nopnop2002 for your help, and tests, I appreciate,
thank you :) ;)

I see my ESP_LOGI(TAG, "only a string"); compiles correctly in your system (as it should do... but in mine didn't...)

Just for curiosity: (if you have time to check): do you have the line
CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y
in your sdkconfig of the project?


thanks,
Albybe.

nopnop2002
Posts: 112
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: Errors in esp_log while Compiling

Postby nopnop2002 » Wed Oct 16, 2024 12:44 am

That's strange.
I was able to build https_mbedtls example without changing anything.
My sdkconfig does not have CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS.

There may be a problem specific to esp-idf extension on VsCode.

Code: Select all

nop@Lenovo-S500:~/esp-idf/examples/protocols/https_mbedtls$ grep -rn CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS *
nop@Lenovo-S500:~/esp-idf/examples/protocols/https_mbedtls$



nop@Lenovo-S500:~/esp-idf/examples/protocols/https_mbedtls$ idf.py build
Executing action: all (aliases: build)
Running ninja in directory /home/nop/esp-idf/examples/protocols/https_mbedtls/build
Executing "ninja all"...
[1/4] cd /home/nop/esp-idf/examples/pr.../https_mbedtls/build/https_mbedtls.bin
https_mbedtls.bin binary size 0xe3be0 bytes. Smallest app partition is 0x100000 bytes. 0x1c420 bytes (11%) free.
[1/1] cd /home/nop/esp-idf/examples/pr...bedtls/build/bootloader/bootloader.bin
Bootloader binary size 0x6880 bytes. 0x780 bytes (7%) free.
[4/4] Completed 'bootloader'
Project build complete. To flash, run:
 idf.py flash
or
 idf.py -p PORT flash
or
 python -m esptool --chip esp32 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/https_mbedtls.bin
or from the "/home/nop/esp-idf/examples/protocols/https_mbedtls/build" directory
 python -m esptool --chip esp32 -b 460800 --before default_reset --after hard_reset write_flash "@flash_args"
I also verified that this option is not defined in the code below.

Code: Select all

#include <stdio.h>
#include <inttypes.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"

static const char *TAG = "MAIN";

void app_main()
{
    int CoreID = xPortGetCoreID();
    ESP_LOGI(TAG, "start CoreID=%d",CoreID);
    ESP_LOGI(TAG, "This is only a string");
#if CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS
    ESP_LOGI(TAG, "CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS");
#endif
}

Albybe
Posts: 10
Joined: Fri May 29, 2020 10:45 pm

Re: Errors in esp_log while Compiling

Postby Albybe » Wed Oct 16, 2024 1:33 am

Ok I see...

I had the same errors compiling in VsCode and outside VsCode (with . $HOME.../export.sh than idf.py flash monitor), so I think there's something more than a VsCode extension problem...

After adding that line to sdkconfig (I saw that line in an working example and copied it in https_mbedtls) https_mbedtls compiled ok and worked outside VsCode. I did not try in VsCode... I Will but I saw that VsCode is changing (deleting that line in) sdkconfig automatically when I compile throught VsCode... so I have to check that before trying.

And, all is in a NEW, (virtual) machine with Linux Mint 22, with fresh installed VsCode and VsCode espressif extension... as well as a fresh install of the v5.3.1 independent environment (outside VsCode).

Sorry actually is VsCodium the version "deMicrosoffed" but I don't think that is the problem.

I'm also using a ESP32S2 that is on my own product pcb, programmed by a ESP-PROG board... but I don't think this is the problem either, because I never reached the flashing stage because of previous compiling errors.. (in all espressif libraries that concern LOGGING) and some of that errors did not make sense like the LOGx "string_only" that does not contain any integer...

And my product board (it's in a hardware small machine) with v4.4 compile and works very well :)

I will continue investigating the thing, because I want to understand more. I'm thinking using ESP32 for some commercial products.. so I need to undestand the thing well.

:)

Thanks,
Albybe

Who is online

Users browsing this forum: Bing [Bot] and 71 guests