logo elektroda
logo elektroda
X
logo elektroda

ESP8266+Eclipse+MinGW+SDK Mikhail Grigoriev''a = LED blink not working

dondu 1326 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17816620
    dondu
    Moderator on vacation ...
    I have a Wemos D1 board in this version:

    ESP8266+Eclipse+MinGW+SDK Mikhail Grigoriev''a = LED blink not working .

    I installed the environment according to this guide: http://www.bot4u.pl/arm/kilka-slow-o-esp8266-w-jezyku-c/

    From the examples installed from the SDK, I chose the basic Blink:

    Code: C / C++
    Log in, to see the code
    .

    Compilation and upload log:

    Quote:
    11:26:17 **** Build of configuration Default for project blinky ****
    mingw32-make.exe -f C:/Espressif/examples/ESP8266/blinky/Makefile flash
    c:/Espressif/utils/ESP8266/esptool.exe -p COM4 -b 256000 write_flash -ff 40m -fm qio -fs 8m 0x00000 firmware/eagle.flash.bin 0x10000 firmware/eagle.irom0text.bin
    esptool.py v1.2-dev
    Connecting...
    Running Cesanta flasher stub...
    Flash params set to 0x0020
    Writing 28672 @ 0x0... 0 (0 %)1024 (3 %)2048 (7 %)3072 (10 %)4096 (14 %)5120 (17 %)6144 (21 %)7168 (25 %)8192 (28 %)9216 (32 %)10240 (35 %)11264 (39 %)12288 (42 %)13312 (46 %)14336 (50 %)15360 (53 %)16384 (57 %)17408 (60 %)18432 (64 %)19456 (67 %)20480 (71 %)21504 (75 %)22528 (78 %)23552 (82 %)24576 (85 %)25600 (89 %)26624 (92 %)27648 (96 %)28672 (100 %)

    Wrote 28672 bytes at 0x0 in 1.1 seconds (207.2 kbit/s)...
    Writing 196608 @ 0x10000... 0 (0 %)1024 (0 %)2048 (1 %)3072 (1 %)4096 (2 %)5120 (2 %)6144 (3 %)7168 (3 %)8192 (4 %)9216 (4 %)10240 (5 %)11264 (5 %)12288 (6 %)13312 (6 %)14336 (7 %)15360 (7 %)16384 (8 %)17408 (8 %)18432 (9 %)19456 (9 %)20480 (10 %)21504 (10 %)22528 (11 %)23552 (11 %)24576 (12 %)25600 (13 %)26624 (13 %)27648 (14 %)28672 (14 %)29696 (15 %)30720 (15 %)31744 (16 %)32768 (16 %)33792 (17 %)34816 (17 %)35840 (18 %)36864 (18 %)37888 (19 %)38912 (19 %)39936 (20 %)40960 (20 %)41984 (21 %)43008 (21 %)44032 (22 %)45056 (22 %)46080 (23 %)47104 (23 %)48128 (24 %)49152 (25 %)50176 (25 %)51200 (26 %)52224 (26 %)53248 (27 %)54272 (27 %)55296 (28 %)56320 (28 %)57344 (29 %)58368 (29 %)59392 (30 %)60416 (30 %)61440 (31 %)62464 (31 %)63488 (32 %)64512 (32 %)65536 (33 %)66560 (33 %)67584 (34 %)68608 (34 %)69632 (35 %)70656 (35 %)71680 (36 %)72704 (36 %)73728 (37 %)74752 (38 %)75776 (38 %)76800 (39 %)77824 (39 %)78848 (40 %)79872 (40 %)80896 (41 %)81920 (41 %)82944 (42 %)83968 (42 %)84992 (43 %)86016 (43 %)87040 (44 %)88064 (44 %)89088 (45 %)90112 (45 %)91136 (46 %)92160 (46 %)93184 (47 %)94208 (47 %)95232 (48 %)96256 (48 %)97280 (49 %)98304 (50 %)99328 (50 %)100352 (51 %)101376 (51 %)102400 (52 %)103424 (52 %)104448 (53 %)105472 (53 %)106496 (54 %)107520 (54 %)108544 (55 %)109568 (55 %)110592 (56 %)111616 (56 %)112640 (57 %)113664 (57 %)114688 (58 %)115712 (58 %)116736 (59 %)117760 (59 %)118784 (60 %)119808 (60 %)120832 (61 %)121856 (61 %)122880 (62 %)123904 (63 %)124928 (63 %)125952 (64 %)126976 (64 %)128000 (65 %)129024 (65 %)130048 (66 %)131072 (66 %)132096 (67 %)133120 (67 %)134144 (68 %)135168 (68 %)136192 (69 %)137216 (69 %)138240 (70 %)139264 (70 %)140288 (71 %)141312 (71 %)142336 (72 %)143360 (72 %)144384 (73 %)145408 (73 %)146432 (74 %)147456 (75 %)148480 (75 %)149504 (76 %)150528 (76 %)151552 (77 %)152576 (77 %)153600 (78 %)154624 (78 %)155648 (79 %)156672 (79 %)157696 (80 %)158720 (80 %)159744 (81 %)160768 (81 %)161792 (82 %)162816 (82 %)163840 (83 %)164864 (83 %)165888 (84 %)166912 (84 %)167936 (85 %)168960 (85 %)169984 (86 %)171008 (86 %)172032 (87 %)173056 (88 %)174080 (88 %)175104 (89 %)176128 (89 %)177152 (90 %)178176 (90 %)179200 (91 %)180224 (91 %)181248 (92 %)182272 (92 %)183296 (93 %)184320 (93 %)185344 (94 %)186368 (94 %)187392 (95 %)188416 (95 %)189440 (96 %)190464 (96 %)191488 (97 %)192512 (97 %)193536 (98 %)194560 (98 %)195584 (99 %)196608 (100 %)

    Wrote 196608 bytes at 0x10000 in 7.6 seconds (208.3 kbit/s)...
    Leaving...

    11:26:27 Build Finished. 0 errors, 0 warnings. (took 9s.683ms)
    .

    I check the status of pin D2 - unfortunately a continuous high state.

    Have I missed something?
  • ADVERTISEMENT
  • Helpful post
    #2 17817157
    Mscichu
    Level 18  
    Pin D2 (according to the Arduino description) is GPIO4. By defining the pin number, you define the ESP8266 pin. The best way is to print yourself a table: https://wiki.wemos.cc/products:d1:d1 and see which Arduino pin (the one with the letter D) corresponds to the ESP pin. The way you wrote it down you should have a user LED flashing.
  • ADVERTISEMENT
  • Helpful post
    #3 17817441
    khoam
    Level 42  
    Mscichu wrote:
    as you wrote it down you should have a user LED flashing.
    .
    Bult-in LED which corresponds to GPIO2

    ESP8266+Eclipse+MinGW+SDK Mikhail Grigoriev''a = LED blink not working

    By the way, it looks like you have an old version of the WeMos D1 - there are WeMos D1 R2s being sold at the moment. There is a version designation on the back of the board.
  • ADVERTISEMENT
  • #4 17817517
    dondu
    Moderator on vacation ...
    I have the D1 R1 version:

    ESP8266+Eclipse+MinGW+SDK Mikhail Grigoriev''a = LED blink not working .

    I have tried on GPIO2 (D9), GPIO4 (D14). No result - I even check with an oscilloscope.
    When I tried to set the GPIO16 (D2) pin:

    Code: C / C++
    Log in, to see the code
    .
    this gave an error of no definition of these labels.

    So I checked what the definitions were in the eagle_soc.h header:

    Code: C / C++
    Log in, to see the code
    .

    So I looked into the ESP8266 documentation:

    ESP8266+Eclipse+MinGW+SDK Mikhail Grigoriev''a = LED blink not working .

    And here's the conundrum - the register addresses are different.
    In the eagle_soc.h header:

    Code: C / C++
    Log in, to see the code
    .

    The start of the addresses is different 0x60000800 vs 0x60000300
    additionally for GPIO2 the offset is 0x38 accordingly and in the documentation 0x30.

    As a result, the GPIO2 register address is:
    - 0x60000838 (according to eagle_soc.h header)
    - 0x60000330 (according to the documentation)

    and hence there is a problem. But why? Maybe I installed something wrong or somewhere I should select/enable an option?

    I am providing the makefile just in case:

    Code: Bash
    Log in, to see the code
    .
  • #5 17817749
    khoam
    Level 42  
    dondu wrote:
    Beginning addresses are different 0x60000800 vs 0x60000300
    additionally for GPIO2 the offset is 0x38 respectively 0x30 in the documentation.
    As a result the GPIO2 register address is:
    - 0x60000838 (according to eagle_soc.h header)
    - 0x60000330 (according to documentation)
    .

    In the official SDK from Espressif there are exactly the same PERIPHS_IO_MUX and PERIPHS_IO_MUX_GPIO2_U definitions as in this unofficial "Soviet" SDK, so this is probably not where the problem is.
    https://github.com/espressif/ESP8266_NONOS_SDK/blob/v3.0/include/eagle_soc.h

    Added after 1 [hour] 8 [minutes]: .

    According to "Kolban’s book on the ESP8266", the GPIO mapping when using GPIO_OUTPUT_SET() for the ESP-12 (there is an ESP-12E on the board) should be as in the table below. I would try to verify this just in case.

    ESP8266+Eclipse+MinGW+SDK Mikhail Grigoriev''a = LED blink not working .
ADVERTISEMENT