Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Using ESP-IDF for C programming on WiPy

    Scheduled Pinned Locked Moved WiPy 2&3
    13 Posts 4 Posters 552 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      EngeenerAtendee
      last edited by

      Hi!

      Some time ago I've decided to leave micropython and start development in C (University requirements..). As we all know WiPy 3.0 is based on ESP32, so I've tried to use ESP-IDF.
      I got following error:

      A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x08)
      

      I'm using WiPy 3.0 with FTDI USB converter on breadboard. I've installed all drivers for ftdi. Tried using Pycom branch of ESP-IDF. Still same problem.

      Converter is connected to default pins on board.

      Any ideas, why it is not working?

      Maybe I should buy Expansion Board?

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @EngeenerAtendee
        last edited by

        @EngeenerAtendee You have to connect GPIO0 (=P2) to GND and push reset, to set the ESP32 into firmware update mode. Then firmware upload should work.

        1 Reply Last reply Reply Quote 0
        • E Offline
          EngeenerAtendee
          last edited by

          @robert-hh
          In firmware update mode I have timeout problem.
          I've connected P02 to GND and pushed reset. LED stopped blinking. I've run "make flash" and this error occurred:

          /dev/cu.usbserial-AC0210YS failed to connect: Failed to connect to ESP32: Timed out waiting for packet header
          
          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @EngeenerAtendee
            last edited by

            @EngeenerAtendee Try to lower the baud rate with:

            make ESPBAUD=230400 flash

            E 1 Reply Last reply Reply Quote 0
            • E Offline
              EngeenerAtendee @robert-hh
              last edited by

              @robert-hh

              No difference. Timeout in firmware update mode and Invalid head of packets in normal mode.

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @EngeenerAtendee
                last edited by

                @EngeenerAtendee If you connect P2 (which is GPIO0) to GND, open a terminal emulator (e.g. putty, .. ) with 115200 baud and push reset, you should see a message like:

                rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
                waiting for download
                

                If not, the device is not in download mode or connected wrong.

                E M 2 Replies Last reply Reply Quote 1
                • E Offline
                  EngeenerAtendee @robert-hh
                  last edited by

                  @robert-hh
                  You were right!
                  I achieved success after changing UART converter GND to WiPy GND. Now it works. Thanks!

                  robert-hhR 1 Reply Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @EngeenerAtendee
                    last edited by

                    @EngeenerAtendee That#s good. However, if GND is connected between UART converted and WiPy, it should not matter on which side you connect P2 to GND.

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      AE print
                      last edited by AE print

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        Mr Admin @robert-hh
                        last edited by

                        @robert-hh
                        I find (on LO1 module) that it requires both P2 and P8 to be at GND when RST happens to get the UART downloader to work.

                        And depending on the quality of your jumper connections (or rats nest...) it will work at up to 960000 (ish) baud, or only at 115200....

                        robert-hhR A 2 Replies Last reply Reply Quote 1
                        • robert-hhR Offline
                          robert-hh @Mr Admin
                          last edited by

                          @Mr-Admin P8 (GPIO2) has an internal Pull-Down. So if you leave it floating, it will read as 0.

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            AE print
                            last edited by AE print

                            @robert-hh
                            I was not able to flash my program via esp32-idf terminal as well due to the same time-out error, or sometimes (There is not serial data received).
                            When I connect P2 to GND, I get this error: flash read error x1000, which I think indicates an error while trying to access the flash mem.

                            When the P2 is not connected to GND, I do not see (Download_boot(UART...)), but instead, I see (SPI_fast_flash).

                            Any held in this is very appreciated.

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              AE print @Mr Admin
                              last edited by

                              @Mr-Admin
                              I did it, and it worked for me!
                              Thank you so much for pointing that out!

                              1 Reply Last reply Reply Quote 0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              • 1 / 1
                              • First post
                                Last post

                              Pycom on Twitter

                              Pycom