Please, help me figuring out what happens with my SPIFFS. I’ve been reading a lot, but despite all theoretical knowledge I’ve ben acquiring, I can’t make things happen.
I’ve been trying to run the example program within:
just to check how do my SPIFFS partitions look like, but I’m far away of getting some reasonable result.
I really can’t go straight with this VSCode+PlatformIO. I’ve been trying hard everyday, but no result so far. What am I doing wrong?
This command finds 3 serial ports, but it tries to open only my iPhone via WirelessiAP!
How to make it target the ESP32 specifically?
Here you are:
MacBook-Pro-de-Ciro:~ cirobruno$ python /Particular/Projetos/espressif/esp32/tools/esptool.py read_flash 0x8000 0xc00 ptable.img
esptool.py v3.2-dev
Found 3 serial ports
Serial port /dev/cu.iPhoneCiro-WirelessiAP
Traceback (most recent call last):
File "/Particular/Projetos/espressif/esp32/tools/esptool.py", line 4830, in <module>
_main()
File "/Particular/Projetos/espressif/esp32/tools/esptool.py", line 4823, in _main
main()
File "/Particular/Projetos/espressif/esp32/tools/esptool.py", line 4283, in main
before=args.before)
File "/Particular/Projetos/espressif/esp32/tools/esptool.py", line 118, in get_default_connected_device
connect_attempts)
File "/Particular/Projetos/espressif/esp32/tools/esptool.py", line 364, in detect_chip
detect_port = ESPLoader(port, baud, trace_enabled=trace_enabled)
File "/Particular/Projetos/espressif/esp32/tools/esptool.py", line 323, in __init__
self._port = serial.serial_for_url(port)
File "/Users/cirobruno/Library/Python/2.7/lib/python/site-packages/serial/__init__.py", line 88, in serial_for_url
instance.open()
File "/Users/cirobruno/Library/Python/2.7/lib/python/site-packages/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/cu.iPhoneCiro-WirelessiAP: [Errno 16] Resource busy: '/dev/cu.iPhoneCiro-WirelessiAP'
I’ve read your post. And I’m really getting worried about the reliability of all that I’ve been trying to do lately.
I felt forced to switch from Arduino IDE to VSCode, BECAUSE OF SPIFFS. But now I fell like walking over mud. Nothing seems to work properly. Everything in this environment depends on a lot of terminal line commands. I just can’t focus on the application I must write itself.
I’ve installed VSCode about two years ago, but I’ve never been able to make something work, not exactly because of the code. I’ve tried to migrate working codes from Arduino, but because of this or that, they wouldn’t run in VSCode.
It’s like driving an old clunker that stops from time to time and you must open the Motorabdeckung and try to fix something. When it’s ready, you’ve already forgotten that you was supposed to catch your children at school in your way home. Too messy. They must think it over. I don’t think I should deviate my attention from the application my customer is waiting for to dedicate on improving my terminal skills.
And now, I can see consistency in your report. Maybe I shouldn’t have abandoned Arduino because of SPIFFS, but abandone VSCode and keep using Arduino IDE without SPIFFS.
By the way, I’ve been using Arduino very successfully up to Arduino Pro IDE. Then they’ve moved to Arduino IDE 2.0, writing it from scratch. Obviously it’s showing some instability. I’m seriously thinking about going back to Arduino Pro IDE or Arduino IDE 1.8.15. I’ve written several very reliable projects with these.
The problem is that I’ve got no idea of how the flash is currently partitioned. Maybe I should try it using each standard partition option at once. But it’s gonna take too long.
I guess I won’t choose the way of learning how to use menuconfig. I’ve already been for too long far away from my way to continue my project. During the last week, I’ve been exclusively trying to learn about VSCode and PlatformIO. Now I’ve got the feeling that I’ve been wasting time. I must think about some other way to continue.
I don’t like the idea of placing the web page files (HTML, CSS and JS files) on SD Card. Someone may take it away and corrupt it, or maybe some vibration causes contacting troubles. But now it looks like the best alternative I have at this moment. In my next project maybe I’m gonna choose etching another PCB with an extra flash that I can use without concerns.
You yourself choose how the flash is partitioned by giving it a partition table. The CSV tells you exactly how the flash is partitioned, with the type of the partition, start address and length fo the partition. That is the content of flash. I don’t get your question.
In ESP-IDF, menuconfig is also exactly the way how you would configure the partition table. It’s just a different command in PlatformIO to enter it. There is no added difficulty. You’ll have to do exactly the same procedure in ESP-IDF.
It found 3 serial ports and chose the wrong one – select the correct device with a -p <device name> argument.
For some reason, the device became irresponsive after my first try to save something in SPIFFS. Then I had to make a grounded GPIO0 to flash the main code again. So, I don’t thrust the partition table is uncorrupt. That’s why I’d like to take a look at it.
That it’s downloaded the contents of flash you specified into the file ptable.img. As said above
If you’ve correctly setup an application to be flashed with one particular partition table, you should get the same partition table back that you have originally set.
{MacBook-Pro-de-Ciro:210821-213148-ttgo-lora32-v21 cirobruno$ python /Particular/Projetos/espressif/esp32/tools/gen_esp32part.py /Users/cirobruno/ptable.img
Traceback (most recent call last):
File “/Particular/Projetos/espressif/esp32/tools/gen_esp32part.py”, line 550, in
main()
File “/Particular/Projetos/espressif/esp32/tools/gen_esp32part.py”, line 498, in main
table, input_is_binary = PartitionTable.from_file(args.input)
File “/Particular/Projetos/espressif/esp32/tools/gen_esp32part.py”, line 124, in from_file
data = data.decode()
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xff in position 0: ordinal not in range(128)
The script I see in the PlatformIO distribution of ESP-IDF is different. Try running it instead, located in <user home path>\.platformio\packages\framework-espidf\components\partition_table\gen_esp32part.py.
MacBook-Pro-de-Ciro:210821-213148-ttgo-lora32-v21 cirobruno$ python /Users/cirobruno/.platformio/packages/framework-espidf/components/partition_table/gen_esp32part.py /Users/cirobruno/ptable.img
Traceback (most recent call last):
File “/Users/cirobruno/.platformio/packages/framework-espidf/components/partition_table/gen_esp32part.py”, line 534, in
main()
File “/Users/cirobruno/.platformio/packages/framework-espidf/components/partition_table/gen_esp32part.py”, line 480, in main
input = input.decode()
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xff in position 0: ordinal not in range(128)