ESP boot loop after flash (brownout)

I’m just starting to experiment with ESP32 as I have previously used NodeMCU
I did one flash and that appear to work, however after the second flash it is now it a continual boot loop.
I can only clear using

esptool.py --port COM3 erase_flash

[Jul 16 20:37:13.431] esp32_main.c:116        ESP-IDF v3.2-r6
[Jul 16 20:37:13.431] esp32_main.c:119        Boot partition: app_0; flash: 4M
[Jul 16 20:37:13.433] mg_lwip_ev_mgr.c:93     Mongoose 6.14, LwIP 2.0.3
[Jul 16 20:37:13.433] mg_ssl_if_mbedtls.c:57  mbed TLS 2.16.0-cesanta4
[Jul 16 20:37:13.434] mgos_vfs_dev.c:73       fs_0: esp32part ({"label": "fs_0"}), size 262144
[Jul 16 20:37:13.434] mgos_vfs_dev.c:73       fs_1: esp32part ({"label": "fs_1"}), size 262144
[Jul 16 20:37:13.434] mgos_vfs.c:147          /: SPIFFS @ fs_0, opts {"bs": 4096, "ps": 256, "es": 4096}
[Jul 16 20:37:13.536] mgos_vfs.c:320          /: size 233681, used: 118723, free: 114958
[Jul 16 20:37:13.652] mgos_sys_config.c:368   MAC: 3c:71:bf:79:95:7c
[Jul 16 20:37:13.652] mgos_sys_config.c:376   WDT: 30 seconds
[Jul 16 20:37:13.654] esp32_i2c_master.c:402  I2C0 init ok (SDA: 32, SCL: 33, freq: 100000)
[Jul 16 20:37:13.656] e[0;32mI (830) BTDM_INIT: BT controller compile version [74c9f57]e[0m
[Jul 16 20:37:13.658] e[0;33mW (840) phy_init: failed to load RF calibration data (0x1102), falling back to full calibratione[0m
[Jul 16 20:37:13.789]
[Jul 16 20:37:13.798] Brownout detector was triggered
[Jul 16 20:37:13.802]
[Jul 16 20:37:13.803] ets Jun  8 2016 00:22:57
[Jul 16 20:37:13.804]
[Jul 16 20:37:13.805] rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[Jul 16 20:37:13.808] configsip: 0, SPIWP:0xee
[Jul 16 20:37:13.809] clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[Jul 16 20:37:13.811] mode:DIO, clock div:1
[Jul 16 20:37:13.811] load:0x3fff0018,len:4
[Jul 16 20:37:13.811] load:0x3fff001c,len:6188
[Jul 16 20:37:13.812] load:0x40078000,len:9588
[Jul 16 20:37:13.813] load:0x40080400,len:6968
[Jul 16 20:37:13.814] entry 0x40080740
[Jul 16 20:37:13.819] e[0;32mI (29) boot: ESP-IDF v3.2-r6 2nd stage bootloadere[0m
[Jul 16 20:37:13.823] e[0;32mI (29) boot: compile time 10:33:26e[0m
[Jul 16 20:37:13.825] e[0;32mI (29) boot: Enabling RNG early entropy source...e[0m
[Jul 16 20:37:13.829] e[0;32mI (34) qio_mode: Enabling default flash chip QIOe[0m
[Jul 16 20:37:13.832] e[0;32mI (39) boot: SPI Speed      : 80MHze[0m
[Jul 16 20:37:13.842] e[0;32mI (43) boot: SPI Mode       : QIOe[0m
[Jul 16 20:37:13.844] e[0;32mI (47) boot: SPI Flash Size : 4MBe[0m
[Jul 16 20:37:13.845] e[0;32mI (51) boot: Partition Table:e[0m
[Jul 16 20:37:13.846] e[0;32mI (55) boot: ## Label            Usage          Type ST Offset   Length   Flagse[0m
[Jul 16 20:37:13.847] e[0;32mI (63) boot:  0 nvs              WiFi data        01 02 00009000 00004000 00000000e[0m
[Jul 16 20:37:13.848] e[0;32mI (71) boot:  1 otadata          OTA data         01 00 0000d000 00002000 00000000e[0m
[Jul 16 20:37:13.849] e[0;32mI (79) boot:  2 app_0            OTA app          00 10 00010000 00180000 00000000e[0m
[Jul 16 20:37:13.850] e[0;32mI (87) boot:  3 fs_0             SPIFFS           01 82 00190000 00040000 00000000e[0m
[Jul 16 20:37:13.850] e[0;32mI (96) boot:  4 app_1            OTA app          00 11 001d0000 00180000 00000000e[0m
[Jul 16 20:37:13.852] e[0;32mI (104) boot:  5 fs_1             SPIFFS           01 82 00350000 00040000 00000000e[0m
[Jul 16 20:37:13.852] e[0;32mI (112) boot: End of partition tablee[0m
[Jul 16 20:37:13.856] e[0;32mI (117) boot: OTA data 0: seq 0x00000001, st 0x10, CRC 0x157a2b85, valid? 1e[0m
[Jul 16 20:37:13.858] e[0;32mI (124) boot: OTA data 1: seq 0x00000000, st 0x00, CRC 0x00000000, valid? 0e[0m
[Jul 16 20:37:13.858] e[0;32mI (132) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x45234 (283188) mape[0m
[Jul 16 20:37:13.936] e[0;32mI (215) esp_image: segment 1: paddr=0x0005525c vaddr=0x3ffbdb60 size=0x02c0c ( 11276) loade[0m
[Jul 16 20:37:13.937] e[0;32mI (218) esp_image: segment 2: paddr=0x00057e70 vaddr=0x40080000 size=0x00400 (  1024) loade[0m
[Jul 16 20:37:13.938] e[0;32mI (222) esp_image: segment 3: paddr=0x00058278 vaddr=0x40080400 size=0x07d98 ( 32152) loade[0m
[Jul 16 20:37:13.939] e[0;32mI (240) esp_image: segment 4: paddr=0x00060018 vaddr=0x400d0018 size=0x11d5ac (1168812) mape[0m
[Jul 16 20:37:14.369] e[0;32mI (545) esp_image: segment 5: paddr=0x0017d5cc vaddr=0x40088198 size=0x0edc4 ( 60868) loade[0m
[Jul 16 20:37:14.370] e[0;32mI (564) esp_image: segment 6: paddr=0x0018c398 vaddr=0x400c0000 size=0x00034 (    52) loade[0m
[Jul 16 20:37:14.371] e[0;32mI (577) boot: Loaded app from partition at offset 0x10000e[0m
[Jul 16 20:37:14.373] e[0;32mI (577) boot: Disabling RNG early entropy source...e[0m
[Jul 16 20:37:14.374] e[0;32mI (578) cpu_start: Pro cpu up.e[0m
[Jul 16 20:37:14.374] e[0;32mI (581) cpu_start: Single core modee[0m
[Jul 16 20:37:14.376] e[0;32mI (586) heap_init: Initializing. RAM available for dynamic allocation:e[0m
[Jul 16 20:37:14.376] e[0;32mI (593) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAMe[0m
[Jul 16 20:37:14.377] e[0;32mI (599) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAMe[0m
[Jul 16 20:37:14.377] e[0;32mI (605) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAMe[0m
[Jul 16 20:37:14.377] e[0;32mI (611) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAMe[0m
[Jul 16 20:37:14.379] e[0;32mI (617) heap_init: At 3FFCFC68 len 00010398 (64 KiB): DRAMe[0m
[Jul 16 20:37:14.381] e[0;32mI (623) heap_init: At 3FFE0440 len 0001FBC0 (126 KiB): D/IRAMe[0m
[Jul 16 20:37:14.382] e[0;32mI (630) heap_init: At 40078000 len 00008000 (32 KiB): IRAMe[0m
[Jul 16 20:37:14.383] e[0;32mI (636) heap_init: At 40096F5C len 000090A4 (36 KiB): IRAMe[0m
[Jul 16 20:37:14.384] e[0;32mI (642) cpu_start: Pro cpu start user codee[0m
[Jul 16 20:37:14.384] e[0;32mI (323) cpu_start: Starting scheduler on PRO CPU.e[0m
[Jul 16 20:37:14.385]
[Jul 16 20:37:14.386]
[Jul 16 20:37:14.386] mgos_freertos.c:175     app1 1.0 (20190716-103341)

Possible power problem - brownout error triggered.

I’ve plugged in via usb so no power problem

Did you use Google at all? See if you might have these issues? Are you using a commercial dev kit? Custom board?

https://esp32.com/viewtopic.php?t=10434

I’m using a nodemcu form factor so I assume thats a Dev kit. its says ESP32-WROOM32 on chip and ESP32S on back

so am I understanding its a h/w issue? or can this be solved using s/w?

I don’t know. Saw some previous posts a while ago related. Just thought I’d mention it. Your log does show brown outs.