Open mars000 opened 1 year ago
Hi @mars000, the only obvious difference is the partition table, lolin_s3_mini
uses the default partition while lolin_s3
uses a special default_16MB
. What happens if you manually set your partition to the default one directly in the platformio.ini
file, for example:
[env:lolin_s3]
platform = espressif32@6.4.0
board = lolin_s3
framework = arduino
board_build.filesystem = littlefs
upload_port = COM8
monitor_speed = 115200
board_build.partitions = default.csv
board_build.partitions = default.csv
hi @valeros I updated and added above suggestion i.e. board_build.partitions = default.csv
but no change i.e. same serial output as I placed in original post above is displayed.
Have you tried erasing the entire flash memory? Just run pio run -t erase
directly in the IDE terminal.
thank @valeros just tried that and it did't change the output.
(flyby - I don't have the hardware involved - I'm just reading code...)
There's another difference above. One has working PSRAM and one doesn't. That MIGHT imply a misconfigured SPI clock as the SPI is used for both FLASH and RAM.
https://www.wemos.cc/en/latest/s3/s3.html Shows QSPI Flash and OSPI RAM https://www.wemos.cc/en/latest/s3/s3_mini.html is rather less detailed, but looks like a "value" board, so it may be all QSPI or even DSPI.
It's possible that setting it to the Mini uses a more conservative SPI configuration that happens to word. Maybe you have something else using a GPIO pin that's used in Octal mode, for example....
I'm talking out of my hat a little bit, having never seen these boards, but I've debugged a lot of slightly wrong ESP PSRAM configurations...
I suspect that LittleFS vs. SPIFFS is a victim and not a culprit here.
Good luck!
thanks @robertlipe for insights. Would that imply a configurstion issue in platformio profiles ? I'm just using standard config as per docs.
Could be Platformio or even esp-idf. Could be the board maker quietly changed the specs and a config that used to work doesn't.
I'm just suggesting that you widen the scope of your hunt beyond littlefs (spiffs probably also misbehaves) into the SPI configuration. I'm not at all sure they're interchangeable, but I am sure that a correctly configured board with psram won't print that message you show about psraminit failing and that may be within blast radius of why the filesystem (likely actually the underlying SPI accesses) are failing.
I could be wrong.
thank you @robertlipe @ivankravets your thoughts on this would be greatly appreciated
The main difference of the two boards json are the type of the PSRAM flash. S3 mini has QSPI and the Lolin S3 has OPI. This looks correct according to the description from the Lolin we page. Maybe in real the Lolin S3 has no OPI PSRAM? Can be verified by the mounted module on the board. Upload an highres picture and we can check.
Wrong PSRAM selection does generate Issues with Filesystem. The s3mini boards json does work since no valid PSRAM is found and it works as S3 without any PSRAM
@Jason2866 here is hi-res picture, hope it helps answer question
Mhh, the last line looks like "N16R8" regarding to the datasheet it is 16MB QSPI Flash and 8MB OPI PSRAM PR #1252 removes wrong entrys.
hello @valeros and @Jason2866 I copied your lolin_s3.json file manually (not sure how else to best updates platfromio in vsc with your changes) with your updates as noted in https://github.com/platformio/platform-espressif32/issues/1226 but still get same errors :-( Something i'm missing...this is the lolin_s3.json file
`{ "build": { "arduino": { "ldscript": "esp32s3_out.ld", "partitions": "default_16MB.csv", "memory_type": "qio_opi" }, "core": "esp32", "extra_flags": [ "-DARDUINO_LOLIN_S3", "-DBOARD_HAS_PSRAM", "-DARDUINO_USB_MODE=1", "-DARDUINO_USB_CDC_ON_BOOT=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", "hwids": [ [ "0x303A", "0x1001" ] ], "mcu": "esp32s3", "variant": "lolin_s3" }, "connectivity": [ "wifi", "bluetooth" ], "debug": { "openocd_target": "esp32s3.cfg" }, "frameworks": [ "arduino", "espidf" ], "name": "WEMOS LOLIN S3", "upload": { "flash_size": "16MB", "maximum_ram_size": 327680, "maximum_size": 16777216, "require_upload_port": true, "speed": 460800 }, "url": "https://www.wemos.cc/en/latest/s3/index.html", "vendor": "WEMOS" }
Json's theory was: "Maybe in real the Lolin S3 has no OPI PSRAM?"
Board vendors change the actual parts splashed down on parts All The Time. It's terrible, but it happens. To test that theory ...
"memorytype": "qioopi"
I'm honestly not certain which side trumps the other here, but hold that thought...
"flash_mode": "qio",
This sets the flash mode to quad. Flash on ESP32 is never > Q. I don't see a line following this like "psram_type": "opi", In theory, this would set it to octal. Experiment with adding that and/or changing it to "qio" (maybe qpi - it's hard to find accurate doc here because we're deep into the intersection of the bootloader, esptool., the boot on the chip, the signal configuration, what' actually on the board, how the various fuses are blown, the possibility of slightly broken boards, etc.
I don't have answers. I'm just telling you what you'd see if you were looking over my shoulder while I were trying to hit and miss this board - like I've had to do with so many other ESP32-S3's. It's a mess.
Citation: https://community.platformio.org/t/esp32-s3-devkitc-1-n32r8v-configuration-assistance/31967/3
Be prepared to dumpster-dive around in files inside https://github.com/platformio/platform-espressif32/tree/develop/boards ...particulularly those with "S3" in their names or descriptions.
Good luck!
RJL
@robertlipe There is some code to take care that correct and needed flash modes are set in Platformio here https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py#L45-L86 My guess, the board PSRAM is defect.
I have all S3 variants of flash / PSRAM boards. The all work well. BUT it is mandatory that every detail is correct set!
Hi @valeros @Jason2866 @robertlipe
don't think its a hardware fault on my lolin s3 board, as the exact same example code works perfectly when using Arduino IDE.
Something going on in platformio config ??
Anyway, I managed to get it going by editing/hacking thelolin_s3.json
file.
It seems it work with the lolin_s3.json
file pasted below.
any insights would be much appreciated as i know these lolin s3 cards are very popular so i'm sure others will fall into these issues as some point.
you will notice all i did is remove the following lines in "extra_flags"
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
Working lolin_s3.json
file:
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_LOLIN_S3",
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "lolin_s3"
},
"connectivity": [
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "WEMOS LOLIN S3",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.wemos.cc/en/latest/s3/index.html",
"vendor": "WEMOS"
}
This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.
What kind of issue is this?
I have a LOLIN S3 board. In
platformio.ini file
, when I compile below code usingboard = lolin_s3
and it fails to run/mount LittleFS. If I simply changeboard = lolin_s3_mini
all works perferctly.[ ] PlatformIO IDE. VSC on Windows 11
[ ] Development Platform or Board. LOLIN S3
[ ] PlatformIO Core. PlatformIO Core: 6.1.11
Configuration
Windows 11
PlatformIO Version (
platformio --version
):Description of problem
Fails when
board = lolin_s3
but works perfectly whenboard = lolin_s3_mini
inplatformio.ini
file My actual board is LOLIN_S3 for all tests.platformio.ini file:
Serial Output when board = lolin_s3 in
platformio.ini
fileSerial Output when board = lolin_s3_mini in
platformio.ini
fileSource code: main.cpp