Build Secrets
Re: Build Secrets
Definitely prefer the second (i.e. extend the port manifest, rather than duplicating it).
Re: Build Secrets - NRF Programming
NRF FLASHING
OK, here's some information that will save some time for others trying to program the NRF with Chinese STLINK and The Black Magic Probe:
I have tested with openocd, pyocd and gdb, all are latest versions.
The latest firmware of STLINK does not apear to allow mass erase, so this would fail, the others succeeded for me, however you may have to update the firmware on the STLINK if prompted during the flash process.
OK, here's some information that will save some time for others trying to program the NRF with Chinese STLINK and The Black Magic Probe:
I have tested with openocd, pyocd and gdb, all are latest versions.
The latest firmware of STLINK does not apear to allow mass erase, so this would fail, the others succeeded for me, however you may have to update the firmware on the STLINK if prompted during the flash process.
Code: Select all
## SOURCE FILES
BTFW61="some_path/micropython/ports/nrf/drivers/bluetooth/s140_nrf52_6.1.1/s140_nrf52_6.1.1_softdevice.hex";
APPHEX="some_path/holyiot_18010-200106-1070984.hex";
## STLINK-V2 - fails during mass erase (stlink v2 not supports ??)
openocd -f interface/stlink.cfg -f target/nrf52.cfg -c init -c "reset init" -c halt -c "nrf mass_erase" -c "program $BTFW61" -c "program $APPHEX verify" -c reset -c exit
## STLINK-V2
TARGET="--target nrf52";
pyocd cmd -c "reset init" $TARGET;
pyocd cmd -c "halt" $TARGET
pyocd erase --mass-erase $TARGET;
pyocd flash $BTFW61 $TARGET --format hex;
pyocd flash $APPHEX $TARGET --format hex;
pyocd cmd -c "reset" $TARGET;
## BLACK MAGIC PROBE
gdb -ex "target extended-remote /dev/cu.usbmodem79AD7EA61" -ex "monitor tpwr enable" -ex "monitor swdp_scan" -ex "attach 1" -ex "load $BTFW61" -ex "load $APPHEX" -ex quit;
Re: Build Secrets - Frozen Manifest
Ok. What am I doing wrong?
I have these two lines in my frozen manifest file:
Instead of getting a module named uasyncio, I got modules called '__init__, asyn, core, queues, and synchro'.
These are the python files in the directory '../../../../../Micropython-Library-Development/lib/uasyncio'
The module unittest appears fine. How do you include a module that is a subdirectory of files with __init__.py?
Rich
I have these two lines in my frozen manifest file:
Code: Select all
freeze('../../../../../Micropython-Library-Development/lib/uasyncio')
freeze('../../../../../Micropython-Library-Development/lib/','unittest.py')
These are the python files in the directory '../../../../../Micropython-Library-Development/lib/uasyncio'
The module unittest appears fine. How do you include a module that is a subdirectory of files with __init__.py?
Code: Select all
>>> help('modules')
__init__ micropython ucollections urandom
__main__ network uctypes ure
_onewire xxxx uerrno uselect
asyn pyb uhashlib usocket
builtins queues uheapq ustruct
cmath stm uio utime
core synchro ujson utimeq
framebuf sys umachine uzlib
gc uarray unittest
math ubinascii uos
Plus any modules on the filesystem
>>>
devnull wrote: ↑Tue Dec 24, 2019 3:02 amIf you have a custom manifest file, In order to include the files in the port/modules folder (which are the default frozen files) you need to include the modules folder in your manifest file:
ORCode: Select all
freeze('$(PORT_DIR)/modules')
If you don't then things might be broken, such as on the esp32 you will be unable to access the file systemCode: Select all
include('$(PORT_DIR)/boards/manifest.py') freeze("modules")
Re: Build Secrets
This is a bit weird, but there's an example in ports/esp8266/manifest_release.pyRWLTOK wrote: ↑Mon Mar 02, 2020 1:22 amInstead of getting a module named uasyncio, I got modules called '__init__, asyn, core, queues, and synchro'.
These are the python files in the directory '../../../../../Micropython-Library-Development/lib/uasyncio'
The module unittest appears fine. How do you include a module that is a subdirectory of files with __init__.py?
Code: Select all
# uasyncio
freeze("$(MPY_LIB_DIR)/uasyncio", "uasyncio/__init__.py")
freeze("$(MPY_LIB_DIR)/uasyncio.core", "uasyncio/core.py")
Re: Build Secrets
Thanks jimmo,
It does make sense.
Rich
It does make sense.
Rich
jimmo wrote: ↑Mon Mar 02, 2020 1:44 amThis is a bit weird, but there's an example in ports/esp8266/manifest_release.pyRWLTOK wrote: ↑Mon Mar 02, 2020 1:22 amInstead of getting a module named uasyncio, I got modules called '__init__, asyn, core, queues, and synchro'.
These are the python files in the directory '../../../../../Micropython-Library-Development/lib/uasyncio'
The module unittest appears fine. How do you include a module that is a subdirectory of files with __init__.py?
It makes sense when you realise that the second argument is also the effective destination path, but I also realise that's a bit non-intuitive.Code: Select all
# uasyncio freeze("$(MPY_LIB_DIR)/uasyncio", "uasyncio/__init__.py") freeze("$(MPY_LIB_DIR)/uasyncio.core", "uasyncio/core.py")