Search found 14 matches

by dbrazil
Sun Apr 17, 2022 3:23 pm
Forum: Raspberry Pi microcontroller boards
Topic: [RP2040 Connect] Cannot find source file: aes_encrypt.c
Replies: 1
Views: 1490

Re: [RP2040 Connect] Cannot find source file: aes_encrypt.c

Since I was missing the mynewt-nimble library, I got it from source here: https://github.com/apache/mynewt-nimble Then it couldn't find the file micropython/lib/mynewt-nimble/nimble/host/src/ble_monitor.c in the building process. I saw that in this last version there is no such file, so I checked ou...
by dbrazil
Sun Apr 17, 2022 2:32 pm
Forum: Raspberry Pi microcontroller boards
Topic: [RP2040 Connect] Cannot find source file: aes_encrypt.c
Replies: 1
Views: 1490

[RP2040 Connect] Cannot find source file: aes_encrypt.c

Hi, I tried to build the MicroPython fw for the Arduino Nano RP2040 connect but I hit the error while building: CMake Error at CMakeLists.txt:58 (add_executable): Cannot find source file: .../micropython/lib/mynewt-nimble/ext/tinycrypt/src/aes_encrypt.c Indeed, the mynewt-nimble folder is empty. I'v...
by dbrazil
Sat Sep 25, 2021 7:33 pm
Forum: Development of MicroPython
Topic: Creating new port / Adapting port
Replies: 2
Views: 5043

Creating new port / Adapting port

Hi guys, There's a devkit microcontroller that I would like to use, however it's not yet available as a port of MicroPython. The devkit is made by Adafruit, so it has CircuitPython compatibility. The microcontroller is the ATSAME51 from Atmel. What's the best strategy here, try to port the CircuitPy...
by dbrazil
Tue Jul 20, 2021 6:51 pm
Forum: Raspberry Pi microcontroller boards
Topic: Storing data into RP2040 flash
Replies: 15
Views: 14738

Re: Storing data into RP2040 flash

The efficiency gain with the fixed length binary records of ustruct can be dramatic when storing data in a file because you can use random access. Accessing an 8 byte record from the middle of an N MB file can be fast as the filesystem only needs to retrieve one block. Another technology worth cons...
by dbrazil
Tue Jul 20, 2021 6:47 pm
Forum: Raspberry Pi microcontroller boards
Topic: Storing data into RP2040 flash
Replies: 15
Views: 14738

Re: Storing data into RP2040 flash

- In ports/rp2/boards/PICO/mpconfigboard.h we define MICROPY_HW_FLASH_STORAGE_BYTES which is how many bytes of flash to reserve for the "user accessible flash" (i.e. the rp2.Flash object). This is always at the end of the flash, i.e. offset from PICO_FLASH_SIZE_BYTES (which is 2MiB). The board I'm ...
by dbrazil
Tue Jul 20, 2021 12:28 am
Forum: Raspberry Pi microcontroller boards
Topic: Storing data into RP2040 flash
Replies: 15
Views: 14738

Re: Storing data into RP2040 flash

Basically the filesystem is avoiding ever writing (or erasing) a block unless it has to, and always choosing new blocks over recently used blocks. (But if you need to write a big file those blocks will be immediately reclaimed as needed -- they're not really "taking up space"). Okay, now I understa...
by dbrazil
Tue Jul 20, 2021 12:21 am
Forum: Raspberry Pi microcontroller boards
Topic: How to get a binary string into a bytearray?
Replies: 6
Views: 8931

Re: How to get a binary string into a bytearray?

HI Pip, I believe your question is in the wrong place, since it doesn't solely relates to the RP2040, but to the MicroPython syntax. Anyways, the easiest way of dealing with it is converting to integer, and then appending to the bytearray object. y = bytearray() #bytearray object to receive your dat...
by dbrazil
Mon Jul 19, 2021 10:46 pm
Forum: Raspberry Pi microcontroller boards
Topic: Storing data into RP2040 flash
Replies: 15
Views: 14738

Re: Storing data into RP2040 flash

After playing a little bit with it, it seems wasteful the way MicroPython organizes the files in memory. Every time I rewrite the file, instead of rewriting it to the same memory location, it takes more memory. Example: Writing a json to a file and checking its place in memory using the rp2.Flash : ...
by dbrazil
Mon Jul 19, 2021 6:25 pm
Forum: Raspberry Pi microcontroller boards
Topic: Storing data into RP2040 flash
Replies: 15
Views: 14738

Re: Storing data into RP2040 flash

The NVS feature on ESP32 is basically a very lightweight filesystem (i.e. a way to implement key/value storage on a block device). MicroPython instead just provides the regular filesystems, so even though these two different approaches feel different, they're really the same thing. That's good to k...
by dbrazil
Mon Jul 19, 2021 6:23 pm
Forum: Raspberry Pi microcontroller boards
Topic: Storing data into RP2040 flash
Replies: 15
Views: 14738

Re: Storing data into RP2040 flash

The ujson library is one of four ways to do data serialisation in MicroPython. There are many other approaches, but those are the ones where I'm aware of specific MP variants. Thank you for sharing your notes, that gave a nice overview of the ways I could deal with it. In the short term using ujson...