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

    Problem with building fw from source

    Scheduled Pinned Locked Moved LoPy
    lopydevelopment
    4 Posts 3 Posters 845 Views 3 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.
    • W Offline
      wstallwood
      last edited by

      I'm setting up the toolchain to build the firmware from source, however this is running in a container in a cloud environment and we plan to use the OTA mechanism to push out to our devices with our application code built into MPY's from the frozen directory.

      However I am hitting a problem.

      I’ve got a built toolchain now in a container, I’m not using Jenkins so had to figure out the build steps from the Jenkins jobs

      I can build a lopy image now from the latest release zip on github. I am building with

      make BOARD=LOPY CLEAN
      make BOARD=LOPY TARGET=boot
      make BOARD=LOPY LORA_BAND=USE_BAND_868 TARGET=app

      I note at this point lora.bin is bigger than expected compared to the firmware versions I've unpacked before (1.2M)

      I tried adding our python to the frozen directory, then lora.bin ended up at circa 1.6M

      I manually built these into a tgz file, along with the generated partitions.bin bootloader.bin and script

      If I flash this with the pyupdate utility (the one used for the manual upgrade/downgrade process) the flash process completes with no errors but on booting a board I get this

      rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
      flash read err, 1000
      Falling back to built-in command interpreter.
      OK

      ets Jun 8 2016 00:22:57

      Output from upgrade tool is below

      Connecting........_
      Uploading stub...
      Running stub...
      Stub running...
      Changing baud rate to 921600
      Changed.
      Erasing 262144 bytes at address 1000
      Erasing 262144 bytes at address 41000
      Erasing 262144 bytes at address 81000
      Erasing 262144 bytes at address c1000
      Erasing 262144 bytes at address 101000
      Erasing 262144 bytes at address 141000
      Erasing 262144 bytes at address 181000
      Erasing 262144 bytes at address 1c1000
      Auto-detected Flash size: 4MB
      Compressed 844056 bytes to 844320...
      Wrote 844056 bytes (844320 compressed) at 0x00001000 in 12.0 seconds (effective 565.1 kbit/s)...
      Hash of data verified.

      Leaving...
      Auto-detected Flash size: 4MB
      Compressed 3072 bytes to 139...
      Wrote 3072 bytes (139 compressed) at 0x00008000 in 0.0 seconds (effective 1581.4 kbit/s)...
      Hash of data verified.

      Leaving...
      Auto-detected Flash size: 4MB
      Compressed 1292720 bytes to 842112...
      Wrote 1292720 bytes (842112 compressed) at 0x00010000 in 12.7 seconds (effective 817.2 kbit/s)...
      Hash of data verified.

      Leaving...

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

        @wstallwood In order to flash that to the device, just use the command:

        make flash

        in the ESP32 directory, where you have build the binaries. You have to connect P2 to GND, if you did taht before too. If you want to clean out your build, use:

        make clean

        1 Reply Last reply Reply Quote 0
        • W Offline
          wstallwood
          last edited by

          Thanks Robert,

          I can't do make flash because my container with the toolchain is part of a cloud environment. So my idea was to build up to the flash image in the same way Pycom do when they distribute firmware in the tgz files and test from that.

          Eventually the build will go into a OTA update mechanism (hence why it's cloud hosted).

          sebS 1 Reply Last reply Reply Quote 0
          • sebS Offline
            seb @wstallwood
            last edited by seb

            @wstallwood
            It sounds like in your application OTA updates would be the easiest. With firmwares older than 1.7.2.b1 you can use the generated appimg.bin to do a OTA update, after that you just need to use the regular firmware bin file for OTA. Please checkout this example: https://docs.pycom.io/chapter/tutorials/all/ota.html

            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