Replies: 4 comments 12 replies
-
You would need to compile your own firmware with |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarifying. Is this variance documented? If not - should it be? |
Beta Was this translation helpful? Give feedback.
-
Where do I put this code?
CMakeLists.txt?
Från: David Lechner ***@***.***>
Skickat: den 17 november 2022 00:25
Till: micropython/micropython ***@***.***>
Kopia: Per-Olof Bergström ***@***.***>; Manual ***@***.***>
Ämne: Re: [micropython/micropython] btree isn't available (Discussion #9626)
Maybe try this?
diff --git a/extmod/extmod.cmake b/extmod/extmod.cmake
index 2207a951a..f0653a568 100644
…--- a/extmod/extmod.cmake
+++ b/extmod/extmod.cmake
@@ -79,6 +79,7 @@ if(MICROPY_PY_BTREE)
)
target_compile_definitions(micropy_extmod_btree PRIVATE
+ MICROPY_PY_BTREE=1
__DBINTERFACE_PRIVATE=1
mpool_error=printf
abort=abort_
@@ -93,6 +94,7 @@ if(MICROPY_PY_BTREE)
)
list(APPEND MICROPY_DEF_CORE
+ MICROPY_PY_BTREE=1
__DBINTERFACE_PRIVATE=1
"virt_fd_t=void*"
)
-
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Forgs%2Fmicropython%2Fdiscussions%2F9626%23discussioncomment-4161998&data=05%7C01%7C%7C9bb6fccfae674347eff108dac829c7a8%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638042379010918578%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=31k0S%2BJAvCPbcfwQY7UFnUptxM3x9oKvU6qBkcOYtg8%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC67ZPB3XIJISNNLHRIHJRDWIVUMXANCNFSM6AAAAAARFPTGVA&data=05%7C01%7C%7C9bb6fccfae674347eff108dac829c7a8%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638042379010918578%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xiuykJRAO2KycXHU5E8%2F1Dby3e3kjRvTroSNFaFgXGw%3D&reserved=0>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Hi. I'm trying to make a MicroPython build with btree included for the Pico W. But can't get it to work, has anybody had any success with it? I added diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
index 281b0c3bc..dae142b65 100644
--- a/ports/rp2/CMakeLists.txt
+++ b/ports/rp2/CMakeLists.txt
@@ -56,6 +56,7 @@ endif()
# Enable extmod components that will be configured by extmod.cmake.
# A board may also have enabled additional components.
+set(MICROPY_PY_BTREE ON)
set(MICROPY_SSL_MBEDTLS ON)
# Use the local cyw43_driver instead of the one in pico-sdk
@@ -434,6 +435,8 @@ target_link_libraries(${MICROPY_TARGET} micropy_lib_mbedtls)
target_link_libraries(${MICROPY_TARGET} usermod)
+target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
+
target_include_directories(${MICROPY_TARGET} PRIVATE
${MICROPY_INC_CORE}
${MICROPY_INC_USERMOD} It builds successfully and in the output of [ 3%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_close.c.obj
[ 3%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_conv.c.obj
[ 3%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_debug.c.obj
[ 4%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_delete.c.obj
[ 4%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_get.c.obj
[ 4%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_open.c.obj
[ 4%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_overflow.c.obj
[ 4%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_page.c.obj
[ 5%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_put.c.obj
[ 5%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_search.c.obj
[ 5%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_seq.c.obj
[ 5%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_split.c.obj
[ 5%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/btree/bt_utils.c.obj
[ 6%] Building C object CMakeFiles/micropy_extmod_btree.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/lib/berkeley-db-1.xx/mpool/mpool.c.obj
[ 6%] Built target micropy_extmod_btree
...
[ 40%] Building C object CMakeFiles/firmware.dir/Users/mirza/workspace/line/fluid-spotter-firmware/runtime/micropython/extmod/modbtree.c.obj
... |
Beta Was this translation helpful? Give feedback.
-
I see btree is part of micropython libraries https://docs.micropython.org/en/latest/library/btree.html
But I cannot import btree on my Pico W.
Is the doc incorrect? Or am I missing the library somehow?
rp2-pico-w-20221011-unstable-v1.19.1-543-gab317a0d6
Beta Was this translation helpful? Give feedback.
All reactions