GPY full flash erase
-
@kjm You can simple create that file locally and copy it to your device, either using atom or adafruit ampy. With ampy call:
ampy -p <your_com_port> put pybytes_config.json
/flash is the default directory of the GPY file system, with e.g. boot.py and main.py.
Edit: I can compile later today a non-pybytes GPY image and send the link. -
@kjm There is a GPY package here: https://github.com/robert-hh/Shared-Stuff
-
/flash is the default directory of the GPY file system, with e.g. boot.py and main.py.
Edit: I can compile later today a non-pybytes GPY image and send the link.Yeah I know what \flash is, but my 1.20.1.r1 does not have that file,
['boot.py', 'cert', 'lib', 'main.py', 'sys']So there is no 1.20.1r1 without pybyte firmware?
-
@robert-hh said in GPY full flash erase:
@kjm There is a GPY package here: https://github.com/robert-hh/Shared-Stuff
Much obliged I'll give it a try. As a matter of interest, does compiling your own firmware let you modify micropython? For example are you able to change the default 20s timeout micropython has for most OSErrors?
-
@kjm Most of the source code is available. There are only a few binary blobs for specific drivers. The espressif RTOS source is also provided. So yes, in theory you can change everything. But it is quite a pack of software. I do not agree that most OSErrors have a 20 s timeout. Only those which by its semantics require waiting, like the ones dedicated to communication.
-
@robert-hh said in GPY full flash erase:
There is a GPY package here: https://github.com/robert-hh/Shared-Stuff
Thanks, @robert-hh. We took a bunch of your builds scattered around the forum and gave them a canonical home on our page for Inofficial firmware images for Pycom devices in order to be able to find them back easier.
We hope that you and all others are fine with that.
To whom that may concern:
I've tried to reflect the copyright and license terms of Pycom as good as possible, please let me know if I missed something relevant.it is quite a pack of software
True. Thanks to all software authors for your hard work on that!
-
@andreas My build typicall include some utility scripts in frozen bytecode:
- mount.py - Mount the SD card
- pye_mp.py - A file editor which runs on the Pyxx device. Typically imported as
from pye_mp import pye. Then you can type: pye("filename"). For the documentation look here: https://github.com/robert-hh/Micropython-Editor - uping.py - a ping utility
- upysh.py - a small set of unix like commands, typically imported as
from uping import *
-
@robert-hh I've updated the documentation accordingly [1]. Thanks a bunch and keep up the spirit.
[1] https://packages.hiveeyes.org/hiveeyes/foss/pycom/#robert-hh
P.S.: We might really want to divert that discussion into another thread ;]. Nevertheless, thanks for bringing us to these topics, finally making me build a humble hut for community-based firmware images.
-
Only those which by its semantics require waiting, like the ones dedicated to communication.
You're right the 20s wait when a DNS lookup fails at getaddrinfo in urequests really bugs me. In reality if a DNS server hasn't replied in a tenth of that time it's not going to. I'd kill to be able to tweak that value.
-
Now we are really getting things mixed up within this conversation.
@kjm said in GPY full flash erase:
the 20s wait when a DNS lookup fails at getaddrinfo in urequests really bugs me. In reality if a DNS server hasn't replied in a tenth of that time it's not going to. I'd kill to be able to tweak that value.
Let's divert that to the thread where you already started this topic [1], right?
-
@robert-hh said in GPY full flash erase:
@andreas My build typicall include some utility scripts in frozen bytecode:
- mount.py - Mount the SD card
- pye_mp.py - A file editor which runs on the Pyxx device. Typically imported as
from pye_mp import pye. Then you can type: pye("filename"). For the documentation look here: https://github.com/robert-hh/Micropython-Editor - uping.py - a ping utility
- upysh.py - a small set of unix like commands, typically imported as
from uping import *
Confirming adhoc wifi working in your 1.20.1.r1 firmware Robert. How do I use your utilities? For example what would I type in the Atom console to try uping? Is there a way to see the full extent of the flash memory in Atom/Filezilla? Do I need a new windows or unix program to see deeper into the gpy flash?
-
@kjm for uping, type e.g.:
from uping import ping. ping(host_address, interval=<ms>)The host address can be numeric or symbolic. The 10 ms default for interval is a little bit short for the xxPy devices. I typically use 500. This is the def line:
def ping(host, count=4, timeout=5000, interval=10, quiet=False, size=64):The git repor is here: https://gist.github.com/91cc8979e33e82af6d99ec34c38195fb.git
-
@robert-hh Thnx for that. Suppose I wanted to edit uping what extra software do I need on my Windows PC to do that? Filezilla & Atom seem to show me only a limited part of the total flash memory. I would like to move towards being able to include my boot.py in the firmware in case LittleFS is not the great saviour of reformatted/removed/randomly-syntax-errored user programs most people seem to think it is.
-
@kjm If you want to include code into the firmware as so called "frozen bytecode", you must set up the firmware build environment. That is based on Linux. For building, you can use a virtual machine. There are some hints that WSL (Windows Subsystem for Linux = Linux inside Windows) works too. Only flashing requires then the native machine. These are two big steps, a) setting up and dealing with a virtual machine, b) setting up the firmware build environment. a) is relatively straightforward, b) is more tricky, even if well documented.
P.S.: boot.py and main.py are, as it is now, always executed from the file system. Of course you can change the code of mptask.c to let them start from the flash. But there are already two files, _boot.py and _main.py, which just do that. -
@robert-hh I've got a ubuntu VM running under windows, would it be able to flash a GPY? If so, can you link me to a guide for b) setting up the firmware build environment?
-
@kjm You can use that to build the firmware package. The actual flashing must be done on Windows, since the VM's usually have issues with USB devices. For builing, follow the instructions in the README.me here:
https://github.com/pycom/pycom-micropython-sigfox
and here:
https://github.com/pycom/pycom-micropython-sigfox/tree/Dev/esp32
and the links therein.
Follow the instructions carefully. My favorite pitfalls are:- you forgot to set environment variables
- you forgot the command "git submodule update --init"
- you selected the wrong branch. It is Dev for micropython and idf_v3.2 for the esp-idf. That changes from time to time.
-
I don't think pycom would refuse to promote pybytes as there entry into service business.
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