Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Upload files using FatFS (Read 144 times)
marek2
Newbies
*
Offline


Posts: 9
Joined: Jan 18th, 2013
Upload files using FatFS
Jan 19th, 2025 at 9:05pm
Print Post  
Hi,
I am trying to upload a file to ESP32S3 using FatFS. I have the data folder and a small .png in it. I am using arduino-portable and have a local partitions.csv on the same level as .ino. It looks like this:

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x640000,
app1,     app,  ota_1,   0x650000,0x640000,
storage,  data, fat,     0xc90000,0x360000,
coredump, data, coredump,0xFF0000,0x10000,


In the VM menu I have selected Partition Scheme: Custom and FileSystem Upload Tool: FileFS.
I build the project and then I click on Publish Server Data Files in VM menu.

In the VS console I get this (had to add spaces here and there to fix formatting):

ESP32FSUpload.exe
## recipe.wwwfiles.upload.pattern
"c:\program files (x86)\microsoft visual studio\2019\enterprise\common7\ide\extensions\fpbblalf.uhm/ESP32FSUpload.exe" -serial.port=COM6 -build.path="C:\Users\User\AppData\Local\Temp\VMBuilds\ESP32S3_4848S040_Clock3 \esp32_esp32s3\Debug" -target_platform="esp32" -runtime.tools.mkspiffs.path="notTheToolYoureLookingFor" -board.name="ESP32S3 Dev Module" -upload.verbose=True -upload.resetmethod={upload.resetmethod} -upload.speed=921600 -platform.path="C:\Arduino\ESP32S3_Clock3\arduino-portable\packages \esp32\hardware\esp32\3.1.1" -project.name="ESP32S3_4848S040_Clock3.ino" -project.path="C:\Arduino\ESP32S3_Clock3\ESP32S3_4848S040_Clock3" -tools.esptool.cmd="{tools.esptool.cmd}" -tools.esptool.cmd.windows="{tools.esptool.cmd.windows}" -runtime.tools.esptool.path="{runtime.tools.esptool.path}" -compiler.path="C:\Arduino\ESP32S3_Clock3\arduino-portable\packages\esp32\tools \esp-x32\2405/bin/" -build.spiffs_start="{build.spiffs_start}" -build.spiffs_end="{build.spiffs_end}" -build.spiffs_pagesize="{build.spiffs_pagesize}" -build.spiffs_blocksize="{build.spiffs_blocksize}" -build.partitions="" -network.password={network.password} -network.auth_upload={network.auth_upload} -network.port=3232 -upload.tool=esptool_py -tools.esptool_py.cmd="esptool.exe" -tools.esptool_py.cmd.windows="esptool.exe" -runtime.tools.esptool_py.path="C:\Arduino\ESP32S3_Clock3\arduino-portable\pack ages\esp32\tools\esptool_py\4.9.dev3" -build.flash_mode=dio -build.flash_freq=80m
ERROR: FATFS partitions not defined for ESP32S3 Dev Module

I also checked 

c:\Users\User\AppData\Local\Temp\VMBuilds\ESP32S3_4848S040_Clock3\esp32_esp 
32s3\Debug\partitions.csv 

and it has the same content as my local partitions.csv
« Last Edit: Jan 19th, 2025 at 9:07pm by marek2 »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: Upload files using FatFS
Reply #1 - Jan 20th, 2025 at 11:35am
Print Post  
Thanks for the report.

We will release a fix for this in the coming day, and update this thread when it is available.

In the meantime, if you select an entry from the Partitions menu it should avoid this error, but your custom partitions.csv from the project folder will still take priority over the menu entry.
« Last Edit: Jan 20th, 2025 at 11:41am by Simon@Visual Micro »  
Back to top
IP Logged
 
marek2
Newbies
*
Offline


Posts: 9
Joined: Jan 18th, 2013
Re: Upload files using FatFS
Reply #2 - Jan 20th, 2025 at 4:32pm
Print Post  
That didn't seems to help, if I pick partition scheme "16MB Flash (3MB APP, 9.9MB FATFS) the parameter changes to -build.partitions="default" and I get the same error.

I was then playing around with boards.txt, trying to add my own partition scheme in:

c:\Arduino\ESP32S3_Clock3\arduino-portable\packages\esp32\hardware\esp32\3.1.1\ tools\partitions

and then use it in:
c:\Arduino\ESP32S3_Clock3\arduino-portable\packages\esp32\hardware\esp32\3.1.1\ boards.txt 

And I noticed it has no effect on what's shown in VM partitions menu. 
I then tried to modify boards.txt in my arduino installation:

c:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.17\ boards.txt

and the menu changed (even though the project is using arduino-portable). 

When I remove my local partitions.csv I get this (with 16MB Flash (3MB APP, 9.9MB FATFS) still selected in menu):

Program too big. The size is 1467800 bytes (of a 1310720 byte maximum)

Looks like it's picking up the default esp32c3.upload.maximum_size=1310720 (from c:\Arduino\ESP32S3_Clock3\arduino-portable\packages\esp32\hardware\esp32\3.1.1\ boards.txt)
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: Upload files using FatFS
Reply #3 - Jan 20th, 2025 at 4:45pm
Print Post  
So we can check the issue seen with the menu's etc.. can you attach a full build log with the options enabled shown at the top of this page?
« Last Edit: Jan 20th, 2025 at 5:37pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: Upload files using FatFS
Reply #4 - Jan 20th, 2025 at 5:38pm
Print Post  
Reviewing the Program Size issue mentioned, the entry in boards.txt is overridden if the partitions.csv can be read from the build folder, which will be the same one you have in your project\partitions.csv (as it is copied in the pre-build hooks to the build folder).

It is done this way to ensure a custom partition setup gives the right warning on program size, without needing a custom board.txt entry.

Does this now align with the custom paritions.csv you have in use?

The initial issue with the error of not being able to identify the partitions is fixed in the latest release (25.0120.0) which can be downloaded from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
« Last Edit: Jan 20th, 2025 at 6:14pm by Simon@Visual Micro »  
Back to top
IP Logged
 
marek2
Newbies
*
Offline


Posts: 9
Joined: Jan 18th, 2013
Re: Upload files using FatFS
Reply #5 - Jan 20th, 2025 at 9:35pm
Print Post  
I have sent you an email with the build log and some screenshots.

re: program size issue, let's see what you find about the partition scheme menu first, I think it could be related to it.

For the program size issue the setup is following:
- standard arduino installation with esp 2.0.17 (under Arduino15 folder)
- project using arduino-portable with esp 3.1.1
- project DOESN'T have local partitions.csv
- all partition schemes except the "Custom" partition scheme are commented out in boards.txt in 3.1.1

When I open the arduino-portable project the VM partition scheme menu is somehow loaded from my esp 2.0.17 boards.txt and not from 3.1.1. I can see all the partition schemes from 2.0.17 instead of just the "Custom" one from 3.1.1.

Since I can see all partitions schemes, I select let's say "16MB Flash (3MB APP, 9.9MB FATFS)".

When the project is building, it's trying to find the "16MB Flash (3MB APP, 9.9MB FATFS)" partition scheme in boards.txt of 3.1.1. But since I only have the "Custom" partition scheme in boards.txt, it won't find it and the max size is defaulted to the max size for esp32s3 and then it ends up with program too big.

If I enable "16MB Flash (3MB APP, 9.9MB FATFS)" partition scheme in boards.txt of 3.1.1 the compilation ends up successfully and also reports the correct size of partition:

Program ESP32S3_4848S040_Clock3 size: 1507976 bytes (used 48% of a 3145728 byte maximum)

Also upload files using "Publish Server Data Files" then works.

So basically if I want to use/add a particular partition scheme, it has to exist in both, boards.txt under the normal arduino installation (for it to appear in the menu) and also in the boards.txt under arduino-portable (so the build can find it).
« Last Edit: Jan 20th, 2025 at 9:57pm by marek2 »  
Back to top
 
IP Logged
 
marek2
Newbies
*
Offline


Posts: 9
Joined: Jan 18th, 2013
Re: Upload files using FatFS
Reply #6 - Jan 20th, 2025 at 10:27pm
Print Post  
Simon@Visual Micro wrote on Jan 20th, 2025 at 5:38pm:
The initial issue with the error of not being able to identify the partitions is fixed in the latest release (25.0120.0) which can be downloaded from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES


I am now getting:
ERROR: FATFS partition size could not be found

Using the same local partitions.csv as in my original post and "Custom" partition scheme from the menu.

EDIT:
if I change the partition name to
ffat,     data, fat,     0xc90000,0x360000,

the upload works. I thought the name could be anything, I saw it called "storage" it some examples.
« Last Edit: Jan 20th, 2025 at 11:13pm by marek2 »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: Upload files using FatFS
Reply #7 - yesterday at 10:05am
Print Post  
Thanks for the logs and the detail around this.

While we work on the issues, if you rename the fatfs partition from storage to ffat, it should work as expected in the interim.

You are correct that the name should be irrelevant, and will be when we have fixed that issue.

Regarding the incorrect board menu options being shown (i.e. not from the arduino-portable folder), if you change the IDE selection to "Arduino 2" and reload Visual Studio it will show the correct options.  We are reviewing this and will update when this is complete.
« Last Edit: yesterday at 11:24am by Simon@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint