logo elektroda
logo elektroda
X
logo elektroda

[TG7100C][BL602] Amysen YX-WS01 Smart Plug Teardown

davidcpurdy 4239 13
ADVERTISEMENT
  • Amysen YX-WS01, FCC ID 2AOT8-WS01, module YX-X3-T71C-VER03, chip TG7100C (a clone of the BL602)

    I purchased these in Nov 2022 via Amazon.com in the US, hoping that they'd be Cloud-Cuttable, but was quickly discouraged after opening one up - the chipset was neither ESP8266 nor BK7321... and I did try to get it to go into AP mode, but no joy there. Upon closer examination, I found the chip on the Wifi module was labeled "TG7100C".

    (Note that at least five different vendors (Esicoo, Ecoey, Amysen, Tuya, Unbranded, etc.) have sold smart plugs labeled YX-WS01, but both the firmware and chipset has changed over the years. The original version was easily convertible to Tasmota and/or Tuya, then some lockdowns due to firmware changes, and then came chipset change(s).
    Amysen YX-WS01 smart plug and its packaging
    Amysen smart plug and packaging on a wooden surface. Amysen YX-WS01 smart plug with ETL and FCC certification. Interior of Amysen YX-WS01 module with visible electronic components, including a QY32F-H relay. Close-up of Amysen YX-WS01 Wi-Fi module with TG7100C chip on a PCB. Close-up of an electronic module with a chip labeled TG7100C. YX-X3-T71C-VER03 module with markings on the PCB.
    Wi-Fi module YX-X3-T71C-VER03 from 2021-02-27 with visible markings EN, RX, and VCC on a blue background. YX-X3-T71C-VER03 electronic module with TG7100C chip.

    After some digging [ https://twitter.com/madushan1000/status/1367041198851035137 ] it seems that the TG7100C is just a clone of the BL602. Evidence is in the SDK [ https://github.com/Ai-Thinker-Open/Ai-Thinker...vice_tree/chip_factory_params_IoTKitA_24M.dts ], for instance.
    /dts-v1/;
    /include/ "bl602_base.dtsi";
    // version: 17
    // last_comp_version: 16
    // boot_cpuid_phys: 0x0
    
    / {
        model = "bl bl602 IOT board";
        compatible = "bl,bl602-sample", "bl,bl602-common";
        #address-cells = <0x1>;
        #size-cells = <0x1>;
        gpio {
            #address-cells = <1>;
            #size-cells = <1>;
            max_num = <40>;
            gpio0 {                                  
                status = "okay";                     
                pin  = <5>;                          
                feature = "led";                     
                active = "Hi"; //Hi or Lo
                mode = "blink"; //blink or hearbeat
                time = <100>; //duration for this mode
            };
            gpio1 {                                  
                status = "disable";                     
                pin  = <6>;                          
                feature = "led";                     
                active = "Hi"; //Hi or Lo
                mode = "blink"; //blink or hearbeat
                time = <100>; //duration for this mode
            };
            gpio2 {
                status = "okay";
                pin = <2>;
                feature = "button";
                active = "Hi";
                mode = "multipress";
                button {
                    debounce = <10>;
                    short_press_ms {
                        start = <100>;
                        end = <3000>;
                        kevent = <2>;
                    };
                    long_press_ms {
                        start = <6000>;
                        end = <10000>;
                        kevent = <3>;
                    };
                    longlong_press_ms {
                        start = <15000>;
                        kevent = <4>;
                    };
                    trig_level = "Hi";
                };
                hbn_use = "disable";
            };
        };
        i2s {
            #address-cells = <1>;
            #size-cells = <1>;
            i2s@40017000 {
                status = "okay";
                compatible = "bl602_i2s";
                reg = <0x40017000 0x100>;
                mclk_only = "okay";
                pin {
                    mclk = <11>;
                };
            };
            i2s@40017100 {
                status = "okay";
                compatible = "bl602_i2s";
                reg = <0x40017100 0x100>;
                mclk_only = "disable";
                pin {
                    bclk = <12>;
                    fs = <29>;
                    do = <30>;
                    di = <31>;
                };
            };
        };
        i2c {
            #address-cells = <1>;
            #size-cells = <1>;
            i2c@40011000 {
                status = "okay";
                compatible = "bl602_i2c";
                reg = <0x40011000 0x100>;
                pin {
                    scl = <32>;
                    sda = <13>;
                };
                devices {
                    list_addr = <0x18 0x21>;
                    list_driver = "i2c_es8311", "i2c_gc0308>";
                };
            };
            i2c@40011100 {
                status = "disable";
                compatible = "bl602_i2c";
                reg = <0x40011100 0x100>;
                pin {
                    /*empty here*/
                };
            };
        };
        timer {
            #address-cells = <1>;
            #size-cells = <1>;
            timer@40014000 {
                status = "disable";
                compatible = "bl602_timer";
                reg = <0x40014000 0x100>;
            };
            timer@40014100 {
                status = "disable";
                compatible = "bl602_timer";
                reg = <0x40014100 0x100>;
            };
        };
        pwm {
            #address-cells = <1>;
            #size-cells = <1>;
            pwm@4000A420 {
                status = "okay";
                compatible = "bl602_pwm";
                reg = <0x4000A420 0x20>;
                path = "/dev/pwm0";
                id = <0>;
                pin = <0>;
                freq = <800000>;
                duty = <50>;
            };
            pwm@4000A440 {
                status = "disable";
                reg = <0x4000A440 0x20>;
                path = "/dev/pwm1";
                id = <1>;
                pin = <1>;
                freq = <5000>;
                duty = <50>;
            };
            pwm@4000A460 {
                status = "disable";
                reg = <0x4000A460 0x20>;
                path = "/dev/pwm2";
                id = <2>;
                pin = <2>;
                freq = <5000>;
                duty = <50>;
            };
            pwm@4000A480 {
                status = "disable";
                reg = <0x4000A480 0x20>;
                path = "/dev/pwm3";
                id = <3>;
                pin = <3>;
                freq = <5000>;
                duty = <50>;
            };
            pwm@4000A4A0 {
                status = "disable";
                reg = <0x4000A4A0 0x20>;
                path = "/dev/pwm4";
                id = <4>;
                pin = <4>;
                freq = <5000>;
                duty = <50>;
            };
        };
        ir {
            #address-cells = <1>;
            #size-cells = <1>;
            ctrltype = <0>;
            tx {
                status = "disable";
                pin = <11>;         // only support 11
                mode = "NEC";       // NEC,ExtenedNEC,RC5,SWM
                interval = <100>;   // ms
                active_mode = "Hi"; //Hi,Lo
            };
            rx {
                status = "okay";
                pin = <12>;         // only support 12 13
                mode = "NEC";       // NEC,ExtenedNEC,RC5,SWM
                active_mode = "Hi"; //Hi,Lo
                data_check = <2>;   //bit 0:check cmd, bit 1:check addr
            };
        };
        uart {
            #address-cells = <1>;
            #size-cells = <1>;
            uart@4000A000 {
                status = "okay";
                id = <0>;
                compatible = "bl602_uart";
                path = "/dev/ttyS0";
                baudrate = <2000000>;
                pin {
                    rx = <7>;
                    tx = <16>;
                };
                buf_size {
                    rx_size = <512>;
                    tx_size = <512>;
                };
                feature {
                    tx = "okay";
                    rx = "okay";
                    cts = "disable";
                    rts = "disable";
                };
            };
            uart@4000A100 {
                status = "okay";
                id = <1>;
                compatible = "bl602_uart";
                path = "/dev/ttyS1";
                baudrate = <115200>;
                pin {
                    rx = <3>;
                    tx = <4>;
                };
                buf_size {
                    rx_size = <512>;
                    tx_size = <512>;
                };
                feature {
                    tx = "okay";
                    rx = "okay";
                    cts = "disable";
                    rts = "disable";
                };
            };
        };
        spi {
            #address-cells = <1>;
            #size-cells = <1>;
            spi@4000F000 {
                status = "okay";         /* okay disable */
                mode = "master";
                reg = <0x4000F000 0x100>;   /* 4KB */
                path = "/dev/spi0";
                port = <0>;
                polar_phase = <1>;                 /* 0,1,2,3 */
                freq = <6000000>;
                pin {
                    clk = <3>;
                    cs = <2>;
                    mosi = <1>;
                    miso = <0>;
                };
                dma_cfg {
                    tx_dma_ch = <2>;
                    rx_dma_ch = <3>;
                };
            };
        };
        gpip {
            #address-cells = <1>;
            #size-cells = <1>;
            adc_key {
                status = "disable";
                pin = <9>;
                interrupt  = <3>;
                key_vol = <0 100 400 300 500>;
                key_pcb = "SW1", "SW2", "SW3", "SW4","SW5";
                key_event = "Usr1", "Usr2", "Start", "Up", "Down";
                key_raw = <1 2 3 4 5>;
            };
        };
        qspi {
            #address-cells = <1>;
            #size-cells = <1>;
            qspi@4000A000 {
                status = "disable";
                reg = <0x4000A000 0x1000>;/* 4KB */
            };
        };
        wifi {
            #address-cells = <1>;
            #size-cells = <1>;
            region {
                country_code = <86>;
            };
            mac {
                mode = "MBF";
                sta_mac_addr = [C8 43 57 82 73 40];
                ap_mac_addr = [C8 43 57 82 73 02];
            };
            sta {
                ssid = "yourssid";
                pwd = "yourapssword";
                auto_connect_enable = <0>;
            };
            ap {
                ssid = "bl_test_005";
                pwd = "12345678";
                ap_channel = <11>;
                auto_chan_detect = "disable";
            };
            brd_rf {
                xtal_mode = "MF";
                xtal = <36 36 0 60 60>;
                /*
                pwr_table = <   4 3 3 186
                                4 3 4 176
                                4 3 5 167
                                3 3 0 159
                                3 3 1 149
                                3 3 2 140
                                3 3 3 129
                                3 3 4 119
                                3 3 5 110
                                2 3 0 101
                                2 3 1 91
                                2 3 2 82
                                2 3 3 72
                                2 3 4 62
                                2 3 5 52
                                1 3 3 10>;
                */
                pwr_mode = "bf";//B: only use power offset in EFUSE; b: use power offset in EFUSE with incremental mode; F: only use power offset in Flash; f: use power offset in Flash with incremental mode
                pwr_table_11b = <20 20 20 18>;//1Mbps 2Mbps 5.5Mbps 11Mbps
                pwr_table_11g = <18 18 18 18 18 18 14 14>; //6Mbps 9Mbps 12Mbps 18MBps 24Mbps 36Mbps 48Mbps 54Mbps
                pwr_table_11n = <18 18 18 18 18 16 14 14>; //MCS0 MCS1 MCS2 MCS3 MCS4 MCS5 MCS6 MCS7
                pwr_offset = <10 10 10 10 10 10 10 10 10 10 10 10 10 10>;//due to the limit of current DTC, negative value is used. So we work around by adding all the poweroffset with 10. so 8 represents -2; 10 represents 0; 13 represents 3
            };
            rf_temp {
                en_tcal = <0>;
                linear_or_follow = <1>;
                Tchannels       = <2412 2427 2442 2457 2472>;
                Tchannel_os     = <180  168  163  160  157>;
                Tchannel_os_low = <199  186  170  165  160>;
                Troom_os        = <255>;
                //negative value is NOT supported. So we use '256' for 0, '255' for -1, '257' for 1,'511' for 256
            };
        };
        bluetooth {
            #address-cells = <1>;
            #size-cells = <1>;
            brd_rf {
                pwr_table_ble = <13>;  //range:-3~15dbm; if set -3, please set 253 here
            };
        };
    };


    In order to flash it, I had to do a teardown and solder/connect it via UART/serial, Bouffalo Labs flasher.

    ==========================================================

    After removing module, connecting it via Bouffalo Lab Dev Cube w/ FTDI USB adapter:
    [00:14:07.525] - serial type is general
    [00:14:07.580] - Open COM3 Success
    [00:14:14.238] - start-----------hal
    [00:14:14.242] - [MTD] >>>>>> Hanlde info Dump >>>>>>
    [00:14:14.245] -       name PARAM2
    [00:14:14.247] -       id 0
    [00:14:14.250] -       offset 001fc000(2080768)
    [00:14:14.253] -       size 00002000(8Kbytes)
    [00:14:14.256] -       xip_addr 00000000
    [00:14:14.259] - [MTD] <<<<<< Hanlde info End <<<<<<
    [00:14:14.261] - Read slot:0
    [00:14:14.264] - No written slot found
    [00:14:14.266] - [BL] [SEC] TRNG Handler
    [00:14:14.310] - 1th channel,lo_vco_freq_cw=146
    [00:14:14.312] - 2th channel,lo_vco_freq_cw=145
    [00:14:14.315] - 3th channel,lo_vco_freq_cw=144
    [00:14:14.319] - 4th channel,lo_vco_freq_cw=142
    [00:14:14.322] - 5th channel,lo_vco_freq_cw=141
    [00:14:14.324] - 6th channel,lo_vco_freq_cw=140
    [00:14:14.327] - 7th channel,lo_vco_freq_cw=139
    [00:14:14.330] - 8th channel,lo_vco_freq_cw=138
    [00:14:14.333] - 9th channel,lo_vco_freq_cw=136
    [00:14:14.336] - 10th channel,lo_vco_freq_cw=135
    [00:14:14.338] - 11th channel,lo_vco_freq_cw=134
    [00:14:14.345] - 12th channel,lo_vco_freq_cw=133
    [00:14:14.347] - 13th channel,lo_vco_freq_cw=132
    [00:14:14.352] - 14th channel,lo_vco_freq_cw=130
    [00:14:14.355] - 15th channel,lo_vco_freq_cw=129
    [00:14:14.359] - 16th channel,lo_vco_freq_cw=128
    [00:14:14.363] - 17th channel,lo_vco_freq_cw=127
    [00:14:14.366] - 18th channel,lo_vco_freq_cw=126
    [00:14:14.369] - 19th channel,lo_vco_freq_cw=124
    [00:14:14.374] - 20th channel,lo_vco_freq_cw=123
    [00:14:14.377] - 21th channel,lo_vco_freq_cw=122
    [00:14:14.381] - 0th channel,vco_idac_cw=10
    [00:14:14.383] - 1th channel,vco_idac_cw=10
    [00:14:14.386] - 2th channel,vco_idac_cw=10
    [00:14:14.391] - 3th channel,vco_idac_cw=9
    [00:14:14.393] - 4th channel,vco_idac_cw=9
    [00:14:14.395] - 5th channel,vco_idac_cw=9
    [00:14:14.399] - 6th channel,vco_idac_cw=9
    [00:14:14.402] - 7th channel,vco_idac_cw=9
    [00:14:14.404] - 8th channel,vco_idac_cw=9
    [00:14:14.409] - 9th channel,vco_idac_cw=9
    [00:14:14.411] - 10th channel,vco_idac_cw=9
    [00:14:14.415] - 11th channel,vco_idac_cw=9
    [00:14:14.417] - 12th channel,vco_idac_cw=9
    [00:14:14.420] - 13th channel,vco_idac_cw=9
    [00:14:14.425] - 14th channel,vco_idac_cw=9
    [00:14:14.426] - 15th channel,vco_idac_cw=9
    [00:14:14.430] - 16th channel,vco_idac_cw=7
    [00:14:14.433] - 17th channel,vco_idac_cw=7
    [00:14:14.435] - 18th channel,vco_idac_cw=9
    [00:14:14.440] - 19th channel,vco_idac_cw=8
    [00:14:14.442] - 20th channel,vco_idac_cw=8
    [00:14:14.444] - LO locked 9 135
    [00:14:14.447] - rosdac_i_gc3=25
    [00:14:14.449] - rosdac_i_gc2=25
    [00:14:14.451] - rosdac_i_gc1=25
    [00:14:14.456] - rosdac_i_gc0=25
    [00:14:14.457] - rosdac_q_gc3=36
    [00:14:14.458] - rosdac_q_gc2=36
    [00:14:14.460] - rosdac_q_gc1=36
    [00:14:14.464] - rosdac_q_gc0=36
    [00:14:14.468] - rbb_cap1_fc_i=26,rbb_cap2_fc_i=26,rbb_cap1_fc_q=26,rbb_cap2_fc_q=26
    [00:14:14.475] - new rbb_cap1_fc_i=50,rbb_cap2_fc_i=50,rbb_cap1_fc_q=50,rbb_cap2_fc_q=50
    [00:14:14.477] - LO locked 9 135
    [00:14:14.481] - amp=128,step=32,adc_mean_i=40
    [00:14:14.483] - amp=160,step=16,adc_mean_i=61
    [00:14:14.485] - amp=176,step=8,adc_mean_i=72
    [00:14:14.490] - amp=184,step=4,adc_mean_i=77
    [00:14:14.492] - amp=188,step=2,adc_mean_i=80
    [00:14:14.495] - amp=190,step=1,adc_mean_i=82
    [00:14:14.500] - amp=191,step=0,adc_mean_i=82
    [00:14:14.504] - tmx_cs=0, tmxcs_pwr_avg=27251, tmxcs_pwr_avg>>10=26
    [00:14:14.509] - tmx_cs=1, tmxcs_pwr_avg=35585, tmxcs_pwr_avg>>10=34
    [00:14:14.513] - tmx_cs=2, tmxcs_pwr_avg=46982, tmxcs_pwr_avg>>10=45
    [00:14:14.519] - tmx_cs=3, tmxcs_pwr_avg=60930, tmxcs_pwr_avg>>10=59
    [00:14:14.523] - tmx_cs=4, tmxcs_pwr_avg=76030, tmxcs_pwr_avg>>10=74
    [00:14:14.527] - tmx_cs=5, tmxcs_pwr_avg=83497, tmxcs_pwr_avg>>10=81
    [00:14:14.533] - tmx_cs=6, tmxcs_pwr_avg=78475, tmxcs_pwr_avg>>10=76
    [00:14:14.536] - tmx_cs=7, tmxcs_pwr_avg=64380, tmxcs_pwr_avg>>10=62
    [00:14:14.543] - tmx_cs_max=5, tmxcs_pwr_max=83497, tmxcs_pwr_max>>10=81
    [00:14:14.546] - amp=256,step=64,adc_mean_i=-165
    [00:14:14.550] - amp=320,step=32,adc_mean_i=-72
    [00:14:14.553] - amp=352,step=16,adc_mean_i=-21
    [00:14:14.555] - amp=368,step=8,adc_mean_i=2
    [00:14:14.557] - amp=376,step=4,adc_mean_i=15
    [00:14:14.563] - amp=380,step=2,adc_mean_i=22
    [00:14:14.564] - amp=382,step=1,adc_mean_i=23
    [00:14:14.566] - amp=383,step=0,adc_mean_i=27
    [00:14:14.572] - tosdac_i=28,tosdac_q=38,tx_iq_gain_comp=1013,tx_iq_phase_comp=-6
    [00:14:14.575] - amp=256,step=64,adc_mean_i=31
    [00:14:14.578] - amp=320,step=32,adc_mean_i=91
    [00:14:14.583] - amp=352,step=16,adc_mean_i=123
    [00:14:14.586] - amp=368,step=8,adc_mean_i=141
    [00:14:14.588] - amp=376,step=4,adc_mean_i=149
    [00:14:14.591] - amp=380,step=2,adc_mean_i=153
    [00:14:14.597] - amp=382,step=1,adc_mean_i=156
    [00:14:14.599] - amp=383,step=0,adc_mean_i=156
    [00:14:14.606] - tosdac_i=29,tosdac_q=39,tx_iq_gain_comp=1016,tx_iq_phase_comp=-2
    [00:14:14.610] - amp=256,step=64,adc_mean_i=87
    [00:14:14.614] - amp=320,step=32,adc_mean_i=130
    [00:14:14.616] - amp=352,step=16,adc_mean_i=154
    [00:14:14.621] - amp=368,step=8,adc_mean_i=166
    [00:14:14.624] - amp=376,step=4,adc_mean_i=172
    [00:14:14.626] - amp=380,step=2,adc_mean_i=176
    [00:14:14.632] - amp=382,step=1,adc_mean_i=177
    [00:14:14.635] - amp=383,step=0,adc_mean_i=178
    [00:14:14.642] - tosdac_i=25,tosdac_q=44,tx_iq_gain_comp=1004,tx_iq_phase_comp=3
    [00:14:14.645] - amp=272,step=68,adc_mean_i=40
    [00:14:14.649] - amp=340,step=34,adc_mean_i=137
    [00:14:14.651] - amp=374,step=17,adc_mean_i=190
    [00:14:14.656] - amp=391,step=8,adc_mean_i=218
    [00:14:14.661] - tosdac_i=24,tosdac_q=40,tx_iq_gain_comp=1004,tx_iq_phase_comp=-1
    [00:14:14.665] - amp=224,step=56,adc_mean_i=132
    [00:14:14.667] - amp=280,step=28,adc_mean_i=195
    [00:14:14.672] - tosdac_i=23,tosdac_q=37,tx_iq_gain_comp=1000,tx_iq_phase_comp=6
    [00:14:14.677] - amp=272,step=68,adc_mean_i=140
    [00:14:14.679] - amp=340,step=34,adc_mean_i=205
    [00:14:14.682] - tosdac_i=20,tosdac_q=37,tx_iq_gain_comp=990,tx_iq_phase_comp=4
    [00:14:14.688] - amp=288,step=72,adc_mean_i=130
    [00:14:14.692] - amp=360,step=36,adc_mean_i=191
    [00:14:14.695] - amp=396,step=18,adc_mean_i=223
    [00:14:14.699] - tosdac_i=28,tosdac_q=42,tx_iq_gain_comp=992,tx_iq_phase_comp=-1
    [00:14:14.705] - amp=304,step=76,adc_mean_i=142
    [00:14:14.708] - amp=380,step=38,adc_mean_i=208
    [00:14:14.714] - tosdac_i=29,tosdac_q=40,tx_iq_gain_comp=994,tx_iq_phase_comp=5
    [00:14:14.718] - [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    [00:14:14.725] - ------ set default key 4201cf08, key ptr 00000000
    [00:14:14.728] - ------ set default key 4201d2e0, key ptr 00000000
    [00:14:14.729] - td_init
    [00:14:14.733] - td_reset idx=0
    [00:14:14.738] - td_reset idx=1
    [00:14:14.742] - [WF] country code CN used, num of channel 13
    [00:14:14.743] - Enable BMX IRQ
    [00:14:14.751] - [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    [00:14:14.756] - ------ set default key 4201cf08, key ptr 00000000
    [00:14:14.759] - ------ set default key 4201d2e0, key ptr 00000000
    [00:14:14.760] - td_init
    [00:14:14.761] - td_reset idx=0
    [00:14:14.762] - td_reset idx=1
    [00:14:14.771] - [WF] country code CN used, num of channel 13
    [00:14:14.772] - wifi init success!!
    [00:14:14.773] - [000311] kv version:1.0
    [00:14:14.779] - [000312] aos framework init.
    [00:14:14.781] - -Welcome to AliOS Things-
    [00:14:14.784] - [prt] log level set as: [ 3 ]
    [00:14:14.791] - --------Firmware info--------
    [00:14:14.794] - app: smart_outlet,  board: tg7100cevb
    [00:14:14.795] - Host: feige
    [00:14:14.796] - Branch:
    [00:14:14.797] - Hash:
    [00:14:14.805] - Date: Aug  5 2021 14:53:55
    [00:14:14.807] - Kernel: AOS-R-1.3.4
    [00:14:14.809] - LinkKit: 2.3.0_FY_1.6.6-8
    [00:14:14.814] - APP: app-1.6.6-20210805.145355
    [00:14:14.816] - Region env: SINGAPORE-ONLINE
    [00:14:14.822] - [MTD] >>>>>> Hanlde info Dump >>>>>>
    [00:14:14.824] -       name media
    [00:14:14.825] -       id 0
    [00:14:14.830] -       offset 001c5000(1855488)
    [00:14:14.832] -       size 00002000(8Kbytes)
    [00:14:14.835] -       xip_addr 231b4000
    [00:14:14.840] - [MTD] <<<<<< Hanlde info End <<<<<<
    [00:14:14.843] - version = ver0.0.1
    [00:14:14.846] - KV = ProductKey:a1JG8An8ORa
    [00:14:14.849] - KV = DeviceName:703e971ed91c
    [00:14:14.852] - [000333] pk[a1JG8An8ORa]
    [00:14:14.857] - [000333] dn[703e971ed91c]
    [00:14:14.860] - [000338]<W> try secured ap config!
    [00:14:14.865] - [000342]<E> no valied ap config found!


    Flashing the removed module worked fine, and here is a template for it:

    {
      "vendor": "Amysen",
      "bDetailed": "0",
      "name": "Amysen Wifi Smart Plug YX-WS01",
      "chip": "BL602",
      "board": "YX-X3-T71C-VER03",
      "pins": {
        "1": "LED_n;1",
        "12": "Rel;1",
        "16": "Btn;1"
      },
      "keywords": [
        "plug",
        "relay",
        "TG7100C"
      ],
      "image": "https://obrazki.elektroda.pl/9135692300_1704034050.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=20886589"
    }
    
    

    Cool? Ranking DIY
    About Author
    davidcpurdy
    Level 7  
    Offline 
    davidcpurdy wrote 22 posts with rating 2. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20886030
    p.kaczmarek2
    Moderator Smart Home
    That's a nice find, how does the boot log from this device looks like?

    Isn't IO8 a 'BOOT' pin on BL602?

    Have you watched BL602 guides?


    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20886589
    davidcpurdy
    Level 7  
    Success finally! The problem was partly with the power supply. After sorting that out, I did get it to flash. Transcript below, showing first the tail end of an unsuccessful flash, then a successful one:
    
    [17:53:15.612] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [17:53:15.614] - clean buf
    [17:53:15.723] - send sync
    [17:53:15.831] - ack is b''
    [17:53:15.832] - retry
    [17:53:16.111] - tx rx and power off, press the machine!
    [17:53:16.113] - cutoff time is 0.1
    [17:53:16.221] - power on tx and rx
    [17:53:17.036] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [17:53:17.038] - clean buf
    [17:53:17.149] - send sync
    [17:53:17.260] - ack is b''
    [17:53:17.261] - retry
    [17:53:17.264] - shake hand fail
    [17:53:17.265] - ########################################################################
    [17:53:17.267] - 请按照以下描述排查问题:
    [17:53:17.268] - GPIO8是否上拉到板子自身的3.3V,而不是外部的3.3V
    [17:53:17.268] - GPIO7(RX)是否连接到USB转串口的TX引脚
    [17:53:17.270] - GPIO16(TX)是否连接到USB转串口的RX引脚
    [17:53:17.271] - 在使用烧录软件进行烧录前,是否在GPIO8拉高的情况下,使用Reset/Chip_En复位了芯片
    [17:53:17.273] - 烧录软件所选择的COM口,是否是连接芯片的串口
    [17:53:17.274] - 烧录软件上选择的波特率是否是USB转串口支持的波特率
    [17:53:17.276] - 3.3V供电是否正常
    [17:53:17.277] - 板子供电电流是否正常(烧录模式下,芯片耗电电流5-7mA)
    [17:53:17.278] - ########################################################################
    [17:53:17.279] - shake hand fail
    [17:53:17.388] - Load helper bin time cost(ms): 2997.153564453125
    [17:53:17.389] - {"ErrorCode": "0003","ErrorMsg":"BFLB LOAD HELP BIN FAIL"}
    [17:53:17.389] - Burn Retry
    [17:53:17.390] - 0
    [17:53:17.391] - Burn return with retry fail
    [17:53:23.597] - [param]
    interface_type = "Uart"
    comport_uart = "COM3"
    speed_uart = "1000000"
    speed_jlink = "1000"
    bl60x_brd = "IoTKitA"
    bl60x_xtal = "40M"
    aes_key = ""
    aes_iv = ""
    addr = "0x0"
    
    [check_box]
    partition_download = true
    boot2_download = true
    bin_download = true
    media_download = false
    use_romfs = false
    mfg_download = false
    ro_params_download = true
    ckb_erase_all = "False"
    encrypt = false
    download_single = false
    
    [input_path]
    pt_bin_input = "C:\\flash_tool\\bl602\\partition\\partition_cfg_2M.toml"
    boot2_bin_input = "C:\\flash_tool\\bl602\\builtin_imgs\\blsp_boot2.bin"
    cfg2_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    meida_bin_input = ""
    romfs_dir_input = ""
    mfg_bin_input = ""
    img_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    [17:53:23.605] - ========= Interface is Uart =========
    [17:53:23.620] - eflash loader bin is eflash_loader_40m.bin
    [17:53:23.630] - ========= chip flash id: ef4015 =========
    [17:53:23.649] - Update flash cfg finished
    [17:53:23.653] - create partition.bin, pt_new is True
    [17:53:23.660] - bl60x_fw_boot_head_gen xtal: 40M
    [17:53:23.666] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [17:53:23.667] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [17:53:23.671] - Created file len:176
    [17:53:23.678] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [17:53:23.682] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [17:53:23.687] - Created file len:128
    [17:53:23.697] - ========= sp image create =========
    [17:53:23.701] - Image hash is b'c5e2ce515a5783ac80efdd4910238a466572f882b53b3284e63c763e1da9847f'
    [17:53:23.701] - Header crc: b'52b188af'
    [17:53:23.702] - Write flash img
    [17:53:23.717] - bl60x_fw_boot_head_gen xtal: 40M
    [17:53:23.729] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [17:53:23.731] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [17:53:23.735] - Created file len:176
    [17:53:23.742] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [17:53:23.746] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [17:53:23.750] - Created file len:128
    [17:53:23.760] - ========= sp image create =========
    [17:53:23.774] - Image hash is b'cfdf4c95b160ea8cec9683daf4275917971ee5b248f91a5333f7c9943edb219d'
    [17:53:23.775] - Header crc: b'fc461dee'
    [17:53:23.776] - Write flash img
    [17:53:23.799] - FW Header is 176, 3920 still needed
    [17:53:23.801] - FW OTA bin header is Done. Len is 4096
    [17:53:24.273] - FW OTA bin is Done. Len is 762336
    [17:53:25.675] - FW OTA xz is Done
    [17:53:25.677] - ========= eflash loader config =========
    [17:53:25.883] - =========C:\flash_tool\bl602\device_tree/bl_factory_params_IoTKitA_40M.dts ——> bl602/device_tree/ro_params.dtb=========
    [17:53:26.263] - Version: bflb_eflash_loader_v2.0.0
    [17:53:26.264] - Program Start
    [17:53:26.265] - ========= eflash loader cmd arguments =========
    chipname : None
    chipid : False
    usage : False
    flash : True
    efuse : False
    write : True
    erase : False
    read : False
    none : False
    port : COM3
    baudrate : None
    config : None
    interface : None
    xtal : None
    start : None
    end : None
    addr : None
    mac : None
    file : None
    data : None
    mass : None
    loadstr : None
    loadfile : None
    userarea : None
    csvfile : None
    csvaddr : None
    para : None
    aeskey : None
    aesiv : None
    key : None
    ecdh : False
    echo : False
    auto : False
    version : False
    [17:53:26.330] - Config file: C:\flash_tool\bl602\eflash_loader/eflash_loader_cfg.ini
    [17:53:26.335] - serial port is COM3
    [17:53:26.336] - chiptype: bl602
    [17:53:26.337] - ========= Interface is Uart =========
    [17:53:26.338] - com speed: 1000000
    [17:53:26.338] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [17:53:26.339] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [17:53:26.340] - ========= load eflash_loader.bin =========
    [17:53:26.340] - Load eflash_loader.bin via uart
    [17:53:26.341] - ========= image load =========
    [17:53:26.616] - tx rx and power off, press the machine!
    [17:53:26.617] - cutoff time is 0.1
    [17:53:26.725] - power on tx and rx
    [17:53:27.539] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [17:53:27.540] - clean buf
    [17:53:27.649] - send sync
    [17:53:27.869] - ack is b'4f4b'
    [17:53:27.917] - shake hand success
    [17:53:27.933] - get_boot_info
    [17:53:27.944] - data read is b'010000000000000003000000911507cf0eb41a00'
    [17:53:27.946] - sign is 0 encrypt is 0
    [17:53:27.980] - segcnt is 1
    [17:53:28.008] - segdata_len is 30192
    [17:53:28.104] - 4080/30192
    [17:53:28.200] - 8160/30192
    [17:53:28.296] - 12240/30192
    [17:53:28.392] - 16320/30192
    [17:53:28.488] - 20400/30192
    [17:53:28.584] - 24480/30192
    [17:53:28.679] - 28560/30192
    [17:53:28.727] - 30192/30192
    [17:53:28.743] - Run img
    [17:53:28.874] - Load helper bin time cost(ms): 2533.1416015625
    [17:53:28.985] - ========= flash read jedec ID =========
    [17:53:28.986] - Flash load shake hand
    [17:53:28.988] - clean buf
    [17:53:29.097] - send sync
    [17:53:29.317] - ack is b'4f4b'
    [17:53:29.367] - Read flash jedec ID
    [17:53:29.369] - readdata:
    [17:53:29.370] - b'ef401500'
    [17:53:29.371] - Finished
    [17:53:29.373] - Program operation
    [17:53:29.374] - Dealing Index 0
    [17:53:29.376] - ========= programming bl602/img_create/whole_img_boot2.bin to 0x00000000
    [17:53:29.377] - ========= flash load =========
    [17:53:29.379] - ========= flash erase =========
    [17:53:29.381] - Erase flash  from 0x0 to 0xb98f
    [17:53:29.703] - Erase time cost(ms): 320.8662109375
    [17:53:29.757] - decompress flash load 22164
    [17:53:29.783] - Load 2048/22164 {"progress":9}
    [17:53:29.815] - Load 4096/22164 {"progress":18}
    [17:53:29.847] - Load 6144/22164 {"progress":27}
    [17:53:29.879] - Load 8192/22164 {"progress":36}
    [17:53:29.911] - Load 10240/22164 {"progress":46}
    [17:53:29.943] - Load 12288/22164 {"progress":55}
    [17:53:29.975] - Load 14336/22164 {"progress":64}
    [17:53:30.007] - Load 16384/22164 {"progress":73}
    [17:53:30.039] - Load 18432/22164 {"progress":83}
    [17:53:30.071] - Load 20480/22164 {"progress":92}
    [17:53:30.103] - Load 22164/22164 {"progress":100}
    [17:53:30.103] - Load 22164/22164 {"progress":100}
    [17:53:30.104] - Write check
    [17:53:30.118] - Flash load time cost(ms): 412.99853515625
    [17:53:30.119] - Finished
    [17:53:30.122] - Sha caled by host: 194e180166ca945012e261580c23e9a181fb3d34a9e1a50c54d0dd649754a400
    [17:53:30.123] - xip mode Verify
    [17:53:30.151] - Read Sha256/47504
    [17:53:30.152] - Flash xip readsha time cost(ms): 17.797607421875
    [17:53:30.153] - Finished
    [17:53:30.167] - Sha caled by dev: 194e180166ca945012e261580c23e9a181fb3d34a9e1a50c54d0dd649754a400
    [17:53:30.168] - Verify success
    [17:53:30.168] - Dealing Index 1
    [17:53:30.168] - ========= programming bl602/partition/partition.bin to 0xe000
    [17:53:30.169] - ========= flash load =========
    [17:53:30.170] - ========= flash erase =========
    [17:53:30.170] - Erase flash  from 0xe000 to 0xe10f
    [17:53:30.215] - Erase time cost(ms): 44.010986328125
    [17:53:30.231] - Load 272/272 {"progress":100}
    [17:53:30.231] - Load 272/272 {"progress":100}
    [17:53:30.232] - Write check
    [17:53:30.246] - Flash load time cost(ms): 30.404052734375
    [17:53:30.247] - Finished
    [17:53:30.248] - Sha caled by host: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [17:53:30.248] - xip mode Verify
    [17:53:30.279] - Read Sha256/272
    [17:53:30.280] - Flash xip readsha time cost(ms): 17.572509765625
    [17:53:30.281] - Finished
    [17:53:30.295] - Sha caled by dev: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [17:53:30.295] - Verify success
    [17:53:30.296] - Dealing Index 2
    [17:53:30.296] - ========= programming bl602/partition/partition.bin to 0xf000
    [17:53:30.296] - ========= flash load =========
    [17:53:30.297] - ========= flash erase =========
    [17:53:30.298] - Erase flash  from 0xf000 to 0xf10f
    [17:53:30.343] - Erase time cost(ms): 44.630859375
    [17:53:30.358] - Load 272/272 {"progress":100}
    [17:53:30.359] - Load 272/272 {"progress":100}
    [17:53:30.360] - Write check
    [17:53:30.375] - Flash load time cost(ms): 29.97900390625
    [17:53:30.376] - Finished
    [17:53:30.377] - Sha caled by host: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [17:53:30.378] - xip mode Verify
    [17:53:30.407] - Read Sha256/272
    [17:53:30.408] - Flash xip readsha time cost(ms): 17.177001953125
    [17:53:30.409] - Finished
    [17:53:30.422] - Sha caled by dev: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [17:53:30.423] - Verify success
    [17:53:30.423] - Dealing Index 3
    [17:53:30.424] - ========= programming bl602/img_create/whole_img.bin to 0x10000
    [17:53:30.425] - ========= flash load =========
    [17:53:30.427] - ========= flash erase =========
    [17:53:30.428] - Erase flash  from 0x10000 to 0xca1df
    [17:53:33.317] - Erase time cost(ms): 2887.86376953125
    [17:53:34.069] - decompress flash load 405536
    [17:53:34.100] - Load 2048/405536 {"progress":0}
    [17:53:34.132] - Load 4096/405536 {"progress":1}
    [17:53:34.164] - Load 6144/405536 {"progress":1}
    [17:53:34.196] - Load 8192/405536 {"progress":2}
    [17:53:34.228] - Load 10240/405536 {"progress":2}
    [17:53:34.260] - Load 12288/405536 {"progress":3}
    [17:53:34.292] - Load 14336/405536 {"progress":3}
    [17:53:34.324] - Load 16384/405536 {"progress":4}
    [17:53:34.356] - Load 18432/405536 {"progress":4}
    [17:53:34.388] - Load 20480/405536 {"progress":5}
    [17:53:34.420] - Load 22528/405536 {"progress":5}
    [17:53:34.452] - Load 24576/405536 {"progress":6}
    [17:53:34.484] - Load 26624/405536 {"progress":6}
    [17:53:34.516] - Load 28672/405536 {"progress":7}
    [17:53:34.548] - Load 30720/405536 {"progress":7}
    [17:53:34.580] - Load 32768/405536 {"progress":8}
    [17:53:34.612] - Load 34816/405536 {"progress":8}
    [17:53:34.644] - Load 36864/405536 {"progress":9}
    [17:53:34.676] - Load 38912/405536 {"progress":9}
    [17:53:34.708] - Load 40960/405536 {"progress":10}
    [17:53:34.740] - Load 43008/405536 {"progress":10}
    [17:53:34.772] - Load 45056/405536 {"progress":11}
    ...
    [17:53:40.371] - Load 403456/405536 {"progress":99}
    [17:53:40.403] - Load 405504/405536 {"progress":99}
    [17:53:40.435] - Load 405536/405536 {"progress":100}
    [17:53:40.436] - Load 405536/405536 {"progress":100}
    [17:53:40.436] - Write check
    [17:53:40.451] - Flash load time cost(ms): 7131.568115234375
    [17:53:40.452] - Finished
    [17:53:40.466] - Sha caled by host: 42408f5dc71a397041dc5646ee47ec7c058faeebf96b8c92adaf3dab75853335
    [17:53:40.467] - xip mode Verify
    [17:53:40.563] - Read Sha256/762336
    [17:53:40.565] - Flash xip readsha time cost(ms): 82.000732421875
    [17:53:40.567] - Finished
    [17:53:40.579] - Sha caled by dev: 42408f5dc71a397041dc5646ee47ec7c058faeebf96b8c92adaf3dab75853335
    [17:53:40.581] - Verify success
    [17:53:40.583] - Dealing Index 4
    [17:53:40.583] - ========= programming bl602/device_tree/ro_params.dtb to 0x1f8000
    [17:53:40.584] - ========= flash load =========
    [17:53:40.585] - ========= flash erase =========
    [17:53:40.586] - Erase flash  from 0x1f8000 to 0x1f9729
    [17:53:40.658] - Erase time cost(ms): 71.89013671875
    [17:53:40.670] - decompress flash load 1640
    [17:53:40.690] - Load 1640/1640 {"progress":100}
    [17:53:40.690] - Load 1640/1640 {"progress":100}
    [17:53:40.691] - Write check
    [17:53:40.722] - Flash load time cost(ms): 62.9697265625
    [17:53:40.722] - Finished
    [17:53:40.723] - Sha caled by host: 4fd42b104897efb92f6a396b4e15193b842fd35a4463dacd20f2ea64ff354634
    [17:53:40.724] - xip mode Verify
    [17:53:40.754] - Read Sha256/5930
    [17:53:40.755] - Flash xip readsha time cost(ms): 17.00146484375
    [17:53:40.755] - Finished
    [17:53:40.770] - Sha caled by dev: 4fd42b104897efb92f6a396b4e15193b842fd35a4463dacd20f2ea64ff354634
    [17:53:40.771] - Verify success
    [17:53:40.772] - Program Finished
    [17:53:40.772] - All time cost(ms): 14507.55615234375
    [17:53:40.985] - [All Success]
    



    Screenshot of the OpenBL602 control panel with three buttons: Config, Restart, and Launch Web Application.


    One oddity is that it came up as 192.168.169.1, rather than the expected 192.168.4.1. Not sure why this was.

    Here is the wiring diagram for UART access, showing Ground, 3.3VDC (actually VCC input), TX, RX and Boot. :
    UART wiring diagram with labeled connection points

    In the end, the process for this was essentially identical to that for regular BL602. Good luck!


    ======================

    A working pin map:

    "1": "LED_n;1",
    "12": "Rel;1",
    "16": "Btn;1"
  • #4 20890067
    davidcpurdy
    Level 7  
    @p.kaczmarek2

    Question: How much better is the CH340G over the older FTDI ttl-232r-3v3?

    With the CH340G, do I need separate PSU to supply the 3.3VDC to the board? If so, is it a high-quality PSU?

    Currently struggling to flash the next TG7100C while it is still on the main board (instead of removing it), using the FDTI serial device which has worked well for 12 years. I thought maybe it was weak, but I tried another FTDI (newer) with same failure. On the other hand, I know it must work OK more or less because I flashed a Sonoff S40 (different since its module has a 5VDC input for power to supply to board).

    The TG100C board I'm using does NOT have the 5VDC input pad, so I can't treat it like the Sonoff's BL602

    Repeatedly getting handshake failure...
    [12:30:34.745] - [param]
    interface_type = "Uart"
    comport_uart = "COM5"
    speed_uart = "1000000"
    speed_jlink = "1000"
    bl60x_brd = "IoTKitA"
    bl60x_xtal = "40M"
    aes_key = ""
    aes_iv = ""
    addr = "0x0"
    
    [check_box]
    partition_download = true
    boot2_download = true
    bin_download = true
    media_download = false
    use_romfs = false
    mfg_download = false
    ro_params_download = true
    ckb_erase_all = "False"
    encrypt = false
    download_single = false
    
    [input_path]
    pt_bin_input = "C:\\flash_tool\\bl602\\partition\\partition_cfg_2M.toml"
    boot2_bin_input = "C:\\flash_tool\\bl602\\builtin_imgs\\blsp_boot2.bin"
    cfg2_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    meida_bin_input = ""
    romfs_dir_input = ""
    mfg_bin_input = ""
    img_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    [12:30:34.761] - ========= Interface is Uart =========
    [12:30:34.776] - eflash loader bin is eflash_loader_40m.bin
    [12:30:34.776] - ========= chip flash id: ef4015 =========
    [12:30:34.807] - Update flash cfg finished
    [12:30:34.807] - create partition.bin, pt_new is True
    [12:30:34.807] - bl60x_fw_boot_head_gen xtal: 40M
    [12:30:34.823] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [12:30:34.823] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [12:30:34.823] - Created file len:176
    [12:30:34.839] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [12:30:34.839] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [12:30:34.839] - Created file len:128
    [12:30:34.854] - ========= sp image create =========
    [12:30:34.854] - Image hash is b'c5e2ce515a5783ac80efdd4910238a466572f882b53b3284e63c763e1da9847f'
    [12:30:34.854] - Header crc: b'52b188af'
    [12:30:34.854] - Write flash img
    [12:30:34.870] - bl60x_fw_boot_head_gen xtal: 40M
    [12:30:34.870] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [12:30:34.870] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [12:30:34.886] - Created file len:176
    [12:30:34.886] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [12:30:34.886] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [12:30:34.886] - Created file len:128
    [12:30:34.901] - ========= sp image create =========
    [12:30:34.917] - Image hash is b'cfdf4c95b160ea8cec9683daf4275917971ee5b248f91a5333f7c9943edb219d'
    [12:30:34.917] - Header crc: b'fc461dee'
    [12:30:34.917] - Write flash img
    [12:30:34.948] - FW Header is 176, 3920 still needed
    [12:30:34.948] - FW OTA bin header is Done. Len is 4096
    [12:30:35.354] - FW OTA bin is Done. Len is 762336
    [12:30:36.479] - FW OTA xz is Done
    [12:30:36.479] - ========= eflash loader config =========
    [12:30:36.620] - =========C:\flash_tool\bl602\device_tree/bl_factory_params_IoTKitA_40M.dts ——> bl602/device_tree/ro_params.dtb=========
    [12:30:37.042] - Version: bflb_eflash_loader_v2.0.0
    [12:30:37.042] - Program Start
    [12:30:37.042] - ========= eflash loader cmd arguments =========
    chipname : None
    chipid : False
    usage : False
    flash : True
    efuse : False
    write : True
    erase : False
    read : False
    none : False
    port : COM5
    baudrate : None
    config : None
    interface : None
    xtal : None
    start : None
    end : None
    addr : None
    mac : None
    file : None
    data : None
    mass : None
    loadstr : None
    loadfile : None
    userarea : None
    csvfile : None
    csvaddr : None
    para : None
    aeskey : None
    aesiv : None
    key : None
    ecdh : False
    echo : False
    auto : False
    version : False
    [12:30:37.104] - Config file: C:\flash_tool\bl602\eflash_loader/eflash_loader_cfg.ini
    [12:30:37.104] - serial port is COM5
    [12:30:37.104] - chiptype: bl602
    [12:30:37.104] - ========= Interface is Uart =========
    [12:30:37.104] - com speed: 1000000
    [12:30:37.104] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [12:30:37.104] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [12:30:37.104] - ========= load eflash_loader.bin =========
    [12:30:37.104] - Load eflash_loader.bin via uart
    [12:30:37.104] - ========= image load =========
    [12:30:37.401] - tx rx and power off, press the machine!
    [12:30:37.401] - cutoff time is 0.1
    [12:30:37.510] - power on tx and rx
    [12:30:38.325] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [12:30:38.325] - clean buf
    [12:30:38.435] - send sync
    [12:30:38.544] - ack is b''
    [12:30:38.544] - retry
    [12:30:38.825] - tx rx and power off, press the machine!
    [12:30:38.825] - cutoff time is 0.1
    [12:30:38.934] - power on tx and rx
    [12:30:39.747] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [12:30:39.747] - clean buf
    [12:30:39.856] - send sync
    [12:30:39.966] - ack is b''
    [12:30:39.966] - retry
    [12:30:39.966] - shake hand fail
    [12:30:39.966] - ########################################################################
    [12:30:39.966] - 请按照以下描述排查问题:
    [12:30:39.966] - GPIO8是否上拉到板子自身的3.3V,而不是外部的3.3V
    [12:30:39.966] - GPIO7(RX)是否连接到USB转串口的TX引脚
    [12:30:39.966] - GPIO16(TX)是否连接到USB转串口的RX引脚
    [12:30:39.966] - 在使用烧录软件进行烧录前,是否在GPIO8拉高的情况下,使用Reset/Chip_En复位了芯片
    [12:30:39.966] - 烧录软件所选择的COM口,是否是连接芯片的串口
    [12:30:39.966] - 烧录软件上选择的波特率是否是USB转串口支持的波特率
    [12:30:39.966] - 3.3V供电是否正常
    [12:30:39.966] - 板子供电电流是否正常(烧录模式下,芯片耗电电流5-7mA)
    [12:30:39.966] - ########################################################################
    [12:30:39.966] - shake hand fail
    [12:30:40.091] - Load helper bin time cost(ms): 2986.41748046875
    [12:30:40.091] - {"ErrorCode": "0003","ErrorMsg":"BFLB LOAD HELP BIN FAIL"}
    [12:30:40.091] - Burn Retry
    [12:30:40.091] - 0
    [12:30:40.091] - Burn return with retry fail
    
  • Helpful post
    #5 20890115
    p.kaczmarek2
    Moderator Smart Home
    I would say that you need to either use an external 3.3V LDO regulator or a board that has such LDO regulator, if there is no AMS1117-3.3-like LDO regulator on your board, then it will not work.

    This board, for example:
    USB to TTL adapter with pins 5V, VCC, 3V3, TXD, RXD, and GND. USB to TTL adapter with a transparent casing.
    it has pin 3.3V, but it's only for voltage levels selection, it's not a good 3.3V current source. There is no good LDO on this board.

    On the other hand, Arduino board, or NodeMCU board, has a good 3.3V source available so if you use it with MCU put in RESET state, you can flash BK that way
    Helpful post? Buy me a coffee.
  • #6 20890605
    davidcpurdy
    Level 7  

    OK, I think I'm beginning to see a difference in the way these Amysen devices behave, versus the Sonoff S40. When I would power on the Sonoff S40 with a power supply, it gave a strong click, and the LEDs lit crisply. On the Amysen devices, the same or better power supply gives only a faint click, and the LED flickers and then comes on. Both are behaviors from the modules while still installed on the mainboard, not removed.

    My intuition is that the Amysen devices draw significantly more amperage than the Sonoff, and that I need a stronger PSU.

    It was not a problem flashing the Amysen's module when removed from the board, but I'd really like to not have to do that all the time. (That's a considerable amount of time to take it apart...).

    @p.kaczmarek2, is it a common problem that the modules are harder to flash while installed on the mainboard in comparison to when removed?
  • Helpful post
    #7 20890688
    p.kaczmarek2
    Moderator Smart Home
    @davidcpurdy I am usually desoldering modules from the main board for flashing, it's always a good practice. Sometimes the capacitance on the main board is so high that connecting power directly from USB (5V) to the onboard LDO causes USB port to overload (there is 500mA limit) and resets the USB driver, which breaks connection. This, of course, applies only to BK7231 because BK7231 requires power off/on cycle just before flashing.
    For BL602, I am not sure how could that affect flashing, I haven't flashed that much BL602 devices, they are very rare. Still, it's good to make sure that you can provide enough current for your board.
    Helpful post? Buy me a coffee.
  • #8 20891424
    davidcpurdy
    Level 7  
    @p.kaczmarek2 :

    1. Is a buck converter generally enough to step down, say 6VDC to 3.3VDC? Is the LDO absolutely necessary to get ride of any variation in that voltage (ie. like spikes, ripples)?

    The buck converter I'm using is < https://www.amazon.com/gp/product/B014Y3OT6Y/..._sc_act_title_1?smid=A12MRQC2NA7LMA&psc=1 > , since I had a few left over after converting my Roomba's to Wifi/MQTT.

    I'm wondering if the FTDI Serial converter is less stable than the CH340G (which should arrive in a day or two).


    2. I posted a template at the very bottom of the first post of thread. Does it look complete and correct to you? I was unsure about the "bDetailed" entry. I tried to use the http://host-ip/app? "Import" tool, to validate the template, but it seems to throw an error at the end of that process... Removing the LFS commands does stop the error, but not sure how to finish this up...
    Screenshot of OBK template configuration tool with a script execution error.
  • ADVERTISEMENT
  • #9 20891465
    p.kaczmarek2
    Moderator Smart Home
    The buck converter you mention supports 3A output current which is way more than any Tuya WiFi module may even require. This should work, altough I'd always make sure to put a decoupling capacitor at the WiFi module VDD just to be sure and follow the generic manufacturer's guidelines.

    Your template looks good, I have added it now, thanks:
    https://github.com/OpenBekenIOT/webapp/commit/34c6c7eb3c02983ef44d597bc7009767dde12662
    The flags value is not crucial and bDetailed flag is for featuring a detailed teardown articles with step by step guide.
    Helpful post? Buy me a coffee.
  • #10 20891736
    davidcpurdy
    Level 7  
    OK, just checking my own sanity here... Desoldering/disassembling the plug leads from the board to get access to the solder joints for the Wifi Module is a pain, but the upside is that flashing the removed Wifi Module is super reliable with the buck converter I mentioned. It flashed on my first try.

    Of note, I had to interconnect my ground leads ( PSU & TTL-232R-3V3) in order for it to boot properly, otherwise, it was in a boot loop. Details:

    ==================
    Connect
    TX - RX
    RX - TX
    PSU 3.3VDC - VDD/3.3VDC on module
    TTL-232R GRD - PSU GRD - GRD on module
    PSU 3.3VDC - 10k ohm - Boot on module
    ==================

    Start up the Bouffalo Lab Dev Cube 1.4.8 flashing app, and check your configuration (Factory Params, Partition, Boot2 bin, Firmware).

    Turn on PSU, and flash (Create & Download) .

    Output from UART log/window is below:
    --------Firmware info--------
    app: smart_outlet,  board: tg7100cevb
    Host: feige
    Branch: 
    Hash: 
    Date: Aug  5 2021 14:53:55
    Kernel: AOS-R-1.3.4
    LinkKit: 2.3.0_FY_1.6.6-8
    APP: app-1.6.6-20210805.145355
    Region env: SINGAPORE-ONLINE
    [13:41:50.931] - [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name media
          id 0
          offset 001c5000(1855488)
          size 00002000(8Kbytes)
          xip_addr 231b4000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    version = ver0.0.1
    KV = ProductKey:a1JG8An8ORa
    KV = DeviceName:703e971e048b
    [000339]<A> pk[a1JG8An8ORa]
    
    [000339]<A> dn[703e971e048b]
    
    [000346]<W> try secured ap config!
    
    [000352]<E> no valied ap conf 
    [13:41:51.598] - start-----------hal
    
    [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name PARAM2
          id 0
          offset 001fc000(2080768)
          size 00002000(8Kbytes)
          xip_addr 00000000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    Read slot:0
    No written slot found
    
    [BL] [SEC] TRNG Handler
    [13:41:51.707] - 1th channel,lo_vco_freq_cw=158
    2th channel,lo_vco_freq_cw=156
    3th channel,lo_vco_freq_cw=155
    4th channel,lo_vco_freq_cw=154
    5th channel,lo_vco_freq_cw=152
    6th channel,lo_vco_freq_cw=151
    7th channel,lo_vco_freq_cw=150
    8th channel,lo_vco_freq_cw=148
    9th channel,lo_vco_freq_cw=147
    10th channel,lo_vco_freq_cw=146
    11th channel,lo_vco_freq_cw=145
    12th channel,lo_vco_freq_cw=143
    13th channel,lo_vco_freq_cw=142
    14th channel,lo_vco_freq_cw=141
    15th channel,lo_vco_freq_cw=140
    16th channel,lo_vco_freq_cw=138
    17th channel,lo_vco_freq_cw=137
    18th channel,lo_vco_freq_cw=136
    19th channel,lo_vco_freq_cw=135
    20th channel,lo_vco_freq_cw=133
    21th channel,lo_vco_freq_cw=132
    0th channel,vco_idac_cw=9
    1th channel,vco_idac_cw=8
    2th channel,vco_idac_cw=8
    3th channel,vco_idac_cw=8
    4th channel,vco_idac_cw=8
    5th channel,vco_idac_cw=8
    6th channel,vco_idac_cw=8
    7th channel,vco_idac_cw=8
    8th channel,vco_idac_cw=8
    9th channel,vco_idac_cw=8
    10th channel,vco_idac_cw=8
    11th channel,vco_idac_cw=7
    12th channel,vco_idac_cw=7
    13th channel,vco_idac_cw=7
    14th channel,vco_idac_cw=7
    15th channel,vco_idac_cw=7
    16th channel,vco_idac_cw=7
    17th channel,vco_idac_cw=7
    18th channel,vco_idac_cw=7
    19th channel,vco_idac_cw=7
    20th channel,vco_idac_cw=7
    LO locked 9 146
    rosdac_i_gc3=31
    rosdac_i_gc2=31
    rosdac_i_gc1=31
    rosdac_i_gc0=31
    rosdac_q_gc3=36
    rosdac_q_gc2=36
    rosdac_q_gc1=36
    rosdac_q_gc0=36
    rbb_cap1_fc_i=29,rbb_cap2_fc_i=29,rbb_cap1_fc_q=29,rbb_cap2_fc_q=29
    new rbb_cap1_fc_i=53,rbb_cap2_fc_i=53,rbb_cap1_fc_q=53,rbb_cap2_fc_q=53
    LO locked 9 146
    amp=128,step=32,adc_mean_i=29
    amp=160,step=16,adc_mean_i=47
    amp=176,step=8,adc_mean_i=57
    amp=184,step=4,adc_mean_i=62
    amp=188,step=2,adc_mean_i=64
    amp=190,step=1,adc_mean_i=66
    amp=191,step=0,adc_mean_i=66
    tmx_cs=0, tmxcs_pwr_avg=15611, tmxcs_pwr_avg>>10=15
    tmx_cs=1, tmxcs_pwr_avg=23059, tmxcs_pwr_avg>>10=22
    tmx_cs=2, tmxcs_pwr_avg=33222, tmxcs_pwr_avg>>10=32
    tmx_cs=3, tmxcs_pwr_avg=46705, tmxcs_pwr_avg>>10=45
    tmx_cs=4, tmxcs_pwr_avg=60567, tmxcs_pwr_avg>>10=59
    tmx_cs=5, tmxcs_pwr_avg=67626, tmxcs_pwr_avg>>10=66
    tmx_cs=6, tmxcs_pwr_avg=61574, tmxcs_pwr_avg>>10=60
    tmx_cs=7, tmxcs_pwr_avg=48069, tmxcs_pwr_avg>>10=46
    tmx_cs_max=5, tmxcs_pwr_max=67626, tmxcs_pwr_max>>10=66
    amp=256,step=64,adc_mean_i=-225
    amp=320,step=32,adc_mean_i=-142
    amp=352,step=16,adc_mean_i=-95
    amp=368,step=8,adc_mean_i=-74
    amp=376,step=4,adc_mean_i=-60
    amp=380,step=2,adc_mean_i=-54
    amp=382,step=1,adc_mean_i=-53
    amp=383,step=0,adc_mean_i=-51
    tosdac_i=31,tosdac_q=31,tx_iq_gain_comp=989,tx_iq_phase_comp=-22
    amp=256,step=64,adc_mean_i=5
    amp=320,step=32,adc_mean_i=56
    amp=352,step=16,adc_mean_i=83
    amp=368,step=8,adc_mean_i=97
    amp=376,step=4,adc_mean_i=105
    amp=380,step=2,adc_mean_i=107
    amp=382,step=1,adc_mean_i=110
    amp=383,step=0,adc_mean_i=111
    tosdac_i=31,tosdac_q=32,tx_iq_gain_comp=989,tx_iq_phase_comp=-24
    amp=256,step=64,adc_mean_i=68
    amp=320,step=32,adc_mean_i=103
    amp=352,step=16,adc_mean_i=122
    amp=368,step=8,adc_mean_i=132
    amp=376,step=4,adc_mean_i=137
    amp=380,step=2,adc_mean_i=140
    amp=382,step=1,adc_mean_i=141
    amp=383,step=0,adc_mean_i=142
    tosdac_i=36,tosdac_q=34,tx_iq_gain_comp=988,tx_iq_phase_comp=-26
    amp=272,step=68,adc_mean_i=7
    amp=340,step=34,adc_mean_i=97
    amp=374,step=17,adc_mean_i=146
    amp=391,step=8,adc_mean_i=170
    amp=399,step=4,adc_mean_i=182
    amp=403,step=2,adc_mean_i=188
    amp=405,step=1,adc_mean_i=189
    amp=406,step=0,adc_mean_i=191
    tosdac_i=32,tosdac_q=34,tx_iq_gain_comp=982,tx_iq_phase_comp=-27
    amp=224,step=56,adc_mean_i=113
    amp=280,step=28,adc_mean_i=166
    amp=308,step=14,adc_mean_i=194
    tosdac_i=33,tosdac_q=33,tx_iq_gain_comp=969,tx_iq_phase_comp=-21
    amp=272,step=68,adc_mean_i=113
    amp=340,step=34,adc_mean_i=166
    amp=374,step=17,adc_mean_i=193
    tosdac_i=31,tosdac_q=36,tx_iq_gain_comp=989,tx_iq_phase_comp=-29
    amp=288,step=72,adc_mean_i=107
    amp=360,step=36,adc_mean_i=156
    amp=396,step=18,adc_mean_i=183
    amp=414,step=9,adc_mean_i=196
    tosdac_i=31,tosdac_q=27,tx_iq_gain_comp=976,tx_iq_phase_comp=-27
    amp=304,step=76,adc_mean_i=115
    amp=380,step=38,adc_mean_i=168
    amp=418,step=19,adc_mean_i=197
    tosdac_i=33,tosdac_q=29,tx_iq_gain_comp=979,tx_iq_phase_comp=-24
    [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    ------ set default key 4201cf08, key ptr 00000000
    ------ set default key 4201d2e0, key ptr 00000000
    歵d_init
    
    歵d_reset idx=0
    歵d_reset idx=1
    [13:41:58.103] - start-----------hal
    
    [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name PARAM2
          id 0
          offset 001fc000(2080768)
          size 00002000(8Kbytes)
          xip_addr 00000000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    Read slot:0
    No written slot found
    
    [BL] [SEC] TRNG Handler
    [13:42:00.181] - start-----------hal
    
    [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name PARAM2
          id 0
          offset 001fc000(2080768)
          size 00002000(8Kbytes)
          xip_addr 00000000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    Read slot:0
    No written slot found
    
    [BL] [SEC] TRNG Handler
    
    
    1th channel,lo_vco_freq_cw=158
    2th channel,lo_vco_freq_cw=156
    3th channel,lo_vco_freq_cw=155
    4th channel,lo_vco_freq_cw=154
    5th channel,lo_vco_freq_cw=152
    6th channel,lo_vco_freq_cw=151
    7th channel,lo_vco_freq_cw=150
    8th channel,lo_vco_freq_cw=148
    9th channel,lo_vco_freq_cw=147
    10th channel,lo_vco_freq_cw=146
    11th channel,lo_vco_freq_cw=145
    12th channel,lo_vco_freq_cw=143
    13th channel,lo_vco_freq_cw=142
    14th channel,lo_vco_freq_cw=141
    15th channel,lo_vco_freq_cw=140
    16th channel,lo_vco_freq_cw=138
    17th channel,lo_vco_freq_cw=137
    18th channel,lo_vco_freq_cw=136
    19th channel,lo_vco_freq_cw=135
    20th channel,lo_vco_freq_cw=133
    21th channel,lo_vco_freq_cw=132
    0th channel,vco_idac_cw=9
    1th channel,vco_idac_cw=8
    2th channel,vco_idac_cw=8
    3th channel,vco_idac_cw=8
    4th channel,vco_idac_cw=8
    5th channel,vco_idac_cw=8
    6th channel,vco_idac_cw=8
    7th channel,vco_idac_cw=8
    8th channel,vco_idac_cw=8
    9th channel,vco_idac_cw=8
    10th channel,vco_idac_cw=8
    11th channel,vco_idac_cw=7
    12th channel,vco_idac_cw=7
    13th channel,vco_idac_cw=7
    14th channel,vco_idac_cw=7
    15th channel,vco_idac_cw=7
    16th channel,vco_idac_cw=7
    17th channel,vco_idac_cw=7
    18th channel,vco_idac_cw=7
    19th channel,vco_idac_cw=7
    20th channel,vco_idac_cw=7
    LO locked 9 146
    rosdac_i_gc3=32
    rosdac_i_gc2=32
    rosdac_i_gc1=32
    rosdac_i_gc0=32
    rosdac_q_gc3=36
    rosdac_q_gc2=36
    rosdac_q_gc1=36
    rosdac_q_gc0=36
    rbb_cap1_fc_i=29,rbb_cap2_fc_i=29,rbb_cap1_fc_q=29,rbb_cap2_fc_q=29
    new rbb_cap1_fc_i=53,rbb_cap2_fc_i=53,rbb_cap1_fc_q=53,rbb_cap2_fc_q=53
    LO locked 9 146
    amp=128,step=32,adc_mean_i=29
    amp=160,step=16,adc_mean_i=47
    amp=176,step=8,adc_mean_i=57
    amp=184,step=4,adc_mean_i=62
    amp=188,step=2,adc_mean_i=64
    amp=190,step=1,adc_mean_i=66
    amp=191,step=0,adc_mean_i=66
    tmx_cs=0, tmxcs_pwr_avg=15652, tmxcs_pwr_avg>>10=15
    tmx_cs=1, tmxcs_pwr_avg=23265, tmxcs_pwr_avg>>10=22
    tmx_cs=2, tmxcs_pwr_avg=33811, tmxcs_pwr_avg>>10=33
    tmx_cs=3, tmxcs_pwr_avg=47201, tmxcs_pwr_avg>>10=46
    tmx_cs=4, tmxcs_pwr_avg=60727, tmxcs_pwr_avg>>10=59
    tmx_cs=5, tmxcs_pwr_avg=67799, tmxcs_pwr_avg>>10=66
    tmx_cs=6, tmxcs_pwr_avg=62311, tmxcs_pwr_avg>>10=60
    tmx_cs=7, tmxcs_pwr_avg=48542, tmxcs_pwr_avg>>10=47
    tmx_cs_max=5, tmxcs_pwr_max=67799, tmxcs_pwr_max>>10=66
    amp=256,step=64,adc_mean_i=-227
    amp=320,step=32,adc_mean_i=-144
    amp=352,step=16,adc_mean_i=-99
    amp=368,step=8,adc_mean_i=-73
    amp=376,step=4,adc_mean_i=-62
    amp=380,step=2,adc_mean_i=-56
    amp=382,step=1,adc_mean_i=-55
    amp=383,step=0,adc_mean_i=-51
    tosdac_i=30,tosdac_q=31,tx_iq_gain_comp=996,tx_iq_phase_comp=-26
    amp=256,step=64,adc_mean_i=7
    amp=320,step=32,adc_mean_i=58
    amp=352,step=16,adc_mean_i=85
    amp=368,step=8,adc_mean_i=100
    amp=376,step=4,adc_mean_i=107
    amp=380,step=2,adc_mean_i=111
    amp=382,step=1,adc_mean_i=112
    amp=383,step=0,adc_mean_i=112
    tosdac_i=30,tosdac_q=30,tx_iq_gain_comp=992,tx_iq_phase_comp=-25
    amp=256,step=64,adc_mean_i=68
    amp=320,step=32,adc_mean_i=103
    amp=352,step=16,adc_mean_i=122
    amp=368,step=8,adc_mean_i=132
    amp=376,step=4,adc_mean_i=137
    amp=380,step=2,adc_mean_i=139
    amp=382,step=1,adc_mean_i=140
    amp=383,step=0,adc_mean_i=141
    tosdac_i=32,tosdac_q=33,tx_iq_gain_comp=996,tx_iq_phase_comp=-25
    amp=272,step=68,adc_mean_i=10
    amp=340,step=34,adc_mean_i=100
    amp=374,step=17,adc_mean_i=149
    amp=391,step=8,adc_mean_i=174
    amp=399,step=4,adc_mean_i=185
    amp=403,step=2,adc_mean_i=192
    tosdac_i=31,tosdac_q=34,tx_iq_gain_comp=983,tx_iq_phase_comp=-28
    amp=224,step=56,adc_mean_i=113
    amp=280,step=28,adc_mean_i=166
    amp=308,step=14,adc_mean_i=195
    tosdac_i=32,tosdac_q=33,tx_iq_gain_comp=978,tx_iq_phase_comp=-30
    amp=272,step=68,adc_mean_i=115
    amp=340,step=34,adc_mean_i=168
    amp=374,step=17,adc_mean_i=197
    tosdac_i=32,tosdac_q=35,tx_iq_gain_comp=986,tx_iq_phase_comp=-23
    amp=288,step=72,adc_mean_i=108
    amp=360,step=36,adc_mean_i=157
    amp=396,step=18,adc_mean_i=184
    amp=414,step=9,adc_mean_i=198
    tosdac_i=34,tosdac_q=26,tx_iq_gain_comp=986,tx_iq_phase_comp=-28
    amp=304,step=76,adc_mean_i=118
    amp=380,step=38,adc_mean_i=172
    amp=418,step=19,adc_mean_i=201
    tosdac_i=34,tosdac_q=26,tx_iq_gain_comp=984,tx_iq_phase_comp=-30
    [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    ------ set default key 4201cf08, key ptr 00000000
    ------ set default key 4201d2e0, key ptr 00000000
    歵d_init
    
    歵d_reset idx=0
    歵d_reset idx=1
    [13:42:06.109] - start-----------hal
    
    [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name PARAM2
          id 0
          offset 001fc000(2080768)
          size 00002000(8Kbytes)
          xip_addr 00000000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    Read slot:0
    No written slot found
    
    [BL] [SEC] TRNG Handler
    
    
    1th channel,lo_vco_freq_cw=158
    2th channel,lo_vco_freq_cw=156
    3th channel,lo_vco_freq_cw=155
    4th channel,lo_vco_freq_cw=154
    5th channel,lo_vco_freq_cw=152
    6th channel,lo_vco_freq_cw=151
    7th channel,lo_vco_freq_cw=150
    8th channel,lo_vco_freq_cw=148
    9th channel,lo_vco_freq_cw=147
    10th channel,lo_vco_freq_cw=146
    11th channel,lo_vco_freq_cw=145
    12th channel,lo_vco_freq_cw=143
    13th channel,lo_vco_freq_cw=142
    14th channel,lo_vco_freq_cw=141
    15th channel,lo_vco_freq_cw=140
    16th channel,lo_vco_freq_cw=138
    17th channel,lo_vco_freq_cw=137
    18th channel,lo_vco_freq_cw=136
    19th channel,lo_vco_freq_cw=135
    20th channel,lo_vco_freq_cw=133
    21th channel,lo_vco_freq_cw=132
    0th channel,vco_idac_cw=9
    1th channel,vco_idac_cw=8
    2th channel,vco_idac_cw=8
    3th channel,vco_idac_cw=8
    4th channel,vco_idac_cw=8
    5th channel,vco_idac_cw=8
    6th channel,vco_idac_cw=8
    7th channel,vco_idac_cw=8
    8th channel,vco_idac_cw=8
    9th channel,vco_idac_cw=8
    10th channel,vco_idac_cw=8
    11th channel,vco_idac_cw=7
    12th channel,vco_idac_cw=7
    13th channel,vco_idac_cw=7
    14th channel,vco_idac_cw=7
    15th channel,vco_idac_cw=7
    16th channel,vco_idac_cw=7
    17th channel,vco_idac_cw=7
    18th channel,vco_idac_cw=7
    19th channel,vco_idac_cw=7
    20th channel,vco_idac_cw=7
    LO locked 9 146
    rosdac_i_gc3=31
    rosdac_i_gc2=31
    rosdac_i_gc1=31
    rosdac_i_gc0=31
    rosdac_q_gc3=37
    rosdac_q_gc2=37
    rosdac_q_gc1=37
    rosdac_q_gc0=37
    rbb_cap1_fc_i=29,rbb_cap2_fc_i=29,rbb_cap1_fc_q=29,rbb_cap2_fc_q=29
    new rbb_cap1_fc_i=53,rbb_cap2_fc_i=53,rbb_cap1_fc_q=53,rbb_cap2_fc_q=53
    LO locked 9 146
    amp=128,step=32,adc_mean_i=29
    amp=160,step=16,adc_mean_i=47
    amp=176,step=8,adc_mean_i=57
    amp=184,step=4,adc_mean_i=62
    amp=188,step=2,adc_mean_i=65
    amp=190,step=1,adc_mean_i=66
    amp=191,step=0,adc_mean_i=66
    tmx_cs=0, tmxcs_pwr_avg=15825, tmxcs_pwr_avg>>10=15
    tmx_cs=1, tmxcs_pwr_avg=23117, tmxcs_pwr_avg>>10=22
    tmx_cs=2, tmxcs_pwr_avg=33702, tmxcs_pwr_avg>>10=32
    tmx_cs=3, tmxcs_pwr_avg=47086, tmxcs_pwr_avg>>10=45
    tmx_cs=4, tmxcs_pwr_avg=60711, tmxcs_pwr_avg>>10=59
    tmx_cs=5, tmxcs_pwr_avg=68201, tmxcs_pwr_avg>>10=66
    tmx_cs=6, tmxcs_pwr_avg=62370, tmxcs_pwr_avg>>10=60
    tmx_cs=7, tmxcs_pwr_avg=48560, tmxcs_pwr_avg>>10=47
    tmx_cs_max=5, tmxcs_pwr_max=68201, tmxcs_pwr_max>>10=66
    amp=256,step=64,adc_mean_i=-226
    amp=320,step=32,adc_mean_i=-141
    amp=352,step=16,adc_mean_i=-95
    amp=368,step=8,adc_mean_i=-72
    amp=376,step=4,adc_mean_i=-60
    amp=380,step=2,adc_mean_i=-54
    amp=382,step=1,adc_mean_i=-52
    amp=383,step=0,adc_mean_i=-50
    tosdac_i=31,tosdac_q=31,tx_iq_gain_comp=992,tx_iq_phase_comp=-26
    amp=256,step=64,adc_mean_i=6
    amp=320,step=32,adc_mean_i=56
    amp=352,step=16,adc_mean_i=84
    amp=368,step=8,adc_mean_i=98
    amp=376,step=4,adc_mean_i=105
    amp=380,step=2,adc_mean_i=108
    amp=382,step=1,adc_mean_i=109
    amp=383,step=0,adc_mean_i=110
    tosdac_i=32,tosdac_q=31,tx_iq_gain_comp=997,tx_iq_phase_comp=-20
    amp=256,step=64,adc_mean_i=69
    amp=320,step=32,adc_mean_i=104
    amp=352,step=16,adc_mean_i=122
    amp=368,step=8,adc_mean_i=133
    amp=376,step=4,adc_mean_i=138
    amp=380,step=2,adc_mean_i=140
    amp=382,step=1,adc_mean_i=142
    amp=383,step=0,adc_mean_i=142
    tosdac_i=36,tosdac_q=36,tx_iq_gain_comp=991,tx_iq_phase_comp=-24
    amp=272,step=68,adc_mean_i=8
    amp=340,step=34,adc_mean_i=99
    amp=374,step=17,adc_mean_i=148
    amp=391,step=8,adc_mean_i=174
    amp=399,step=4,adc_mean_i=187
    amp=403,step=2,adc_mean_i=192
    tosdac_i=32,tosdac_q=34,tx_iq_gain_comp=978,tx_iq_phase_comp=-25
    amp=224,step=56,adc_mean_i=113
    amp=280,step=28,adc_mean_i=166
    amp=308,step=14,adc_mean_i=194
    tosdac_i=32,tosdac_q=32,tx_iq_gain_comp=984,tx_iq_phase_comp=-29
    amp=272,step=68,adc_mean_i=116
    amp=340,step=34,adc_mean_i=169
    amp=374,step=17,adc_mean_i=197
    tosdac_i=31,tosdac_q=36,tx_iq_gain_comp=976,tx_iq_phase_comp=-32
    amp=288,step=72,adc_mean_i=106
    amp=360,step=36,adc_mean_i=156
    amp=396,step=18,adc_mean_i=183
    amp=414,step=9,adc_mean_i=196
    tosdac_i=33,tosdac_q=29,tx_iq_gain_comp=987,tx_iq_phase_comp=-34
    amp=304,step=76,adc_mean_i=118
    amp=380,step=38,adc_mean_i=172
    amp=418,step=19,adc_mean_i=202
    tosdac_i=32,tosdac_q=29,tx_iq_gain_comp=984,tx_iq_phase_comp=-34
    [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    ------ set default key 4201cf08, key ptr 00000000
    ------ set default key 4201d2e0, key ptr 00000000
    歵d_init
    
    歵d_reset idx=0
    歵d_reset idx=1
    [13:42:06.320] - [WF] country code CN used, num of channel 13
    Enable BMX IRQ
    
    
    [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    ------ set default key 4201cf08, key ptr 00000000
    ------ set default key 4201d2e0, key ptr 00000000
    歵d_init
    
    歵d_reset idx=0
    歵d_reset idx=1
    [WF] country code CN used, num of channel 13
    wifi init success
    !!
    [000308]<I> kv version:1.0
    
    [000309]<A> aos framework init.
    
    -Welcome to AliOS Things-
    
    [prt] log level set as: [ 3 ]
    
    
    --------Firmware info--------
    app: smart_outlet,  board: tg7100cevb
    Host: feige
    Branch: 
    Hash: 
    Date: Aug  5 2021 14:53:55
    Kernel: AOS-R-1.3.4
    LinkKit: 2.3.0_FY_1.6.6-8
    APP: app-1.6.6-20210805.145355
    Region env: SINGAPORE-ONLINE
    [13:42:06.433] - [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name media
          id 0
          offset 001c5000(1855488)
          size 00002000(8Kbytes)
          xip_addr 231b4000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    version = ver0.0.1
    KV = ProductKey:a1JG8An8ORa
    KV = DeviceName:703e971e048b
    [000339]<A> pk[a1JG8An8ORa]
    
    [000339]<A> dn[703e971e048b]
    
    [000346]<W> try secured ap config!
    
    [000352]<E> no valied ap conf 
    [13:42:21.714] - [param]
    interface_type = "Uart"
    comport_uart = "COM3"
    speed_uart = "2000000"
    speed_jlink = "1000"
    bl60x_brd = "IoTKitA"
    bl60x_xtal = "40M"
    aes_key = ""
    aes_iv = ""
    addr = "0x0"
    
    [check_box]
    partition_download = true
    boot2_download = true
    bin_download = true
    media_download = false
    use_romfs = false
    mfg_download = false
    ro_params_download = true
    ckb_erase_all = "False"
    encrypt = false
    download_single = false
    
    [input_path]
    pt_bin_input = "C:\\flash_tool\\bl602\\partition\\partition_cfg_2M.toml"
    boot2_bin_input = "C:\\flash_tool\\bl602\\builtin_imgs\\blsp_boot2.bin"
    cfg2_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    meida_bin_input = ""
    romfs_dir_input = ""
    mfg_bin_input = ""
    img_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    [13:42:21.730] - ========= Interface is Uart =========
    [13:42:21.751] - eflash loader bin is eflash_loader_40m.bin
    [13:42:21.758] - ========= chip flash id: ef4015 =========
    [13:42:21.774] - Update flash cfg finished
    [13:42:21.780] - create partition.bin, pt_new is True
    [13:42:21.790] - bl60x_fw_boot_head_gen xtal: 40M
    [13:42:21.796] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:21.797] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [13:42:21.803] - Created file len:176
    [13:42:21.807] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:21.807] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [13:42:21.807] - Created file len:128
    [13:42:21.823] - ========= sp image create =========
    [13:42:21.823] - Image hash is b'c5e2ce515a5783ac80efdd4910238a466572f882b53b3284e63c763e1da9847f'
    [13:42:21.823] - Header crc: b'52b188af'
    [13:42:21.823] - Write flash img
    [13:42:21.844] - bl60x_fw_boot_head_gen xtal: 40M
    [13:42:21.852] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:21.854] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [13:42:21.859] - Created file len:176
    [13:42:21.865] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:21.869] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [13:42:21.870] - Created file len:128
    [13:42:21.870] - ========= sp image create =========
    [13:42:21.896] - Image hash is b'cfdf4c95b160ea8cec9683daf4275917971ee5b248f91a5333f7c9943edb219d'
    [13:42:21.896] - Header crc: b'fc461dee'
    [13:42:21.897] - Write flash img
    [13:42:21.916] - FW Header is 176, 3920 still needed
    [13:42:21.916] - FW OTA bin header is Done. Len is 4096
    [13:42:22.353] - FW OTA bin is Done. Len is 762336
    [13:42:23.634] - FW OTA xz is Done
    [13:42:23.636] - ========= eflash loader config =========
    [13:42:23.760] - =========C:\flash_tool\bl602\device_tree/bl_factory_params_IoTKitA_40M.dts ——> bl602/device_tree/ro_params.dtb=========
    [13:42:24.218] - Version: bflb_eflash_loader_v2.0.0
    [13:42:24.218] - Program Start
    [13:42:24.218] - ========= eflash loader cmd arguments =========
    chipname : None
    chipid : False
    usage : False
    flash : True
    efuse : False
    write : True
    erase : False
    read : False
    none : False
    port : COM3
    baudrate : None
    config : None
    interface : None
    xtal : None
    start : None
    end : None
    addr : None
    mac : None
    file : None
    data : None
    mass : None
    loadstr : None
    loadfile : None
    userarea : None
    csvfile : None
    csvaddr : None
    para : None
    aeskey : None
    aesiv : None
    key : None
    ecdh : False
    echo : False
    auto : False
    version : False
    [13:42:24.283] - Config file: C:\flash_tool\bl602\eflash_loader/eflash_loader_cfg.ini
    [13:42:24.285] - serial port is COM3
    [13:42:24.286] - chiptype: bl602
    [13:42:24.287] - ========= Interface is Uart =========
    [13:42:24.287] - com speed: 2000000
    [13:42:24.288] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [13:42:24.288] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [13:42:24.289] - ========= load eflash_loader.bin =========
    [13:42:24.290] - Load eflash_loader.bin via uart
    [13:42:24.290] - ========= image load =========
    [13:42:24.575] - tx rx and power off, press the machine!
    [13:42:24.576] - cutoff time is 0.1
    [13:42:24.681] - power on tx and rx
    [13:42:25.509] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [13:42:25.510] - clean buf
    [13:42:25.619] - send sync
    [13:42:25.730] - ack is b''
    [13:42:25.730] - retry
    [13:42:25.993] - tx rx and power off, press the machine!
    [13:42:25.993] - cutoff time is 0.1
    [13:42:26.108] - power on tx and rx
    [13:42:26.931] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [13:42:26.931] - clean buf
    [13:42:27.046] - send sync
    [13:42:27.147] - ack is b''
    [13:42:27.147] - retry
    [13:42:27.147] - shake hand fail
    [13:42:27.147] - ########################################################################
    [13:42:27.147] - 请按照以下描述排查问题:
    [13:42:27.147] - GPIO8是否上拉到板子自身的3.3V,而不是外部的3.3V
    [13:42:27.147] - GPIO7(RX)是否连接到USB转串口的TX引脚
    [13:42:27.147] - GPIO16(TX)是否连接到USB转串口的RX引脚
    [13:42:27.147] - 在使用烧录软件进行烧录前,是否在GPIO8拉高的情况下,使用Reset/Chip_En复位了芯片
    [13:42:27.147] - 烧录软件所选择的COM口,是否是连接芯片的串口
    [13:42:27.147] - 烧录软件上选择的波特率是否是USB转串口支持的波特率
    [13:42:27.147] - 3.3V供电是否正常
    [13:42:27.147] - 板子供电电流是否正常(烧录模式下,芯片耗电电流5-7mA)
    [13:42:27.147] - ########################################################################
    [13:42:27.147] - shake hand fail
    [13:42:27.278] - Load helper bin time cost(ms): 2987.745361328125
    [13:42:27.279] - {"ErrorCode": "0003","ErrorMsg":"BFLB LOAD HELP BIN FAIL"}
    [13:42:27.279] - Burn Retry
    [13:42:27.280] - 0
    [13:42:27.280] - Burn return with retry fail
    [13:42:47.482] - [param]
    interface_type = "Uart"
    comport_uart = "COM3"
    speed_uart = "2000000"
    speed_jlink = "1000"
    bl60x_brd = "IoTKitA"
    bl60x_xtal = "40M"
    aes_key = ""
    aes_iv = ""
    addr = "0x0"
    
    [check_box]
    partition_download = true
    boot2_download = true
    bin_download = true
    media_download = false
    use_romfs = false
    mfg_download = false
    ro_params_download = true
    ckb_erase_all = "False"
    encrypt = false
    download_single = false
    
    [input_path]
    pt_bin_input = "C:\\flash_tool\\bl602\\partition\\partition_cfg_2M.toml"
    boot2_bin_input = "C:\\flash_tool\\bl602\\builtin_imgs\\blsp_boot2.bin"
    cfg2_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    meida_bin_input = ""
    romfs_dir_input = ""
    mfg_bin_input = ""
    img_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    [13:42:47.492] - ========= Interface is Uart =========
    [13:42:47.508] - eflash loader bin is eflash_loader_40m.bin
    [13:42:47.508] - ========= chip flash id: ef4015 =========
    [13:42:47.523] - Update flash cfg finished
    [13:42:47.539] - create partition.bin, pt_new is True
    [13:42:47.543] - bl60x_fw_boot_head_gen xtal: 40M
    [13:42:47.543] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:47.543] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [13:42:47.559] - Created file len:176
    [13:42:47.559] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:47.559] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [13:42:47.575] - Created file len:128
    [13:42:47.584] - ========= sp image create =========
    [13:42:47.587] - Image hash is b'c5e2ce515a5783ac80efdd4910238a466572f882b53b3284e63c763e1da9847f'
    [13:42:47.588] - Header crc: b'52b188af'
    [13:42:47.588] - Write flash img
    [13:42:47.604] - bl60x_fw_boot_head_gen xtal: 40M
    [13:42:47.612] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:47.613] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [13:42:47.618] - Created file len:176
    [13:42:47.623] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [13:42:47.626] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [13:42:47.630] - Created file len:128
    [13:42:47.640] - ========= sp image create =========
    [13:42:47.655] - Image hash is b'cfdf4c95b160ea8cec9683daf4275917971ee5b248f91a5333f7c9943edb219d'
    [13:42:47.656] - Header crc: b'fc461dee'
    [13:42:47.656] - Write flash img
    [13:42:47.670] - FW Header is 176, 3920 still needed
    [13:42:47.670] - FW OTA bin header is Done. Len is 4096
    [13:42:48.122] - FW OTA bin is Done. Len is 762336
    [13:42:49.304] - FW OTA xz is Done
    [13:42:49.306] - ========= eflash loader config =========
    [13:42:49.439] - =========C:\flash_tool\bl602\device_tree/bl_factory_params_IoTKitA_40M.dts ——> bl602/device_tree/ro_params.dtb=========
    [13:42:49.885] - Version: bflb_eflash_loader_v2.0.0
    [13:42:49.885] - Program Start
    [13:42:49.885] - ========= eflash loader cmd arguments =========
    chipname : None
    chipid : False
    usage : False
    flash : True
    efuse : False
    write : True
    erase : False
    read : False
    none : False
    port : COM3
    baudrate : None
    config : None
    interface : None
    xtal : None
    start : None
    end : None
    addr : None
    mac : None
    file : None
    data : None
    mass : None
    loadstr : None
    loadfile : None
    userarea : None
    csvfile : None
    csvaddr : None
    para : None
    aeskey : None
    aesiv : None
    key : None
    ecdh : False
    echo : False
    auto : False
    version : False
    [13:42:49.950] - Config file: C:\flash_tool\bl602\eflash_loader/eflash_loader_cfg.ini
    [13:42:49.952] - serial port is COM3
    [13:42:49.953] - chiptype: bl602
    [13:42:49.954] - ========= Interface is Uart =========
    [13:42:49.954] - com speed: 2000000
    [13:42:49.955] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [13:42:49.956] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [13:42:49.956] - ========= load eflash_loader.bin =========
    [13:42:49.957] - Load eflash_loader.bin via uart
    [13:42:49.957] - ========= image load =========
    [13:42:50.243] - tx rx and power off, press the machine!
    [13:42:50.244] - cutoff time is 0.1
    [13:42:50.348] - power on tx and rx
    [13:42:51.181] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [13:42:51.181] - clean buf
    [13:42:51.293] - send sync
    [13:42:51.509] - ack is b'4f4b'
    [13:42:51.556] - shake hand success
    [13:42:51.572] - get_boot_info
    [13:42:51.585] - data read is b'010000000000000003000000e97807cf0eb41700'
    [13:42:51.586] - sign is 0 encrypt is 0
    [13:42:51.604] - segcnt is 1
    [13:42:51.632] - segdata_len is 30192
    [13:42:51.728] - 4080/30192
    [13:42:51.818] - 8160/30192
    [13:42:51.920] - 12240/30192
    [13:42:52.003] - 16320/30192
    [13:42:52.103] - 20400/30192
    [13:42:52.203] - 24480/30192
    [13:42:52.303] - 28560/30192
    [13:42:52.351] - 30192/30192
    [13:42:52.367] - Run img
    [13:42:52.493] - Load helper bin time cost(ms): 2535.5986328125
    [13:42:52.603] - ========= flash read jedec ID =========
    [13:42:52.604] - Flash load shake hand
    [13:42:52.604] - clean buf
    [13:42:52.713] - send sync
    [13:42:52.931] - ack is b'4f4b'
    [13:42:52.963] - Read flash jedec ID
    [13:42:52.963] - readdata:
    [13:42:52.963] - b'ef401500'
    [13:42:52.963] - Finished
    [13:42:52.963] - Program operation
    [13:42:52.979] - Dealing Index 0
    [13:42:52.979] - ========= programming bl602/img_create/whole_img_boot2.bin to 0x00000000
    [13:42:52.980] - ========= flash load =========
    [13:42:52.981] - ========= flash erase =========
    [13:42:52.981] - Erase flash  from 0x0 to 0xb98f
    [13:42:53.259] - Erase time cost(ms): 277.30712890625
    [13:42:53.291] - decompress flash load 22164
    [13:42:53.320] - Load 2048/22164 {"progress":9}
    [13:42:53.335] - Load 4096/22164 {"progress":18}
    [13:42:53.351] - Load 6144/22164 {"progress":27}
    [13:42:53.376] - Load 8192/22164 {"progress":36}
    [13:42:53.392] - Load 10240/22164 {"progress":46}
    [13:42:53.408] - Load 12288/22164 {"progress":55}
    [13:42:53.424] - Load 14336/22164 {"progress":64}
    [13:42:53.440] - Load 16384/22164 {"progress":73}
    [13:42:53.456] - Load 18432/22164 {"progress":83}
    [13:42:53.472] - Load 20480/22164 {"progress":92}
    [13:42:53.479] - Load 22164/22164 {"progress":100}
    [13:42:53.479] - Load 22164/22164 {"progress":100}
    [13:42:53.479] - Write check
    [13:42:53.520] - Flash load time cost(ms): 260.502197265625
    [13:42:53.520] - Finished
    [13:42:53.520] - Sha caled by host: 194e180166ca945012e261580c23e9a181fb3d34a9e1a50c54d0dd649754a400
    [13:42:53.520] - xip mode Verify
    [13:42:53.551] - Read Sha256/47504
    [13:42:53.553] - Flash xip readsha time cost(ms): 17.813232421875
    [13:42:53.554] - Finished
    [13:42:53.568] - Sha caled by dev: 194e180166ca945012e261580c23e9a181fb3d34a9e1a50c54d0dd649754a400
    [13:42:53.569] - Verify success
    [13:42:53.570] - Dealing Index 1
    [13:42:53.571] - ========= programming bl602/partition/partition.bin to 0xe000
    [13:42:53.571] - ========= flash load =========
    [13:42:53.573] - ========= flash erase =========
    [13:42:53.573] - Erase flash  from 0xe000 to 0xe10f
    [13:42:53.604] - Erase time cost(ms): 31.7646484375
    [13:42:53.620] - Load 272/272 {"progress":100}
    [13:42:53.620] - Load 272/272 {"progress":100}
    [13:42:53.620] - Write check
    [13:42:53.636] - Flash load time cost(ms): 31.253662109375
    [13:42:53.636] - Finished
    [13:42:53.636] - Sha caled by host: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [13:42:53.636] - xip mode Verify
    [13:42:53.680] - Read Sha256/272
    [13:42:53.681] - Flash xip readsha time cost(ms): 17.052001953125
    [13:42:53.681] - Finished
    [13:42:53.696] - Sha caled by dev: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [13:42:53.696] - Verify success
    [13:42:53.697] - Dealing Index 2
    [13:42:53.697] - ========= programming bl602/partition/partition.bin to 0xf000
    [13:42:53.698] - ========= flash load =========
    [13:42:53.698] - ========= flash erase =========
    [13:42:53.698] - Erase flash  from 0xf000 to 0xf10f
    [13:42:53.743] - Erase time cost(ms): 45.81201171875
    [13:42:53.759] - Load 272/272 {"progress":100}
    [13:42:53.759] - Load 272/272 {"progress":100}
    [13:42:53.760] - Write check
    [13:42:53.775] - Flash load time cost(ms): 29.79052734375
    [13:42:53.776] - Finished
    [13:42:53.776] - Sha caled by host: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [13:42:53.776] - xip mode Verify
    [13:42:53.806] - Read Sha256/272
    [13:42:53.806] - Flash xip readsha time cost(ms): 29.90087890625
    [13:42:53.806] - Finished
    [13:42:53.822] - Sha caled by dev: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [13:42:53.822] - Verify success
    [13:42:53.822] - Dealing Index 3
    [13:42:53.822] - ========= programming bl602/img_create/whole_img.bin to 0x10000
    [13:42:53.822] - ========= flash load =========
    [13:42:53.822] - ========= flash erase =========
    [13:42:53.822] - Erase flash  from 0x10000 to 0xca1df
    [13:42:56.339] - Erase time cost(ms): 2517.251220703125
    [13:42:57.062] - decompress flash load 405536
    [13:42:57.082] - Load 2048/405536 {"progress":0}
    [13:42:57.100] - Load 4096/405536 {"progress":1}
    [13:42:57.116] - Load 6144/405536 {"progress":1}
    [13:42:57.132] - Load 8192/405536 {"progress":2}
    [13:42:57.152] - Load 10240/405536 {"progress":2}
    [13:42:57.166] - Load 12288/405536 {"progress":3}
    [13:42:57.183] - Load 14336/405536 {"progress":3}
    [13:42:57.199] - Load 16384/405536 {"progress":4}
    [13:42:57.216] - Load 18432/405536 {"progress":4}
    [13:42:57.232] - Load 20480/405536 {"progress":5}
    [13:42:57.248] - Load 22528/405536 {"progress":5}
    [13:42:57.264] - Load 24576/405536 {"progress":6}
    [13:42:57.280] - Load 26624/405536 {"progress":6}
    [13:42:57.296] - Load 28672/405536 {"progress":7}
    [13:42:57.306] - Load 30720/405536 {"progress":7}
    [13:42:57.321] - Load 32768/405536 {"progress":8}
    [13:42:57.337] - Load 34816/405536 {"progress":8}
    [13:42:57.353] - Load 36864/405536 {"progress":9}
    [13:42:57.376] - Load 38912/405536 {"progress":9}
    [13:42:57.384] - Load 40960/405536 {"progress":10}
    [13:42:57.401] - Load 43008/405536 {"progress":10}
    [13:42:57.417] - Load 45056/405536 {"progress":11}
    [13:42:57.433] - Load 47104/405536 {"progress":11}
    ...
    [13:43:00.291] - Load 397312/405536 {"progress":97}
    [13:43:00.334] - Load 399360/405536 {"progress":98}
    [13:43:00.339] - Load 401408/405536 {"progress":98}
    [13:43:00.382] - Load 403456/405536 {"progress":99}
    [13:43:00.387] - Load 405504/405536 {"progress":99}
    [13:43:00.430] - Load 405536/405536 {"progress":100}
    [13:43:00.430] - Load 405536/405536 {"progress":100}
    [13:43:00.430] - Write check
    [13:43:00.445] - Flash load time cost(ms): 4106.6123046875
    [13:43:00.446] - Finished
    [13:43:00.458] - Sha caled by host: 42408f5dc71a397041dc5646ee47ec7c058faeebf96b8c92adaf3dab75853335
    [13:43:00.458] - xip mode Verify
    [13:43:00.541] - Read Sha256/762336
    [13:43:00.542] - Flash xip readsha time cost(ms): 81.91845703125
    [13:43:00.542] - Finished
    [13:43:00.557] - Sha caled by dev: 42408f5dc71a397041dc5646ee47ec7c058faeebf96b8c92adaf3dab75853335
    [13:43:00.557] - Verify success
    [13:43:00.557] - Dealing Index 4
    [13:43:00.557] - ========= programming bl602/device_tree/ro_params.dtb to 0x1f8000
    [13:43:00.557] - ========= flash load =========
    [13:43:00.557] - ========= flash erase =========
    [13:43:00.557] - Erase flash  from 0x1f8000 to 0x1f9729
    [13:43:00.637] - Erase time cost(ms): 79.86376953125
    [13:43:00.649] - decompress flash load 1640
    [13:43:00.666] - Load 1640/1640 {"progress":100}
    [13:43:00.666] - Load 1640/1640 {"progress":100}
    [13:43:00.666] - Write check
    [13:43:00.681] - Flash load time cost(ms): 42.314453125
    [13:43:00.681] - Finished
    [13:43:00.681] - Sha caled by host: 4fd42b104897efb92f6a396b4e15193b842fd35a4463dacd20f2ea64ff354634
    [13:43:00.681] - xip mode Verify
    [13:43:00.707] - Read Sha256/5930
    [13:43:00.707] - Flash xip readsha time cost(ms): 10.006591796875
    [13:43:00.707] - Finished
    [13:43:00.722] - Sha caled by dev: 4fd42b104897efb92f6a396b4e15193b842fd35a4463dacd20f2ea64ff354634
    [13:43:00.722] - Verify success
    [13:43:00.722] - Program Finished
    [13:43:00.722] - All time cost(ms): 10837.40478515625
    [13:43:00.954] - [All Success]
    


    HINT: If you can't see the initial boot info w/ AliOS and the diagnostic messages from the original firmware in the UART log window, then it is NOT going to work. I was never able to see these (proper output from the UART connection) while the Wifi Module was attached to the main board - note that this was using a FTDI TTL-232R-3V3.

    I've keep my last remaining Amysen smart plug unflashed at the moment, so I can attempt the non-disassembled flash w/ a CH340G. Once I try it with a different USB-Serial adapter, I will post back to fill in that blank.

    Disassembling a plug is not a complete show-stopper. But just popping the cover off, soldering to some easily accessible UART pads and then flashing is definitely preferable to taking it apart down to the Wifi Module Board.
  • #11 20892092
    p.kaczmarek2
    Moderator Smart Home
    Good job, so why didn't it flash in circuit? Maybe RX/TX or boot was used for some other purpose on the board?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #12 20899184
    davidcpurdy
    Level 7  
    I may have figured out one piece of the puzzle as to why neither flashing nor even basic UART communication has been working on this plug while the Wifi board is attached before today. I got the CH340G and tried again connecting to the Wifi module on the plug:
    RX -TX,
    TX -RX,
    PSU3.3VDC -> 3.3VDC/VCC on the Wifi module,
    GRD PSU - GRD CH340G - GRD wifi module
    [ PSU 3.3VDC - 10k ohm - Boot pad wifi module -- just for flashing ]

    This seems to make the UART comm work as expected while the Wifi module is still on the Main Board.
    
    
    [17:25:58.886] - [WF] country code CN used, num of channel 13
    Enable BMX IRQ
    
    
    [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    ------ set default key 4201cf08, key ptr 00000000
    ------ set default key 4201d2e0, key ptr 00000000
    歵d_init
    
    歵d_reset idx=0
    歵d_reset idx=1
    [WF] country code CN used, num of channel 13
    wifi init success
    !!
    [000302]<I> kv version:1.0
    
    [000303]<A> aos framework init.
    
    -Welcome to AliOS Things-
    
    [prt] log level set as: [ 3 ]
    
    
    --------Firmware info--------
    app: smart_outlet,  board: tg7100cevb
    Host: feige
    Branch: 
    Hash: 
    Date: Aug  5 2021 14:53:55
    Kernel: AOS-R-1.3.4
    LinkKit: 2.3.0_FY_1.6.6-8
    APP: app-1.6.6-20210805.145355
    Region env: SINGAPORE-ONLINE
    
    [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name media
          id 0
          offset 001c5000(1855488)
          size 00002000(8Kbytes)
          xip_addr 231b4000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    version = ver0.0.1
    KV = ProductKey:a1JG8An8ORa
    KV = DeviceName:703e971e9666
    [000317]<A> pk[a1JG8An8ORa]
    
    [000318]<A> dn[703e971e9666]
    
    [000320]<W> try secured ap config!
    
    [000323]<E> no valied  
    [17:26:06.416] - 
    [17:26:07.416] - start-----------hal
    
    [MTD] >>>>>> Hanlde info Dump >>>>>>
    
    
          name PARAM2
          id 0
          offset 001fc000(2080768)
          size 00002000(8Kbytes)
          xip_addr 00000000
    [MTD] <<<<<< Hanlde info End <<<<<<
    
    
    Read slot:0
    No written slot found
    
    [BL] [SEC] TRNG Handler
    
    
    1th channel,lo_vco_freq_cw=140
    2th channel,lo_vco_freq_cw=138
    3th channel,lo_vco_freq_cw=137
    4th channel,lo_vco_freq_cw=136
    5th channel,lo_vco_freq_cw=135
    6th channel,lo_vco_freq_cw=134
    7th channel,lo_vco_freq_cw=132
    8th channel,lo_vco_freq_cw=131
    9th channel,lo_vco_freq_cw=130
    10th channel,lo_vco_freq_cw=129
    11th channel,lo_vco_freq_cw=128
    12th channel,lo_vco_freq_cw=127
    13th channel,lo_vco_freq_cw=126
    14th channel,lo_vco_freq_cw=124
    15th channel,lo_vco_freq_cw=123
    16th channel,lo_vco_freq_cw=122
    17th channel,lo_vco_freq_cw=121
    18th channel,lo_vco_freq_cw=120
    19th channel,lo_vco_freq_cw=119
    20th channel,lo_vco_freq_cw=118
    21th channel,lo_vco_freq_cw=117
    0th channel,vco_idac_cw=10
    1th channel,vco_idac_cw=10
    2th channel,vco_idac_cw=10
    3th channel,vco_idac_cw=10
    4th channel,vco_idac_cw=9
    5th channel,vco_idac_cw=10
    6th channel,vco_idac_cw=10
    7th channel,vco_idac_cw=10
    8th channel,vco_idac_cw=10
    9th channel,vco_idac_cw=10
    10th channel,vco_idac_cw=10
    11th channel,vco_idac_cw=9
    12th channel,vco_idac_cw=9
    13th channel,vco_idac_cw=9
    14th channel,vco_idac_cw=9
    15th channel,vco_idac_cw=9
    16th channel,vco_idac_cw=9
    17th channel,vco_idac_cw=9
    18th channel,vco_idac_cw=9
    19th channel,vco_idac_cw=9
    20th channel,vco_idac_cw=9
    LO locked 9 129
    rosdac_i_gc3=38
    rosdac_i_gc2=38
    rosdac_i_gc1=38
    rosdac_i_gc0=38
    rosdac_q_gc3=28
    rosdac_q_gc2=28
    rosdac_q_gc1=28
    rosdac_q_gc0=28
    rbb_cap1_fc_i=20,rbb_cap2_fc_i=20,rbb_cap1_fc_q=20,rbb_cap2_fc_q=20
    new rbb_cap1_fc_i=44,rbb_cap2_fc_i=44,rbb_cap1_fc_q=44,rbb_cap2_fc_q=44
    LO locked 9 129
    amp=128,step=32,adc_mean_i=22
    amp=160,step=16,adc_mean_i=39
    amp=176,step=8,adc_mean_i=49
    amp=184,step=4,adc_mean_i=54
    amp=188,step=2,adc_mean_i=57
    amp=190,step=1,adc_mean_i=58
    amp=191,step=0,adc_mean_i=59
    tmx_cs=0, tmxcs_pwr_avg=7187, tmxcs_pwr_avg>>10=7
    tmx_cs=1, tmxcs_pwr_avg=14568, tmxcs_pwr_avg>>10=14
    tmx_cs=2, tmxcs_pwr_avg=24886, tmxcs_pwr_avg>>10=24
    tmx_cs=3, tmxcs_pwr_avg=38728, tmxcs_pwr_avg>>10=37
    tmx_cs=4, tmxcs_pwr_avg=52851, tmxcs_pwr_avg>>10=51
    tmx_cs=5, tmxcs_pwr_avg=60528, tmxcs_pwr_avg>>10=59
    tmx_cs=6, tmxcs_pwr_avg=53500, tmxcs_pwr_avg>>10=52
    tmx_cs=7, tmxcs_pwr_avg=39103, tmxcs_pwr_avg>>10=38
    tmx_cs_max=5, tmxcs_pwr_max=60528, tmxcs_pwr_max>>10=59
    amp=256,step=64,adc_mean_i=-235
    amp=320,step=32,adc_mean_i=-138
    amp=352,step=16,adc_mean_i=-84
    amp=368,step=8,adc_mean_i=-55
    amp=376,step=4,adc_mean_i=-42
    amp=380,step=2,adc_mean_i=-37
    amp=382,step=1,adc_mean_i=-33
    amp=383,step=0,adc_mean_i=-31
    tosdac_i=27,tosdac_q=39,tx_iq_gain_comp=983,tx_iq_phase_comp=-22
    amp=256,step=64,adc_mean_i=-3
    amp=320,step=32,adc_mean_i=53
    amp=352,step=16,adc_mean_i=84
    amp=368,step=8,adc_mean_i=99
    amp=376,step=4,adc_mean_i=108
    amp=380,step=2,adc_mean_i=112
    amp=382,step=1,adc_mean_i=113
    amp=383,step=0,adc_mean_i=115
    tosdac_i=28,tosdac_q=42,tx_iq_gain_comp=985,tx_iq_phase_comp=-21
    amp=256,step=64,adc_mean_i=60
    amp=320,step=32,adc_mean_i=96
    amp=352,step=16,adc_mean_i=115
    amp=368,step=8,adc_mean_i=125
    amp=376,step=4,adc_mean_i=130
    amp=380,step=2,adc_mean_i=132
    amp=382,step=1,adc_mean_i=134
    amp=383,step=0,adc_mean_i=134
    tosdac_i=27,tosdac_q=45,tx_iq_gain_comp=971,tx_iq_phase_comp=-17
    amp=272,step=68,adc_mean_i=-9
    amp=340,step=34,adc_mean_i=89
    amp=374,step=17,adc_mean_i=143
    amp=391,step=8,adc_mean_i=172
    amp=399,step=4,adc_mean_i=186
    amp=403,step=2,adc_mean_i=191
    amp=405,step=1,adc_mean_i=193
    tosdac_i=28,tosdac_q=42,tx_iq_gain_comp=980,tx_iq_phase_comp=-21
    amp=224,step=56,adc_mean_i=106
    amp=280,step=28,adc_mean_i=161
    amp=308,step=14,adc_mean_i=192
    tosdac_i=28,tosdac_q=40,tx_iq_gain_comp=977,tx_iq_phase_comp=-18
    amp=272,step=68,adc_mean_i=108
    amp=340,step=34,adc_mean_i=163
    amp=374,step=17,adc_mean_i=193
    tosdac_i=24,tosdac_q=41,tx_iq_gain_comp=981,tx_iq_phase_comp=-21
    amp=288,step=72,adc_mean_i=99
    amp=360,step=36,adc_mean_i=152
    amp=396,step=18,adc_mean_i=180
    amp=414,step=9,adc_mean_i=194
    tosdac_i=32,tosdac_q=52,tx_iq_gain_comp=970,tx_iq_phase_comp=-24
    amp=304,step=76,adc_mean_i=109
    amp=380,step=38,adc_mean_i=165
    amp=418,step=19,adc_mean_i=195
    tosdac_i=34,tosdac_q=51,tx_iq_gain_comp=968,tx_iq_phase_comp=-23
    [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    ------ set default key 4201cf08, key ptr 00000000
    ------ set default key 4201d2e0, key ptr 00000000
    歵d_init
    
    歵d_reset idx=0
    歵d_reset idx=1
    


    I still need to verify if actual flashing will work on it, but it seems like a step forward. This is the first time I've been able to correctly read from the UART while board is attached to mainboard.

    ============================================================

    Confirmed: This module is flashable on-board (still attached to main board).

    [18:00:46.718] - [param]
    interface_type = "Uart"
    comport_uart = "COM4"
    speed_uart = "2000000"
    speed_jlink = "1000"
    bl60x_brd = "IoTKitA"
    bl60x_xtal = "40M"
    aes_key = ""
    aes_iv = ""
    addr = "0x0"
    
    [check_box]
    partition_download = true
    boot2_download = true
    bin_download = true
    media_download = false
    use_romfs = false
    mfg_download = false
    ro_params_download = true
    ckb_erase_all = "False"
    encrypt = false
    download_single = false
    
    [input_path]
    pt_bin_input = "C:\\flash_tool\\bl602\\partition\\partition_cfg_2M.toml"
    boot2_bin_input = "C:\\flash_tool\\bl602\\builtin_imgs\\blsp_boot2.bin"
    cfg2_bin_input = "C:\\flash_tool\\OpenBL602_1.17.391.bin"
    meida_bin_input = ""
    romfs_dir_input = ""
    mfg_bin_input = ""
    img_bin_input = "C:\\flash_tool\\OpenBL602_1.17.366.bin"
    [18:00:46.729] - ========= Interface is Uart =========
    [18:00:46.744] - eflash loader bin is eflash_loader_40m.bin
    [18:00:46.749] - ========= chip flash id: ef4015 =========
    [18:00:46.769] - Update flash cfg finished
    [18:00:46.769] - create partition.bin, pt_new is True
    [18:00:46.784] - bl60x_fw_boot_head_gen xtal: 40M
    [18:00:46.789] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [18:00:46.789] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [18:00:46.799] - Created file len:176
    [18:00:46.806] - halt_cpu1 not exist
    [18:00:46.808] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [18:00:46.809] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [18:00:46.809] - Created file len:128
    [18:00:46.825] - ========= sp image create =========
    [18:00:46.829] - Image hash is b'c5e2ce515a5783ac80efdd4910238a466572f882b53b3284e63c763e1da9847f'
    [18:00:46.829] - Header crc: b'52b188af'
    [18:00:46.829] - Write flash img
    [18:00:46.846] - bl60x_fw_boot_head_gen xtal: 40M
    [18:00:46.852] - Create bootheader using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [18:00:46.852] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[BOOTHEADER_CFG]>
    [18:00:46.861] - Created file len:176
    [18:00:46.861] - halt_cpu1 not exist
    [18:00:46.861] - Create efuse using C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini
    [18:00:46.869] - Updating data according to <C:\flash_tool\bl602\efuse_bootheader/efuse_bootheader_cfg.ini[EFUSE_CFG]>
    [18:00:46.879] - Created file len:128
    [18:00:46.889] - ========= sp image create =========
    [18:00:46.899] - Image hash is b'cec185951414da9ba661d96ce131c556a7f4d87a5193295654e2f96365551ea5'
    [18:00:46.908] - Header crc: b'084be946'
    [18:00:46.909] - Write flash img
    [18:00:46.929] - FW Header is 176, 3920 still needed
    [18:00:46.939] - FW OTA bin header is Done. Len is 4096
    [18:00:47.409] - FW OTA bin is Done. Len is 762640
    [18:00:48.713] - FW OTA xz is Done
    [18:00:48.713] - ========= eflash loader config =========
    [18:00:48.879] - =========C:\flash_tool\bl602\device_tree/bl_factory_params_IoTKitA_40M.dts ——> bl602/device_tree/ro_params.dtb=========
    [18:00:49.379] - Version: bflb_eflash_loader_v2.0.0
    [18:00:49.379] - Program Start
    [18:00:49.389] - ========= eflash loader cmd arguments =========
    chipname : None
    chipid : False
    usage : False
    flash : True
    efuse : False
    write : True
    erase : False
    read : False
    none : False
    port : COM4
    baudrate : None
    config : None
    interface : None
    xtal : None
    start : None
    end : None
    addr : None
    mac : None
    file : None
    data : None
    mass : None
    loadstr : None
    loadfile : None
    userarea : None
    csvfile : None
    csvaddr : None
    para : None
    aeskey : None
    aesiv : None
    key : None
    ecdh : False
    echo : False
    auto : False
    version : False
    [18:00:49.439] - Config file: C:\flash_tool\bl602\eflash_loader/eflash_loader_cfg.ini
    [18:00:49.449] - serial port is COM4
    [18:00:49.449] - chiptype: bl602
    [18:00:49.449] - ========= Interface is Uart =========
    [18:00:49.449] - com speed: 2000000
    [18:00:49.449] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [18:00:49.449] - Eflash load helper file: C:\flash_tool\bl602\eflash_loader/eflash_loader_40m.bin
    [18:00:49.449] - ========= load eflash_loader.bin =========
    [18:00:49.449] - Load eflash_loader.bin via uart
    [18:00:49.449] - ========= image load =========
    [18:00:49.724] - tx rx and power off, press the machine!
    [18:00:49.724] - cutoff time is 0.1
    [18:00:49.839] - power on tx and rx
    [18:00:50.633] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [18:00:50.633] - clean buf
    [18:00:50.745] - send sync
    [18:00:50.973] - ack is b'4f4b'
    [18:00:51.019] - shake hand success
    [18:00:51.031] - get_boot_info
    [18:00:51.035] - data read is b'010000000000000003000000edb76b29d8ac1400'
    [18:00:51.035] - sign is 0 encrypt is 0
    [18:00:51.062] - segcnt is 1
    [18:00:51.069] - segdata_len is 30192
    [18:00:51.150] - 4080/30192
    [18:00:51.239] - 8160/30192
    [18:00:51.319] - 12240/30192
    [18:00:51.409] - 16320/30192
    [18:00:51.496] - 20400/30192
    [18:00:51.580] - 24480/30192
    [18:00:51.660] - 28560/30192
    [18:00:51.699] - 30192/30192
    [18:00:51.699] - Run img
    [18:00:51.809] - Load helper bin time cost(ms): 2360.450439453125
    [18:00:51.913] - ========= flash read jedec ID =========
    [18:00:51.913] - Flash load shake hand
    [18:00:51.913] - clean buf
    [18:00:52.019] - send sync
    [18:00:52.260] - ack is b'4f4b'
    [18:00:52.299] - Read flash jedec ID
    [18:00:52.299] - readdata:
    [18:00:52.299] - b'ef401500'
    [18:00:52.299] - Finished
    [18:00:52.304] - Program operation
    [18:00:52.304] - Dealing Index 0
    [18:00:52.305] - ========= programming bl602/img_create/whole_img_boot2.bin to 0x00000000
    [18:00:52.305] - ========= flash load =========
    [18:00:52.306] - ========= flash erase =========
    [18:00:52.307] - Erase flash  from 0x0 to 0xb98f
    [18:00:52.549] - Erase time cost(ms): 241.955078125
    [18:00:52.599] - decompress flash load 22164
    [18:00:52.619] - Load 2048/22164 {"progress":9}
    [18:00:52.636] - Load 4096/22164 {"progress":18}
    [18:00:52.652] - Load 6144/22164 {"progress":27}
    [18:00:52.670] - Load 8192/22164 {"progress":36}
    [18:00:52.679] - Load 10240/22164 {"progress":46}
    [18:00:52.704] - Load 12288/22164 {"progress":55}
    [18:00:52.720] - Load 14336/22164 {"progress":64}
    [18:00:52.729] - Load 16384/22164 {"progress":73}
    [18:00:52.753] - Load 18432/22164 {"progress":83}
    [18:00:52.769] - Load 20480/22164 {"progress":92}
    [18:00:52.779] - Load 22164/22164 {"progress":100}
    [18:00:52.779] - Load 22164/22164 {"progress":100}
    [18:00:52.779] - Write check
    [18:00:52.809] - Flash load time cost(ms): 259.613037109375
    [18:00:52.809] - Finished
    [18:00:52.809] - Sha caled by host: 194e180166ca945012e261580c23e9a181fb3d34a9e1a50c54d0dd649754a400
    [18:00:52.809] - xip mode Verify
    [18:00:52.824] - Read Sha256/47504
    [18:00:52.824] - Flash xip readsha time cost(ms): 5.436767578125
    [18:00:52.824] - Finished
    [18:00:52.829] - Sha caled by dev: 194e180166ca945012e261580c23e9a181fb3d34a9e1a50c54d0dd649754a400
    [18:00:52.829] - Verify success
    [18:00:52.829] - Dealing Index 1
    [18:00:52.829] - ========= programming bl602/partition/partition.bin to 0xe000
    [18:00:52.829] - ========= flash load =========
    [18:00:52.829] - ========= flash erase =========
    [18:00:52.829] - Erase flash  from 0xe000 to 0xe10f
    [18:00:52.862] - Erase time cost(ms): 33.189453125
    [18:00:52.866] - Load 272/272 {"progress":100}
    [18:00:52.869] - Load 272/272 {"progress":100}
    [18:00:52.870] - Write check
    [18:00:52.873] - Flash load time cost(ms): 9.018798828125
    [18:00:52.873] - Finished
    [18:00:52.874] - Sha caled by host: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [18:00:52.876] - xip mode Verify
    [18:00:52.879] - Read Sha256/272
    [18:00:52.879] - Flash xip readsha time cost(ms): 1.5703125
    [18:00:52.879] - Finished
    [18:00:52.879] - Sha caled by dev: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [18:00:52.879] - Verify success
    [18:00:52.879] - Dealing Index 2
    [18:00:52.879] - ========= programming bl602/partition/partition.bin to 0xf000
    [18:00:52.879] - ========= flash load =========
    [18:00:52.879] - ========= flash erase =========
    [18:00:52.879] - Erase flash  from 0xf000 to 0xf10f
    [18:00:52.909] - Erase time cost(ms): 30.008544921875
    [18:00:52.919] - Load 272/272 {"progress":100}
    [18:00:52.924] - Load 272/272 {"progress":100}
    [18:00:52.924] - Write check
    [18:00:52.928] - Flash load time cost(ms): 8.32373046875
    [18:00:52.929] - Finished
    [18:00:52.930] - Sha caled by host: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [18:00:52.931] - xip mode Verify
    [18:00:52.934] - Read Sha256/272
    [18:00:52.934] - Flash xip readsha time cost(ms): 1.0654296875
    [18:00:52.934] - Finished
    [18:00:52.939] - Sha caled by dev: da4d2fe7d42a71246b0e84d64665b70ad701435f89716c48e6f23ef55340eaa0
    [18:00:52.939] - Verify success
    [18:00:52.939] - Dealing Index 3
    [18:00:52.939] - ========= programming bl602/img_create/whole_img.bin to 0x10000
    [18:00:52.939] - ========= flash load =========
    [18:00:52.939] - ========= flash erase =========
    [18:00:52.939] - Erase flash  from 0x10000 to 0xca30f
    [18:00:55.249] - Erase time cost(ms): 2310.533203125
    [18:00:56.049] - decompress flash load 405740
    [18:00:56.069] - Load 2048/405740 {"progress":0}
    [18:00:56.089] - Load 4096/405740 {"progress":1}
    [18:00:56.099] - Load 6144/405740 {"progress":1}
    [18:00:56.123] - Load 8192/405740 {"progress":2}
    [18:00:56.139] - Load 10240/405740 {"progress":2}
    [18:00:56.152] - Load 12288/405740 {"progress":3}
    [18:00:56.170] - Load 14336/405740 {"progress":3}
    [18:00:56.189] - Load 16384/405740 {"progress":4}
    [18:00:56.205] - Load 18432/405740 {"progress":4}
    ...
    [18:00:59.166] - Load 374784/405740 {"progress":92}
    [18:00:59.189] - Load 376832/405740 {"progress":92}
    [18:00:59.208] - Load 378880/405740 {"progress":93}
    [18:00:59.220] - Load 380928/405740 {"progress":93}
    [18:00:59.239] - Load 382976/405740 {"progress":94}
    [18:00:59.265] - Load 385024/405740 {"progress":94}
    [18:00:59.282] - Load 387072/405740 {"progress":95}
    [18:00:59.299] - Load 389120/405740 {"progress":95}
    [18:00:59.322] - Load 391168/405740 {"progress":96}
    [18:00:59.339] - Load 393216/405740 {"progress":96}
    [18:00:59.357] - Load 395264/405740 {"progress":97}
    [18:00:59.374] - Load 397312/405740 {"progress":97}
    [18:00:59.389] - Load 399360/405740 {"progress":98}
    [18:00:59.410] - Load 401408/405740 {"progress":98}
    [18:00:59.439] - Load 403456/405740 {"progress":99}
    [18:00:59.462] - Load 405504/405740 {"progress":99}
    [18:00:59.488] - Load 405740/405740 {"progress":100}
    [18:00:59.490] - Load 405740/405740 {"progress":100}
    [18:00:59.491] - Write check
    [18:00:59.494] - Flash load time cost(ms): 4244.068359375
    [18:00:59.495] - Finished
    [18:00:59.507] - Sha caled by host: 9e56c4e58e22c5cbfbd03cd7b860a2f3bfd7d54074859c149558864e3fb53f58
    [18:00:59.508] - xip mode Verify
    [18:00:59.589] - Read Sha256/762640
    [18:00:59.589] - Flash xip readsha time cost(ms): 78.302734375
    [18:00:59.589] - Finished
    [18:00:59.592] - Sha caled by dev: 9e56c4e58e22c5cbfbd03cd7b860a2f3bfd7d54074859c149558864e3fb53f58
    [18:00:59.592] - Verify success
    [18:00:59.594] - Dealing Index 4
    [18:00:59.596] - ========= programming bl602/device_tree/ro_params.dtb to 0x1f8000
    [18:00:59.596] - ========= flash load =========
    [18:00:59.598] - ========= flash erase =========
    [18:00:59.598] - Erase flash  from 0x1f8000 to 0x1f9729
    [18:00:59.656] - Erase time cost(ms): 56.72607421875
    [18:00:59.669] - decompress flash load 1640
    [18:00:59.679] - Load 1640/1640 {"progress":100}
    [18:00:59.679] - Load 1640/1640 {"progress":100}
    [18:00:59.679] - Write check
    [18:00:59.699] - Flash load time cost(ms): 40.627685546875
    [18:00:59.699] - Finished
    [18:00:59.699] - Sha caled by host: 4fd42b104897efb92f6a396b4e15193b842fd35a4463dacd20f2ea64ff354634
    [18:00:59.699] - xip mode Verify
    [18:00:59.709] - Read Sha256/5930
    [18:00:59.709] - Flash xip readsha time cost(ms): 10.215576171875
    [18:00:59.714] - Finished
    [18:00:59.717] - Sha caled by dev: 4fd42b104897efb92f6a396b4e15193b842fd35a4463dacd20f2ea64ff354634
    [18:00:59.717] - Verify success
    [18:00:59.718] - Program Finished
    [18:00:59.718] - All time cost(ms): 10339.205078125
    [18:00:59.831] - [All Success]
    


    Boot log after flashing:

    Start Wi-Fi fw is Done @261ms
    [APP] [EVT] INIT DONE 139
    
    
    [BL] Initi Wi-Fi with MAC #### 70:3E:97:***** ####
         hostname: Bouffalolab_BL602-1e9*****
    [WF] country code CN used, num of channel 13
    -----------------------------------------------------
    [IPC] [TX] Low level size 204, driver size 92, total size 296
    Enable BMX IRQ
    [WF] [KEY] [CFG] nVAP is 2, endidx 10, startidx 8
    ------ set default key 0x42021810, key ptr 0x00000000
    ------ set default key 0x42021be8, key ptr 0x00000000
    歵d_init
    歵d_reset idx=0
    歵d_reset idx=1
    [version] lmac 5.4.0.0
    [version] version_machw_1 000055FB
    [version] version_machw_2 000001B3
    [version] version_phy_1 00822111
    [version] version_phy_2 00000000
    [version] features 000089DF
    [ME] HT supp 1, VHT supp 0
    [WF] country code CN used, num of channel 13
    [WF][SM] reload tsen 
    [WF][SM] Exiting ifaceDown state
    [WF][SM] State Action ###ifaceDown### --->>> ###idle###
    [WF][SM] Entering idle state
    [APP] [EVT] MGMR DONE 153, now 275ms
    ---------STA enable
    [lwip] netif status callback
      IP: 0.0.0.0
      MK: 0.0.0.0
      GW: 0.0.0.0
    [APP] [WIFI] [T] 154
    [APP]   Get STA 0x4201d17c from Wi-Fi Mgmr, pmk ptr 0x42013564, ssid ptr 0x42013540, password 0x420135a8
    [APP]    Empty Config
    [APP]    Try to set the following ENV with psm_set command, then reboot
    [APP]    NOTE: conf_ap_pmk MUST be psm_unset when conf is changed
    [APP]    env: conf_ap_ssid
    [APP]    env: conf_ap_psk
    [APP]    env(optinal): conf_ap_pmk
    [18:12:19.770] - Entering initLog()...
    Commands registered!
    initLog() done!
    [MTD] >>>>>> Hanlde info Dump >>>>>>
          name PSM
          id 0
          offset 0x001e9000(2002944)
          size 0x00008000(32Kbytes)
          xip_addr 0x231d8000
    [MTD] <<<<<< Hanlde info End <<<<<<
    [EF] Found Valid PSM partition, XIP Addr 231d8000, flash addr 001e9000
    *default_env_size = 0x00000001
    EasyFlash V4.0.99 is initialize success
    .
    You can get the latest version on https://github.com/armink/EasyFlash .
    [       696][WARN  : bl_mtd.c: 201] addr@0x2309e640 is xip flash, size 8
    
    Main_Init_Before_Delay done
    
    Main_Init_Delay
    
    Main_Init_Delay done
    Info:MAIN:Main_Init_Before_Delay
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 1 changes count.
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID []
    Info:MAIN:Using Pass []
    Info:MQTT:MQTT_RegisterCallback called for bT obl971E9666/ subT obl971E9666/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bl602s/ subT bl602s/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obl971E9666/ subT cmnd/obl971E9666/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bl602s/ subT cmnd/bl602s/+
    Info:MQTT:MQTT_RegisterCallback called for bT obl971E9666/ subT obl971E9666/+/get
    Error
    :CMD:cmd startScript NOT found (args autoexec.bat)
    Info:MAIN:Main_Init_After_Delay done
    [18:12:20.714] - Info:MAIN:Time 1, idle 0/s, free 108768, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:21.710] - Info:MAIN:Time 2, idle 0/s, free 108768, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:22.720] - Info:MAIN:Time 3, idle 0/s, free 108768, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:23.707] - Info:MAIN:Time 4, idle 0/s, free 108768, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:24.740] - [lwip] netif status callback
      IP: 192.168.11.1
      MK: 255.255.255.0
      GW: 0.0.0.0
    [WF] MM_ADD_IF_REQ Sending: AP
    歵d_start idx=0
    [WF] MM_ADD_IF_REQ Done
    [WF] vif_index from LAMC is 0
    [lwip] netif status callback
      IP: 192.168.169.1
      MK: 255.255.255.0
      GW: 0.0.0.0
    [DHCP] ip_start: [192.168.169.2]
    [DHCP] ip_start: [192.168.169.254]
    [WF][SM] start AP with ssid OpenBL602_971E9666;###
    [WF][SM]               pwd  ;
    [WF][SM               channel  1;
    [WF] APM_START_REQ Sending with vif_index 0
    [WF] received APM Start apm_start_req_handler:77
    [WF] return with other handler
    [WF] APM_START_REQ Done
    [WF] status is 00
    [WF] vif_idx is 00
    [WF] ch_idx is 00
    [WF] bcmc_idx is 03
    [WF][SM] stateGlobalGuard_AP: AP iface has started!
    Info:MAIN:Time 5, idle 0/s, free 108768, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21 
    [APP] [EVT] Unknown code 11, 5734
    [18:12:25.740] - [      6738][WARN  : bl_mtd.c: 201] addr@0x2309e640 is xip flash, size 8
    Info:MAIN:Time 6, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21 
    Info:MAIN:Boot complete time reached (5 seconds)
    [18:12:26.728] - Info:MAIN:Time 7, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:27.733] - Info:MAIN:Time 8, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:28.727] - Info:MAIN:Time 9, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:29.740] - Info:MAIN:Time 10, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:30.731] - Info:MAIN:Time 11, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:31.740] - Info:MAIN:Time 12, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:32.733] - Info:MAIN:Time 13, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:33.750] - Info:MAIN:Time 14, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:34.735] - Info:MAIN:Time 15, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:35.738] - Info:MAIN:Time 16, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:36.737] - Info:MAIN:Time 17, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:37.737] - Info:MAIN:Time 18, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:38.739] - Info:MAIN:Time 19, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:39.741] - Info:MAIN:Time 20, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:40.743] - Info:MAIN:Time 21, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:41.742] - Info:MAIN:Time 22, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:42.748] - Info:MAIN:Time 23, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:43.746] - Info:MAIN:Time 24, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:44.762] - Info:MAIN:Time 25, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:45.757] - Info:MAIN:Time 26, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:46.755] - Info:MAIN:Time 27, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:47.770] - Info:MAIN:Time 28, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:48.755] - Info:MAIN:Time 29, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:49.762] - Info:MAIN:Time 30, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:50.757] - Info:MAIN:Time 31, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:51.760] - Info:MAIN:Time 32, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:52.758] - Info:MAIN:Time 33, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:53.760] - Info:MAIN:Time 34, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:54.760] - Info:MAIN:Time 35, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:55.770] - Info:MAIN:Time 36, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:56.763] - Info:MAIN:Time 37, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:57.770] - Info:MAIN:Time 38, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:58.780] - Info:MAIN:Time 39, idle 0/s, free 108456, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/21
    [18:12:59.770] 
  • #13 20899254
    p.kaczmarek2
    Moderator Smart Home
    So the previous USB to UART converter did not work?
    Helpful post? Buy me a coffee.
  • #14 20899269
    davidcpurdy
    Level 7  
    I was not able to flash onboard w/ the FTDI adapter, but i was able to w the CH340g.

    I’m not sure what the reason is, but I had read years ago that the CH340g was somehow more stable. If I remember correctly it was in reference to flashing ESP8266 chips.

    ============================================

    Following up.... the YX-WS01 that I was able to flash onboard failed about a day later. Not sure what the problem was.

    I was not able to replicate this w/ two more plugs that I found - they would not flash while on the main board - I had to remove and flash them, but they work well.

Topic summary

The discussion revolves around the Amysen YX-WS01 smart plug, which utilizes the TG7100C chip, a clone of the BL602. Users express frustration over the inability to flash the device due to power supply issues and the need for specific connections. The conversation highlights the differences in behavior between the Amysen devices and other models like the Sonoff S40, particularly regarding power consumption and flashing reliability. Users share experiences with various USB to UART converters, noting that the CH340G provided better results than the FTDI adapter for flashing the TG7100C while still on the main board. The importance of proper power supply and grounding connections is emphasized to avoid boot loops and ensure successful flashing.
Summary generated by the language model.
ADVERTISEMENT