Post
by Jibun no kage » Tue Aug 23, 2022 5:56 pm
Ok, I did get the drivers and frozen modules excluded from the standard pico build image. For example, neopixel, dht, onewire excluded. Was not sure why ds18x20 disappeared at first, then I recalled it is 1-wire sensor, and since I removed such from mpconfigport.h, it can't exist, so all good so far. However, when I tried to create a custom board definition hit a bump, see below.
//-----
// Custom PICO Image Test...
// Remove Select Drivers And Frozen Modules...
$ cp ~/micropython/ports/rp2/mpconfigport.h mpconfigport.h.original
$ nano ~/micropython/ports/rp2/mpconfigport.h
#define MICROPY_PY_ONEWIRE (0)
$ cp ~/micropython/ports/rp2/boards/manifest.py ~/micropython/ports/rp2/boards/manifest.py.original
$ nano ~/micropython/ports/rp2/boards/manifest.py
#freeze("$(MPY_DIR)/drivers/onewire")
#freeze("$(MPY_DIR)/drivers/dht", "dht.py")
#include("$(MPY_DIR)/drivers/neopixel/manifest.py")
$ cd ~/micropython/ports/rp2
$ make BOARD=PICO
MicroPython v1.19.1-315-g13dceaa4e-dirty on 2022-08-23; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import micropython
>>> dir(micropython)
['__class__', '__name__', 'const', 'alloc_emergency_exception_buf', 'heap_lock', 'heap_unlock', 'kbd_intr', 'mem_info', 'opt_level', 'qstr_info', 'schedule', 'stack_use']
>>> help('modules')
__main__ math ubinascii uos
_boot micropython ucollections urandom
_boot_fat rp2 ucryptolib ure
_rp2 uarray uctypes uselect
_thread uasyncio/__init__ uerrno ustruct
_uasyncio uasyncio/core uhashlib usys
builtins uasyncio/event uheapq utime
cmath uasyncio/funcs uio uzlib
framebuf uasyncio/lock ujson
gc uasyncio/stream umachine
Plus any modules on the filesystem
// Latest Nightly Buiid...
// v1.19.1-315-g13dceaa4e (2022-08-23) .uf2
MicroPython v1.19.1 on 2022-08-23; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import micropython
>>> dir(micropython)
['__class__', '__name__', 'const', 'alloc_emergency_exception_buf', 'heap_lock', 'heap_unlock', 'kbd_intr', 'mem_info', 'opt_level', 'qstr_info', 'schedule', 'stack_use']
>>> help('modules')
__main__ framebuf uasyncio/funcs ujson
_boot gc uasyncio/lock umachine
_boot_fat math uasyncio/stream uos
_onewire micropython ubinascii urandom
_rp2 neopixel ucollections ure
_thread onewire ucryptolib uselect
_uasyncio rp2 uctypes ustruct
builtins uarray uerrno usys
cmath uasyncio/__init__ uhashlib utime
dht uasyncio/core uheapq uzlib
ds18x20 uasyncio/event uio
Plus any modules on the filesystem
//-----
// Custom PICO Board Test...
// Remove Select Drivers And Frozen Modules...
// Add Custom Board Definition...
$ cp -ar ~/micropython/ports/rp2/board/PICO ~/micropython/ports/rp2/board/PICO_DD
$ cd ~/micropython/ports/rp2/board/PICO_DD
$ nano board.json
"id": "rp2-pico-dd",
$ make BOARD=PICO_DD
[ -e build-PICO_DD/Makefile ] || cmake -S . -B build-PICO_DD -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO_DD
PICO_SDK_PATH is /home/crosstoolng/micropython/lib/pico-sdk
PICO platform is rp2040.
Build type is MinSizeRel
PICO target board is pico_dd.
CMake Error at /home/crosstoolng/micropython/lib/pico-sdk/src/boards/generic_board.cmake:22 (message):
Unable to find definition of board 'pico_dd' (specified by PICO_BOARD):
Looked for pico_dd.h in /home/crosstoolng/micropython/lib/pico-sdk/src/boards/include/boards (additional paths specified by PICO_BOARD_HEADER_DIRS)
Looked for pico_dd.cmake in /home/crosstoolng/micropython/lib/pico-sdk/src/boards (additional paths specified by PICO_BOARD_CMAKE_DIRS)
Call Stack (most recent call first):
/home/crosstoolng/micropython/lib/pico-sdk/src/board_setup.cmake:28 (include)
/home/crosstoolng/micropython/lib/pico-sdk/src/CMakeLists.txt:15 (include)
-- Configuring incomplete, errors occurred!
See also "/home/crosstoolng/micropython/ports/rp2/build-PICO_DD/CMakeFiles/CMakeOutput.log".
See also "/home/crosstoolng/micropython/ports/rp2/build-PICO_DD/CMakeFiles/CMakeError.log".
make: *** [Makefile:26: all] Error 1
I copied the header file for my custom board definition...
cp ~/micropython/lib/pico-sdk/src/boards/include/boards/pico.h ~/micropython/lib/pico-sdk/src/boards/include/boards/pico-dd.h
But still got the error that the cmake file could not find it? The cmake should accept what it receives from what I can tell looking at the cmake file its self. So not sure what is going on here.
I thought it would use the generic by default... "include(boards/generic_board.cmake)"