#ESP32 S3 setup issues

1 messages · Page 1 of 1 (latest)

thick frigate
#

Information so far:

#

time for me to go bed, will probably be back at experimenting in ~15h, thanks in advance for any feedback :)

errant swan
thick frigate
#

The issue will be getting a correct fw so it runs on my hardware, not the flashing itself, i believe

#

Will try some stuff to at least see if i can fully identify the chip tho

thick frigate
#
  elpekenin on Tuesday at 5:10 PM                                                                                                                                    0.093s  RAM: 7/16GB
  {  D:易Coding }  esptool --chip esp32s3 chip_id
esptool.py v4.6.2
Found 2 serial ports
Serial port COM10
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: -- snip --
Uploading stub...
Running stub...
Stub running...
Warning: ESP32-S3 has no Chip ID. Reading MAC instead.
MAC: -- snip --
Hard resetting via RTS pin...
#

should i worry about the no Chip ID?

#

this didnt work at all either, even tho my product's listing also states "N16R8"... https://circuitpython.org/board/yd_esp32_s3_n16r8/
open to ideas, or shall i just check out the labels on MCU, PSRAM and Flash and make some adjustments to compile a custom bin?

thick frigate
#

I did setup WSL yesterday, took a very very quick look at the build-control files and saw a couple options like "has SPI ram" and whatnot, would i only need to play around with those or perhaps write some actual code too?

thick frigate
#

okay, compared my pinout with the files for the YD board on the link right above, its almost a 1:1 match, so im hoping the PSRAM and flash also match

updated pins.c and mpconfigboard.h with the suble pin changes and the name of the board
im not too sure what i should do about mpconfigboard.mk and/or sdkconfig

#

would it even boot if i configure it as "i have no PSRAM"? would at least get one element out of the problem.. for now

#

what i managed to read:

MCU: ESP32-S3 / S12022 (batch?) / several chars (some serial number?)
Flash: Winbond 25Q128JVSQ
PSRAM: WCH CH340K (i believe, very small text) 
eternal pine
#

The CH340k chip is a USB-serial chip for converting debug UART communication to USB

thick frigate
#

oops, wrong one then

#

there's also this big AMS1117 component, but that looks like a voltage regulator to me (and very low pin count to be a PSRAM afaik)

eternal pine
#

so the two 8-pin chips are as above?

#

the chip between the two buttons is the CH340K?

thick frigate
#

yes

eternal pine
#

is there any chip on the bottom of the board

thick frigate
#

nop

#

just a couple jumpers, one for RGB im guessing

eternal pine
#

ok, so I don't think this board has any PSRAM, despite the product listing

thick frigate
#

seems like so, yeah

eternal pine
#

If you look on an UnexpectedMaker ESP32-S3 board, it has chips for flash and PSRAM.

#

This board is a lie, you can spend time getting it to work, but how much is your time worth?

#

who knows what else might be flaky about it?

#

better to buy a name-brand board

#

it's a $5 board, you have spent many hours on this already

thick frigate
#

oscillator has T400 U15U or something like that... im guessing that means 40MHz, and wouldnt need any changes

thick frigate
#

may as well just throw it out the window if i get frustrated lol

eternal pine
#

set CONFIG_ESP32S3_SPIRAM_SUPPORT=n in sdkconfig and comment out or delete all the other SPIRAM and PSRAM lines

#

in mpconfigboard.mk, the CIRCUITPY_ESP_FLASH_* constants I think are used only for makefile targets. If that is not true, of course set FLASH_SIZE to 16MB, try changing FLASH_FREQ to 40m, and try qio instead of dio. But as I said, I'm not sure these matter for the actual build

#

CIRCUITPY_ESP_FLASH_SIZE does matter, set that to 16MB. MODE and FREQ are only used as args to esptool flash commands in the Makefile

thick frigate
#

i just flashed the bootloader produced by this last compilation, how is it supposed to go in bootmode?

#

tried hold and then connect USB, double tap and pressing reset while holding boot

eternal pine
#

none of those work?

thick frigate
#

nop, some misconfig i guess

#

esptool was cool with it ```

esptool --port COM10 write_flash -z 0x0 ..\bootloader.bin
esptool.py v4.6.2
Serial port COM10
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: ec:da:3b:66:78:20
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00002fff...
Compressed 12208 bytes to 8555...
Wrote 12208 bytes (8555 compressed) at 0x00000000 in 0.2 seconds (effective 420.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

eternal pine
#

you can forget about the bootloader for now. Just load the circuitpython .bin with something like esptool.py -p /dev/ttyACM0 -b 921600 --before=default_reset --after=no_reset write_flash 0x0000

#

the bootloader built by the board build is NOT the UF2 bootloader

thick frigate
#

oh, ok

eternal pine
#

that is in a separate repo: TinyUF2

thick frigate
#

thought it was a submodule and the compilation was doing "magic"

#

allright, "trash" bootloader file that is

eternal pine
#

yes, do a full erase to get rid of the partition table

#

in the build directory, try loading firmware.bin. Do not load circuitpython-firmware.bin.

thick frigate
#

ok

eternal pine
#

firmware.bin is a combo bin that contains the second stage bootloader and circuitpython, so it can start up. circuitpython-firmware.bin is bare circuitpython

thick frigate
#

makes sense

#

but... cant find the files

eternal pine
#

ports/espressif/build-*

thick frigate
#

that's what i thought but...

#
elpekenin@elPeCenin:~/micropython/ports/espressif$ ls build-peke_esp32_s3/
autogen_display_resources-en_US.c  bindings  build-peke_esp32_s3  esp-idf  frozen_mpy  lib          peripherals  shared           shared-module
autogen_web_workflow_static.c      boards    common-hal           extmod   genhdr      manifest.py  py           shared-bindings  supervisor
eternal pine
#

are you building micropython or circuitpython?

thick frigate
#

circuit, but as i already had a fork of micro, i added a remote and checked out

#

i have to leave now, will continue messing things up tomorrow, thanks for the help so far ❤️

eternal pine
#

so did you do ports/espressif/esp-idf/export.sh, and then remove the build directory, and then do make BOARD=.... sure, ttyl 👋

thick frigate
#

i didnt remove it manually but ran make BOARD=... clean

#

perhaps that's wrong 😛

#

fixed it, leaving now (for real this time)
will flash later

Had to change CIRCUITPY_ESPCAMERA from "no" to "0" on mk

eternal pine
errant swan
#

on the right path to a custom build. 👍

thick frigate
#

yay, got a drive to show with boot_out.txt file containing: ```
Adafruit CircuitPython 8.2.0-25-ga2002e364 on 2023-07-19; WeAct ESP32S3-B-N16R8 with ESP32S3
Board ID:peke_esp32_s3
UID:...

#

there's no "CIRCUITPY" drive at all, tho

eternal pine
#

did you try the other USB port?

thick frigate
#

what does RGB flashing yellow on start mean?

thick frigate
#

other USB (labeled as UART) doesnt report any MSC

eternal pine
#

it flashes yellow for 700ms: if you click during that time it will restart into safe mode. It is not an error, just a window of opportunity

#

ok, didn't know the ports were labeled

#

if you do import os; os.listdir() does it show any files?

thick frigate
#

like, on the computer? or connecting to (if it shows up) the REPL

eternal pine
#

or can you not connect via the REPL at all?

#

yes, in the REPL

thick frigate
#

let me try

#

is there any software/command to connect without having the drive showing?

#

the VSCode extension i usually use, relies on drive name to get active

eternal pine
#

on Windows?

thick frigate
#

LED is flashing green every now and then, good sign?

thick frigate
#

do thonny/mu require a drive to show?

eternal pine
#

Mu looks for a serial port identifying as a certain name

#

when the board starts up does a new COM port appear in Device Manager->Ports?

thick frigate
#

there's a COM10. indeed

eternal pine
#

so connect to that with Tera Term

#

Tera Term is nice because it reconnects after a disconnect

thick frigate
#

if the page decides to (down)load that is

#
Adafruit CircuitPython 8.2.0-25-ga2002e364 on 2023-07-19; WeAct ESP32S3-B-N16R8 with ESP32S3
>>> import os
>>> os.listdir()
['boot_out.txt', 'System Volume Information']
``` (partial) success
eternal pine
#

try import storage; storage.erase_filesystem(). It will reboot. It's fishy there is not code.py, etc.

thick frigate
#

😭 you da best

#

do you guys have somewhere to donate (other than Github :P) or just through products? being from Spain the page is like 1/4 of the price product(s) and 3/4 shipping 😐
i buy from a spanish retailer every now and then tho

errant swan
#

Best way to support Adafruit is by purchasing products from their website.

#

Contributing your build for the WeAct ESP32-B-N16R8 is also just as appreciated.

eternal pine
eternal pine
thick frigate
#

does "R8" have something to do with the metallic enclosing on the MCU? i can see a good old black chip on mine

#

no idea what the correct name for it is...

eternal pine
#

it is "R" for "RAM" (PSRAM)

#

N16 = non-volatile storage 16MB; R8 is 8MB of PS RAM

errant swan
#

Ah another one of those mislabeled clones?

thick frigate
#

Good news, weact contacted me after posting a review, apparently the chip has 8MB embeded PSRAM, will try compiling with the config they've told me later today

thick frigate
#

i've been told: "When build the CircuitPython firmware, you may need to change the psram mode to OTC, and then try it out."

#

but can't find anything about "OTC" on the ports/espressif folder

eternal pine
#

maybe "octal"?

#

See the settings for espressif_esp32s3_devkitc_1_n32r8

#

sdkconfig, like CONFIG_SPIRAM_MODE_OCT=y

thick frigate
#

I thought OTC meant "on the chip" based on what they told md

eternal pine
#

oooh, ok

#

it's in the package, not actually on the CPU chip

thick frigate
#

How do i set it up then

#

Or is it default if i dont set the SPI config?

eternal pine
#

i think you might not have to set up

#

try what they gave youl I don't see an sdkconfig param with "OTC" in the name

thick frigate
#

They dont give anything

eternal pine
#

what is the part number on the chip?

thick frigate
eternal pine
#

based on some comments in a couple of places, I think this will use the octal connect PSRAM. I am looking in the esp-idf repo issues, etc.

#

I don't think there's a separate setting for "embedded" vs not, but instead it is how it is connected

#

so the N32R8 example above would be the closest

thick frigate
#

is there something i can use to see available RAM/check if it is connected?

#

tbh i dont even knowthe diff between PSRAM and a "regular" RAM

eternal pine
#

maybe try that on another known-working board with PSRAM too to make sure it will work

thick frigate
#

asked then on aliexpress messages, lets see if they can provide some information

thick frigate
#

I flashed another thing (dont recall exact config, and just left home) and could connect through Mu, but drive didnt show after the storage.erase

#

Saw a table on ESP32S3's datasheet about pins used for SPI into embeded flash/ram and it didnt match what all the configs that i've checked use

#

Configs use pins 26+30 but table had another values
edit: NVM, pin number vs pin name

#

PEBCAK most likely, though

#

The custom firmware i had on it could only bytearray(1024 * 1024 // 4), or was it // 8?....Definitely not 8MB anyway

thick frigate
#

Sounds about right 😎 ```py
MB_8TH = 1024 * 1024 // 8

for i in range(8 * 8):
size = int(MB_8TH * i)
try:
foo = bytearray(size)
print(f"Allocated an array of {i/8} MB")
del foo
except:
print(f"Could not allocate {i/8} MB")
break

-- Removed --
Allocated an array of 6.75 MB
Allocated an array of 6.875 MB
Allocated an array of 7.0 MB
Allocated an array of 7.125 MB
Allocated an array of 7.25 MB
Allocated an array of 7.375 MB
Could not allocate 7.5 MB

eternal pine
#

there are hundreds of clones on AliExpress, and having a bunch of duplicate boards increases our build times without adding a lot -- I'd rather point to an identical build that works.

#

but if it's different, it could be ok. Let's hold off until maybe we test the Epressif board

thick frigate
#

32 vs 16 mb flash
But yeah, having a ton of duplication + slowing things down is not the best idea ever, thus the question