ESP32-S3-DevKit support

Posted on
of 2
/ 2
  • Hello there!

    I tried to flash espruino on my S3 dev board, which seems to work:

    ./esptool --chip auto --port /dev/ttyUSB0 --baud 115200 --after hard_reset write_flash -z 0x1000 ../espruino_2v01.29_esp32/bootloader.bin­ 0x8000 ../espruino_2v01.29_esp32/partitions_esp­ruino.bin 0x10000 ../espruino_2v01.29_esp32/espruino_esp32­.bin  v3.2
    Serial port /dev/ttyUSB0
    Detecting chip type... ESP32-S3
    Chip is ESP32-S3
    Features: WiFi, BLE
    Crystal is 40MHz
    MAC: 7c:df:a1:e0:77:34
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Flash will be erased from 0x00001000 to 0x00004fff...
    Flash will be erased from 0x00008000 to 0x00008fff...
    Flash will be erased from 0x00010000 to 0x0015cfff...
    Compressed 15280 bytes to 10057...
    Wrote 15280 bytes (10057 compressed) at 0x00001000 in 1.1 seconds (effective 111.3 kbit/s)...
    Hash of data verified.
    Compressed 3072 bytes to 166...
    Wrote 3072 bytes (166 compressed) at 0x00008000 in 0.1 seconds (effective 393.3 kbit/s)...
    Hash of data verified.
    Compressed 1363168 bytes to 881314...
    Wrote 1363168 bytes (881314 compressed) at 0x00010000 in 78.3 seconds (effective 139.2 kbit/s)...
    Hash of data verified.
    Hard resetting via RTS pin...

    However, it does not boot:

    Build:Mar 27 2021
    rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
    Saved PC:0x40043ac8
    mode:DIO, clock div:1
    Invalid image block, can't boot.
    ets_main.c 329

    I didn't find any documentation related to ESP32-S3, so here I am asking if it's supported.

  • Maybe now that we are testing the IDF v4.x and v5.x versions we could do the build for ESP32-S3. It seems to be the successor of ESP32.

    Has anyone made any progress to start with?

    For me I need to buy the hardware first.

  • I recently received the ESP32-S3 board.

    I have done quick tests with the ESP32 IDF 4.4 toolchain. I've removed a lot of code that doesn't work with ESP32-S3 hardware.

    Finally I was able to start Espruino prompt.

    Now there is a lot of work left to review the hardware differences and create a dual version for ESP32 and ESP32-S3.

    1 Attachment

    • Screenshot_65.png
  • Oh very nice. There is also the S2 and (risc-v) C3 so even more confusion to the ESP32 mix. At least the S2 could work with your changes too? However when googling it is not actualy so easy and GPIO access is different­32uesday-the-esp32-s3-is-more-than-a-fan­cy-s2/

  • Thanks for the link, I'll read.

    The truth is that I work with ESP32 (WIFI) and Espruino (Javascript) , and I'm very happy.

    The reasons to start migrating are:

    • new chinese gadgets come with ESP32-S3
    • Two cores is very important for WIFI management without disturbing Espruino Input/Ouputs timings.
    • ESP-IDF is on version 5.x. Me at the moment in 4.4

    I think it's time to start migrating before the current ESP32 system becomes obsolete.

  • Hi, this weekend I'been working on three updates. I've upgraded the BUILD system to ESP-IDF 4.4.4 and it seems to be working fine on ESP32 and ESP32S3.

    I've also added all the WIFI code and it's working on ESP32S3. I'm now able to access it via Telnet with EspruinoWeb IDE.

    Finally, I've ordered an ESP32 S2 to be able to do some testing and add it to the build system. I've been doing some research and it's a candidate to replace the ESP8266, so it's good to have all three systems well done.

  • Do you have a fork available where we can contribute to your efforts to make Espruino work for ESP32-s3?

  • Hello, it's great. But for now, I'm working locally with a virtual machine.

    I tried to follow the current Espruino organization and build system, but I couldn't do it. I have created a new folder structure and build system that fits with ESP-IDF 4.x.

    So we can follow different paths:

    • Share the code I have as it is, and each one sets up their own system.
    • Create a repository, upload everything, and start working independently of Espruino at the begining..
    • Try to unify with the current Espruino repository, but I don't have the knowledge and time for it.

    Or any other option that is preferred, I can adapt.

  • Hello, today I received the ESP32-S2. Let's see how it works with the port I made for ESP32-S3, or if there are many things that need to be changed.

    I'll let you know once I get it.

  • Hello again. One more issue. The ESP32 S2 and S3 boards don't have a UART USB port. Instead, they use USB CDC, which means that the serial device is virtual. Therefore, the Espruino console doesn't work over the UART channel unless we connect cables and a USB-serial TTL converter.

    I have seen that Espruino already includes USB in the console, so I need to investigate how to use it.

    Let's continue...

  • Nice, hope you find time to share your work!

  • Yes, sure.
    I hope this work is the beginning to add the new ESP32-S devices into Espruino.

    Currently, I have focused on addressing all the initial issues. The main goal is to achieve a firmware that successfully boots. From here on, everyone will be able to contribute.

  • Can you share the ESP32.make file and details about ESP32 SDK setting?

  • Hello, these days i'm setting up a Github repository with the complete ESP32-S3 system.

    If you can wait a few days for me to have it ready. Hopefully, by this weekend I can have it ready and published.

    The Make file and the sdkconfig are the first two significant changes compared to the current build system of Espruino.

    Here are for you to see how different they are.

    2 Attachments

  • Thanks for sharing

  • Hello, I've created a repository with the specific version of Espruino for ESP32-S3 and ESP-IDF 4.x.
    Let's see if from here we can work to integrate it into the official Espruino repository.

  • 👍🏻

  • This is fantastic! Support for the -s3 will give long future for Espruino with WIFI requirements.
    It would be so good if this one day gets developed to the point it can be merged back into master.

    @Gordon Would you support this? Is there a route you can monetise on the s3 platform?

  • Sorry for the delay replying here - it's great to have got a build going, however I guess it might be a bit of effort to try and merge this into the current Espruino build system - we'll have to see.

    If someone were to come up with a PR that added S3 support using the existing build system (so it didn't cause big maintenance headaches when files need to be added to the build) and didn't completely screw up the existing codebase then I'd absolutely support this and merge it in.

    However getting to the point where I could support my work on ESP32 stuff is probably quite a stretch.

    I'd really love to support it (especially on stuff like the ESP32-C2), and I'm open to suggestions, but unfortunately so far there hasn't really been anything that I feel would work. One of the big attractions of the Espressif stuff has been the insanely low price of dev boards, so I can't really make money on hardware which is what I currently do for other boards.

    I originally started Espruino with the idea of providing it for existing dev boards with a freemium model (it worked for free, but there was a $1.50 fee to enable saving to flash) - but I spent a year working on it and only made $30, which is what prompted the very first KickStarter.

    So I don't know - I think even if people would pay $1.50 to unlock their boards, developers often have a lot of questions and it's not like I can afford to provide much in the way of answers for $1.50 of my time, so even then it may not be viable.

  • I understand the point, but I think it's also important for Espruino to continue supporting new Espressif chips to maintain its popularity. These chips offer remarkable power and lots of fun for people to play with. The risk of losing support for these chips will not push people to buy Espruino boards. It will just lead users to opt for alternatives like MicroPython, which already supports these new models, or just stick with old boards that Espruino support.

    Keeping Espruino working on the new hardware will increase its popularity and ensure its ongoing success and engagement with the developer community.

    Without it, it will start loosing all that bit by bit.

    I like JS, and I like the idea of writing code for ESPs in JS. But because there is no support for the new ESPs here, I just took ChatGPT and started writing code in MicroPython. And before AI, maybe that would be a problem. And maybe I would think of buying Espruino board, but today it is just too easy to do it.

    But I do look forward to Espruino supporting those chips someday :)

    Either way, I understand the business need of focusing on the get money part. And hope you will find a way to get what you want :)

  • I notice you actually started­/395499 about ESP32-C3 support, and at that point I spent a load of time getting a working ESP32-C3 build, with build info posted on that thread.

    ESP32-S3 support is pretty much there too but someone said they would contribute the relevant tweaks and never did.

    However, did you say thanks in any way? did you even go so far as to post a reply on that thread after your initial request?

    So put yourself in my position for a moment. What is the motivation here? All that work obviously didn't help to keep you engaged as you suggest, even when it was all posted on the very thread you started...

  • Hi Gordon,

    First, I want to clarify that my intention was never to offend or demotivate anyone. I greatly appreciate the effort you put into developing Espruino and supporting the community. My comments were solely a reflection of my personal feelings and experiences.

    From reading various threads in the forum, I understood that your primary focus is on generating revenue and selling Espruino boards. This makes sense from a business perspective, but it was somewhat disheartening to read that supporting ESP chips, which you seemed to view as competition, wasn't a priority for you. It felt like you were saying you would only focus on your own boards and if others wanted ESP support, they would have to implement it themselves. This perception was demotivating for me as it felt like there was no future support for these popular chips, leading me to seek alternatives.

    I want to emphasize that having support for widely-used chips like the ESP32 is crucial for attracting a large and active community to Espruino. A broad user base could potentially lead to more support and even donations from larger corporations in the future. JavaScript is very popular, and many developers, including myself, would love to use it for IoT projects on the latest hardware, not older models. People often choose the most cost-effective chips for their projects to maximize their profits, and Espruino could play a significant role by making it easier for JS developers to enter the IoT space.

    Your work is incredibly valuable, and I genuinely hope that Espruino continues to grow and support more hardware in the future. I look forward to seeing Espruino evolve and hopefully include support for new ESP chips someday.

    All I have for you is gratitude - thank you immensely for all your hard work and dedication. This project gave me lots of fun, and got me in iot which would never happen if it wasn't for you :) You let kids that know only JS to play with iot. I am just sad that you abandoned that part where Espruino is a cheap and affordable for everyone.

    Ending this answer, I would also like to share why I would buy Espruino board, and what I think would make your business part thrive:

    • reliability
    • lots of memory

    Espressif chips on boards from china are faulty. They are not perfect. They are cool to play with but lack reliability. Sometimes 3 out of 5 are ok, and the rest is connecting and disconnecting, reset itself, etc.
    If I would need to create a freezer temperature monitor for pharmacy, I would like the most reliable board and if Espruino board would be one, I would pay.
    ESP32 and ESP8266 have limited memory for code + memory operations. I tried to make AES work but got "out of memory" error and that was confusing. I guess that at some point I would buy Espruino board with wifi if there was enough memory to set up api with ui without using storage :) That would be a game changer in fun.

    Yeah,, there it is. I am still on board with all of you, just don't have skills to make Espruino work on ESP32-s3 or c6, so the easiest way for me is to find something else that works. And I just wanted to let you know about it, as a feedback. I believe that giving feedback is always in a good faith because it gives someone perspective of what people want, and why they do what they do. That's it.

    But I will definitely rush back, all in, asap, when Espruino will work on those new chips :)

  • Thanks, I appreciate it! Yes, feedback is good and I wasn't meaning to have a go at you.

    I am experimenting with ESP32C3 in products at the moment, so maybe the support will get a bit more 'first party' soon, and the way Espressif's SDK works that should translate to other Espressif boards.

    I really love the ESP32 chips - I think they're fantastic (especially the RISC-V ones), and I do want to find a way to support them properly.

    However I've found the hard way that more users is not always better...

    It can be hard to stay motivated to work on an Open Source project like Espruino - every day I have a bunch of requests/bug reports, none of which I get directly paid for, and a good proportion of those never even receive a response when they're fixed.

    I have to find a way to support ESP32 boards properly in a way that doesn't massively increase that burden. While seeing users pouring in would be nice, if more users just means more bug reports, that's not going to be much fun for me, and then I'm left wondering why I'm not just working in industry for double my current salary, with actual holidays.

  • On the business side...

    Espruino is used in I think around 4 million commercial ESP32 devices now - I don't get paid for any of those, so unfortunately popularity doesn't always pay.

    On the reliability/memory front I guess there's an option there, but realistically businesses just buy in the ESP32 modules, which will be the same ones I use so I think that's going to be a hard sell.

  • Have you considered adopting a dual licensing model? You could offer a full-functionality open-source community edition that's free for everyone, alongside a commercial license for businesses. This approach has been successfully used by others, such as LightGallery:

    By doing this, you can continue supporting the open-source community while also creating a revenue stream from commercial users who need additional features or support.

    One crucial recommendation is to avoid setting payment terms on a monthly or yearly basis, as this scares people away. Instead, consider offering lifetime or per-project licenses, which are generally more acceptable.

    If the Espruino project evolves into a highly reliable piece of software that stands out in competition with others like MicroPython, particularly by proving to run faster or offering other significant advantages, it could certainly become worth paying for.

    Feature requests (ideas) to stand in that race:

    1. MP is threading capabilities with common data store (variables can be declared in a global scope and accessed across multiple threads). MP on the ESP32-S3, which is a dual-core processor, does support real threading using the _thread module. This allows you to run threads on separate cores, enabling true parallel execution of threads.
      Would it be possible to have it in Espruino?
    2. Creating a JavaScript bytecode compiler
      MP can be compiled to bytecode:­on/tree/master/mpy-cross
      Since '.mpy' files are precompiled, MP runtime can execute them directly without the overhead of parsing and compiling the code at runtime. Have you thought of making Espruino able to execute precompiled bytecode? I guess compiling Espruino directly to machine code involves substantial complexity due to the dynamic nature of JS, but maybe creating a JS bytecode compiler would be easier? Modifying the Espruino interpreter to execute this bytecode could offer a balance between improved execution performance and manageable complexity, making it a practical enhancement for the Espruino platform.

    1 Attachment

    • lg.png
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

ESP32-S3-DevKit support

Posted by Avatar for user139530 @user139530