espressif / vscode-esp-idf-extension

Visual Studio Code extension for ESP-IDF projects
Apache License 2.0
1.04k stars 302 forks source link

[Feature Request]: Add support for modifying Flash command with custom NVS bin (VSC-1503) #1327

Open granolocks opened 4 hours ago

granolocks commented 4 hours ago

Is your feature request related to a problem? Please describe.

I have used the NVS Partition editor to embed certs for HTTPS and MQTT rather than embedding them directly in the firmware. This is a great feature but once the nvs_data.bin file (and keys/keyfile.bin) have been generated there doesn't seem to be a way to actually flash them to the esp32 directly from within the sdk extension. I am able to get around this by manually running esptool.py however this breaks my use of the extension for flashing and so I'm going back and forth to the terminal each time I need to modify what i'm puttin in the NVS at flash time.

Describe the solution you'd like

I'd love to be able to add additional args to the flash command from within the extension itself and tell it to flash the additional files to the appropriate partitions.

Describe alternatives you've considered

I dont have any brilliant ideas except just manually scripting things. I hope I am just missing something and there is a good way to do this directly through the extension itself.

igrr commented 3 hours ago

Could you please take a look at https://github.com/espressif/esp-idf/tree/master/examples/storage/nvsgen example and see if it meets your needs? You only need to add one line to your component CMakeLists file:

https://github.com/espressif/esp-idf/blob/6e5a178b3120dced7fa5c29c655cc22ea182df3d/examples/storage/nvsgen/main/CMakeLists.txt#L8