EFUSE read/write VDD_SDIO from user application

iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Re: EFUSE read/write VDD_SDIO from user application

Postby iosixllc » Thu Sep 14, 2017 3:00 pm

Thanks WiFive - that worked. I was at 80MHz DIO, which apparently worked at 3.3V and apparently passed the data hash checks (??) but at 40MHz it flashes and runs just fine:

make flash
Flashing binaries to serial port /COM4 (app at offset 0x10000)...
esptool.py v2.1-beta1
Connecting....
Chip is ESP32D2WDQ5 (revision 0)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 2000000
Changed.
Configuring flash size...
Compressed 13808 bytes to 9018...
Wrote 13808 bytes (9018 compressed) at 0x00001000 in 0.1 seconds (effective 1729.9 kbit/s)...
Hash of data verified.
Compressed 654560 bytes to 430950...
Wrote 654560 bytes (430950 compressed) at 0x00010000 in 4.7 seconds (effective 1106.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 106...
Wrote 3072 bytes (106 compressed) at 0x00008000 in 0.0 seconds (effective 1534.5 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...



[0;32mI (2887) heap_init: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (2888) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM[0m
[0;32mI (2890) heap_init: At 3FFB3000 len 00005000 (20 KiB): DRAM[0m
[0;32mI (2897) heap_init: At 3FFBBB28 len 00002000 (8 KiB): DRAM[0m
[0;32mI (2904) heap_init: At 3FFCE090 len 00011F70 (71 KiB): DRAM[0m
[0;32mI (2912) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM[0m
[0;32mI (2919) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (2927) heap_init: At 400951EC len 0000AE14 (43 KiB): IRAM[0m
Booting...
I (3511) wifi: wifi firmware version: 0e33bec
I (3512) wifi: config NVS flash: enabled
I (3512) wifi: config nano formating: disabled
I (3527) wifi: Init dynamic tx buffer num: 32
I (3527) wifi: Init data frame dynamic rx buffer num: 64
I (3527) wifi: Init management frame dynamic rx buffer num: 64
I (3528) wifi: Init static tx buffer num: 32
I (3529) wifi: wifi driver task: 3ffdfd98, prio:23, stack:4096
I (3530) wifi: Init static rx buffer num: 10
I (3530) wifi: Init dynamic rx buffer num: 64
I (3530) wifi: Init rx ampdu len mblock:7
I (3530) wifi: Init lldesc rx ampdu entry mblock:4
I (3531) wifi: wifi power manager task: 0x3ffe9580 prio: 21 stack: 2560
E (3532) wifi: wifi_set_chan_range 1733 ret=1
W (4094) wifi: ap start fail

I (4095) wifi: wifi timer task: 3ffea5f4, prio:22, stack:3584
I (4257) wifi: mode : softAP (18:fe:34:6c:f5:98)
I (4260) wifi: sleep disable



My next question - is it possible to check if the efuses are burned at runtime and burn them through my software? (for devices already in the field) Thanks.


iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Re: EFUSE read/write VDD_SDIO from user application

Postby iosixllc » Fri Sep 22, 2017 5:12 am

Thanks. When I set the voltage to 1.8V, everything runs just fine with 40MHz flash speed, but when I try to use my OTA WiFi-based reflash mechanism, there are a lot of write errors:

I (102562) upgrade: OTA Partition: 3FFB71BC

I (102564) upgrade: Set start address for flash writes to 0x00100000

I (105957) upgrade: Result from esp_ota_begin: 0 1

E (106820) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEE [1436]

E (106824) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDEEAE [1436]

E (106827) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6B7CF579 [1436]

E (106831) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFF67E [1436]

E (106834) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (106837) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (106841) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (106844) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (106847) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (106883) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEE [1436]

E (106886) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDEEAE [1436]

E (106890) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6BFCF579 [1436]

E (106894) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFB67E [1436]

E (106897) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (106900) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (106904) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (106906) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (106911) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (106949) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEE [1436]

E (106952) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDEEAE [1436]

E (106956) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6F7CF579 [1436]

E (106959) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFBE7E [1436]

E (106963) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (106966) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (106969) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (106972) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (106975) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (107014) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEE [1436]

E (107017) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDFEAE [1436]

E (107020) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6FFCF579 [1436]

E (107023) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFF67E [1436]

E (107026) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (107030) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (107033) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (107036) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (107039) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (107077) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEF [1436]

E (107080) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDFEAE [1436]

E (107083) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6F7CF579 [1436]

E (107086) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFB67E [1436]

E (107090) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (107093) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (107097) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (107100) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (107104) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (107142) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEF [1436]

E (107145) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDFEAE [1436]

E (107148) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6FFCF579 [1436]

E (107150) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFB67E [1436]

E (107154) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (107157) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (107159) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (107162) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (107164) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (107202) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEE [1436]

E (107205) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDEEAE [1436]

E (107208) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 63FCF579 [1436]

E (107212) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFF67E [1436]

E (107217) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (107220) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (107223) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (107226) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (107230) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (107270) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEE [1436]

E (107273) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDFEAE [1436]

E (107275) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6FFCF579 [1436]

E (107280) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFB67E [1436]

E (107283) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (107287) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (107289) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (107294) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (107297) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (107337) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEF [1436]

E (107340) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDFEAE [1436]

E (107343) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6B7CF579 [1436]

E (107347) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFF67E [1436]

E (107351) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (107354) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (107358) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (107361) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (107363) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

E (107402) upgrade: Failed to write flash at address 0x0010621F, error 0 [352] 70627566 = 707BFDEE [1436]

E (107404) upgrade: Failed to write flash at address 0x0010621F, error 0 [356] 20696E20 = 7EEDFEAE [1436]

E (107407) upgrade: Failed to write flash at address 0x0010621F, error 0 [360] 63686169 = 6FFCF579 [1436]

E (107408) upgrade: Failed to write flash at address 0x0010621F, error 0 [364] 6E290070 = FFFFF67E [1436]

E (107410) upgrade: Failed to write flash at address 0x0010621F, error 0 [368] 2D3E746F = EFFFFFEF [1436]

E (107411) upgrade: Failed to write flash at address 0x0010621F, error 0 [372] 745F6C65 = FF7F7FFF [1436]

E (107413) upgrade: Failed to write flash at address 0x0010621F, error 0 [376] 6E203D3D = 7FFFFFFF [1436]

E (107414) upgrade: Failed to write flash at address 0x0010621F, error 0 [380] 20702D3E = FFFFFFFF [1436]

E (107416) upgrade: Failed to write flash at address 0x0010621F, error 0 [384] 6C656E20 = FF656E20 [1436]

Flashing error: 0010621F

Flash error and closing socket


In this case, it got 0x621F bytes in, and then was unable to write offsets 352-384 in the incoming packet, even after 10 attempts. Note that this code works perfectly at 3.3V. I'm wondering if I need to do something to change the speed at which the esp_ota_write function is writing?? Thanks for any insights.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: EFUSE read/write VDD_SDIO from user application

Postby WiFive » Fri Sep 22, 2017 5:59 am

You mean if you then reflash it at 1.8v over uart it works fine or is there a chance the flash is damaged?

iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Re: EFUSE read/write VDD_SDIO from user application

Postby iosixllc » Fri Sep 22, 2017 6:38 am

Correct, UART flash works just fine at 1.8V and 40MHz. OTA flash at 1.8V is erroring out consistently. I'm using fresh devices just in case there is an issue with the old ones. Fresh devices without 1.8V set (@3.3V) work fine via OTA.

iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Re: EFUSE read/write VDD_SDIO from user application

Postby iosixllc » Fri Sep 22, 2017 6:58 am

If I skip the write verify and let it complete, I get this:


I (150478) upgrade: OTA Partition: 3FFB71BC

I (150480) upgrade: Set start address for flash writes to 0x00100000

I (153751) upgrade: Result from esp_ota_begin: 0 1

I (165284) esp_image: segment 0: paddr=0x00100020 vaddr=0x3f400020 size=0x13ac4 ( 80580) map

I (165323) esp_image: segment 1: paddr=0x00113aec vaddr=0x3ffc0000 size=0x033ec ( 13292)

I (165334) esp_image: segment 2: paddr=0x00116ee0 vaddr=0x40080000 size=0x00400 ( 1024)

I (165339) esp_image: segment 3: paddr=0x001172e8 vaddr=0x40080400 size=0x08d28 ( 36136)

I (165360) esp_image: segment 4: paddr=0x00120018 vaddr=0x400d0018 size=0x73b98 (474008) map

I (165569) esp_image: segment 5: paddr=0x00193bb8 vaddr=0x40089128 size=0x0c0c4 ( 49348)

I (165595) esp_image: segment 6: paddr=0x0019fc84 vaddr=0x400c0000 size=0x00000 ( 0)

E (165600) esp_image: Checksum failed. Calculated 0x36 read 0x21

I (165603) upgrade: OTA END: 3

I (165606) esp_image: segment 0: paddr=0x00100020 vaddr=0x3f400020 size=0x13ac4 ( 80580) map

I (165646) esp_image: segment 1: paddr=0x00113aec vaddr=0x3ffc0000 size=0x033ec ( 13292)

I (165659) esp_image: segment 2: paddr=0x00116ee0 vaddr=0x40080000 size=0x00400 ( 1024)

I (165664) esp_image: segment 3: paddr=0x001172e8 vaddr=0x40080400 size=0x08d28 ( 36136)

I (165686) esp_image: segment 4: paddr=0x00120018 vaddr=0x400d0018 size=0x73b98 (474008) map

I (165893) esp_image: segment 5: paddr=0x00193bb8 vaddr=0x40089128 size=0x0c0c4 ( 49348)

I (165919) esp_image: segment 6: paddr=0x0019fc84 vaddr=0x400c0000 size=0x00000 ( 0)

E (165924) esp_image: Checksum failed. Calculated 0x66 read 0x21

E (165929) upgrade: Failed to activate boot partition ota_1, error 3

Flash error and closing socket


I'm also confused why the checksums don't match between the two esp_image lines.

My theory is the read speed at 80MHz is being set inside the ESP32, but when I write at the same speed, I have a problem...

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: EFUSE read/write VDD_SDIO from user application

Postby WiFive » Fri Sep 22, 2017 7:42 am

What sdk version are you using?

iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Re: EFUSE read/write VDD_SDIO from user application

Postby iosixllc » Fri Sep 22, 2017 10:00 pm

I was using 2.1 beta, I just updated to HEAD along with the latest compiler update, and am getting the same result:

I (47010) upgrade: OTA Partition: 3FFD8E30

I (47010) upgrade: Set start address for flash writes to 0x00100000

I (50380) upgrade: Result from esp_ota_begin: 0 1

So far we have 968 bytes of the content, total 682291 bytes
Received 1436 bytes (2404/682291)

Received 1436 bytes (3840/682291)

Received 1436 bytes (5276/682291)

E (50525) upgrade: Failed to write flash at address 0x00100DFE, error 0 [1152] 02401600 = 0240F7F6 [1436]

E (50526) upgrade: Failed to write flash at address 0x00100DFE, error 0 [1156] 00000079 = DFEFACFF [1436]

E (50527) upgrade: Failed to write flash at address 0x00100DFE, error 0 [1160] 02401700 = 2240DFFA [1436]

etc... aborts.

On the right side is what came out of the read from flash, the left side is what was supposed to be written. Thanks.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: EFUSE read/write VDD_SDIO from user application

Postby WiFive » Fri Sep 22, 2017 10:54 pm

You have this enabled in your sdkconfig?
https://github.com/espressif/esp-idf/bl ... config#L16

Have you tried both DIO and QIO @40mhz?

Have you tried if an updated bootloader makes any difference?

Can you reproduce with ota example?

iosixllc
Posts: 71
Joined: Fri Mar 17, 2017 12:13 am

Re: EFUSE read/write VDD_SDIO from user application

Postby iosixllc » Sat Sep 23, 2017 5:25 am

I do have that enabled in sdkconfig. I have only tried DIO. I was not aware there is an updated boot loader - would that have come with the new esp-idf? I haven’t tried the OTA example, but I will say this code works 100% at 3.3V.

Who is online

Users browsing this forum: No registered users and 99 guests