Page 1 of 1

How to custom flash command VS Code

Posted: Sun Mar 15, 2020 7:21 pm
by gunar.kroeger
I am able to build and flash my program. But I'm using a custom partition table with 2 app sections, one smaller than the other. How can I make VS Code flash into the 2nd partition instead of the first app partition it finds?

I know VS Code uses the build/flash_projects_args file, but it is automatically generated. In make I could use Makefile to add custom flash commands, how would the equivalent be for cmake in VS Code?

Thanks

Re: How to custom flash command VS Code

Posted: Mon Mar 16, 2020 11:45 am
by ESP_bignacio
What kind of custom flash commands you would like to use?

Usually for handling partitions, setting a Custom Partition CSV table in menuconfig as shown here https://docs.espressif.com/projects/esp ... tom-tables would allow you to organize the partition table as you see fit.

You could try using the partition tool in ESP-IDF https://docs.espressif.com/projects/esp ... -interface to write specific partitions for the moment, since we haven't implemented this functionality in the extension for the moment.

Re: How to custom flash command VS Code

Posted: Mon Mar 16, 2020 12:48 pm
by gunar.kroeger
This is the flash command in Makefile that I used. connectag is the main partition at 0x90000 and Updater is a small partition (other project) that takes updates the main partition with data from the SD card.

Code: Select all

fullflash:
	python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip esp32 --port COM4 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xd000 ${PWD_UPDATER}/build/ota_data_initial.bin 0x1000 ${PWD_UPDATER}/build/bootloader/bootloader.bin 0x10000 ${PWD_UPDATER}/build/ESP32_Updater.bin 0x90000 ${PWD}/build/ESP32_connectag.bin 0x8000 ${PWD_UPDATER}/build/partitions.bin
My partitions.csv is as follows:

Code: Select all

# Name,		Type,	SubType, Offset,   Size
nvs,		data,	nvs,     0x9000,  	0x4000
otadata,	data,	ota,     0xd000,  	0x2000
phy_init,	data,	phy,     0xf000,  	0x1000
ota_0,		app, 	ota_0,	0x10000, 	0x80000
ota_1,		app,	ota_1, 		   , 	0x360000
storage,	data,	spiffs, 	   ,	0x10000
Is there no way to alter the flash command, or a way to send this command in the powershell integrated to VS Code?

Re: How to custom flash command VS Code

Posted: Mon Mar 16, 2020 1:42 pm
by gunar.kroeger
ESP_bignacio wrote:
Mon Mar 16, 2020 11:45 am
You could try using the partition tool in ESP-IDF https://docs.espressif.com/projects/esp ... -interface to write specific partitions for the moment, since we haven't implemented this functionality in the extension for the moment.
The parttool.py would work for me, but how can I make PowerShell find it? I'm getting the CommandNotFoundException.

Re: How to custom flash command VS Code

Posted: Mon Mar 16, 2020 6:48 pm
by gunar.kroeger
customflasherror.png
customflasherror.png (22.92 KiB) Viewed 11511 times