what espressif is hidding, or what AI knows and i dont

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

what espressif is hidding, or what AI knows and i dont

Postby chegewara » Sun May 18, 2025 7:47 pm

Dont get it seriously, please. I am playing with AI and this is what one LLM "told me"

So to "clarify", we should have by now
- esp32-H3 with WIFI 7 support, when we can see some samples?
- esp32-s4 - let say it is P4, so this one can be "not so hidden"
Screenshot from 2025-05-18 21-42-08.png
Screenshot from 2025-05-18 21-42-08.png (127.83 KiB) Viewed 916 times
Last edited by chegewara on Tue May 27, 2025 3:40 am, edited 2 times in total.

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: what espressif is hidding

Postby chegewara » Sun May 25, 2025 7:29 pm

I am wondering, is there any chance that espressif team could train AI LLM model specifically with esp-idf and maybe arduino-esp32 API?

Or maybe some skilled esp32 passionate is working on something like that?

Thanks

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: what espressif is hidding

Postby Sprite » Mon May 26, 2025 7:01 am

The AI actually should be trained on most of the public documentation.

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: what espressif is hidding, or what AI knows and i dont

Postby chegewara » Tue May 27, 2025 3:38 am

Yeah, but i thought about something more "specialized" with espressif API and examples. Maybe smaller LLM etc

Here is simple example code mostly generated by chatGPT. I wanted to test AI and esp32-p4 with 3D animation

https://github.com/chegewara/esp32-p4-3d-rendering
https://www.youtube.com/watch?v=jaJaxh8C8lA


PS even if its easy to write hardware agnostic code, with esp-idf API there is problem; AI is hallucinating too much, even if chatgpt has access to most recent API and examples on github AI cant write USB host code

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: what espressif is hidding, or what AI knows and i dont

Postby MicroController » Tue May 27, 2025 12:18 pm

AI is hallucinating too much, even if chatgpt has access to most recent API and examples on github AI cant write USB host code
Current AIs don't 'understand' API documentation or the like; they need to be trained via a myriad of examples. And that's the problem: If the AI had access to 1000 different example programs for ESP-IDF USB host in its training set, it could potentially generate useful code for this use case. The lack of a sufficiently large, specialized set of training data may be the major road block here.

mikemoy
Posts: 686
Joined: Fri Jan 12, 2018 9:10 pm

Re: what espressif is hidding, or what AI knows and i dont

Postby mikemoy » Wed May 28, 2025 1:06 am

even if chatgpt has access to most recent API and examples on github AI cant write USB host code
Maybe it's the AI model your using can't.
I've asked it
can you give me an example of a ESP32-S3 in IDF to act as a host
AN it spit out the code, and I copied and pasted it and worked just fine.

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: what espressif is hidding, or what AI knows and i dont

Postby chegewara » Wed May 28, 2025 1:59 am

Sure, some code chatGPT gave me was fine, some was just, let say, imagination how API should looks like.

Of course i asked another LLM to fix the code and this time LLM found which API is not espressif, but still the code didnt build even with just usb host init part.

I've asked it
can you give me an example of a ESP32-S3 in IDF to act as a host
AN it spit out the code, and I copied and pasted it and worked just fine.
May i ask which AI/LLM you are using

mikemoy
Posts: 686
Joined: Fri Jan 12, 2018 9:10 pm

Re: what espressif is hidding, or what AI knows and i dont

Postby mikemoy » Wed May 28, 2025 3:33 am

I was using GPT-4.1

I do find it a bit crazy when your working on some code and you ask one LLM to do bla.bla.bla... and it gives you the code. Then you turn around and ask another LLM to look at that code and look for issues, and it shows some, and then even a third and you get something else. My biggest issue is when they start hallucinating.

vvb333007
Posts: 71
Joined: Wed Jul 31, 2024 5:53 am
Location: Thailand
Contact:

Re: what espressif is hidding

Postby vvb333007 » Thu May 29, 2025 2:47 am

The AI actually should be trained on most of the public documentation.
Currently it is hallucinating:

My question to ChatGPT-4.1o:
Hello! I am using ESP32 to make an IoT project. Can you please give me an example, in C, which shows how to register & use a custom "panic" handler?
The reply:

Code: Select all

Key Points:
esp_set_panic_handler() registers a custom panic handler.

...
...
void app_main(void) {
    ESP_LOGI(TAG, "Registering custom panic handler...");

    // Register the custom handler
    esp_set_panic_handler(my_custom_panic_handler);

    // Simulate a crash for demonstration
    ESP_LOGI(TAG, "Triggering a crash...");
    *((int *)0) = 42;  // Intentional null pointer dereference
}
Looking good.
The only problem is that ESP-IDF does not provide functions mentioned.

In other hand it is sometimes useful: When I was asking ChaytGPT to translate a documentation from Russian to English, ChatGPT has generated examples and sample CLI dialogues which was not in the source :)
Thanks!
Slava.

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: what espressif is hidding, or what AI knows and i dont

Postby chegewara » Sat May 31, 2025 2:06 pm

Its is pretty much hallucinating, but for this kind of questions i am suggesting to use bot which you can find even on this forum.
This bot is very good for simple questions related to API and examples.

To fix, at least partially, hallucinating with LLM is good to "feed" it first with some examples, maybe headers from esp-idf or just try to avoid specific API code questions and use it for general code creating.

Either way in my case i can find AI very helpful. I can be much more productive, even if it takes some time to fix hallucinating and search for some specific API usage. Making simple components in like 2-3 days is more than i could expect. This week HID parser for all who is looking for one and the one in esp-idf feels like not enough (ive seen some questions about it).
https://components.espressif.com/compon ... ions/0.1.0

Who is online

Users browsing this forum: Baidu [Spider], Qwantbot and 7 guests