|
1 |
| -# sparkfun-pico |
2 |
| -Libraries, examples and links in support of the Raspberry Pi rp2 silicon boards and associated software. |
| 1 | +# SparkFun Examples/Utilities for the Raspberry Pi rp2* Processors |
| 2 | + |
| 3 | +The repository contains a set of utilities, structured for use with the Raspberry Pico SDK. This are target a new or unique functionality not fully supported by the standard ```pico-sdk``` yet, or that are unique to SparkFun Boards. |
| 4 | + |
| 5 | +## The sparkfun_pico CMake library |
| 6 | + |
| 7 | +A majority of the functionality outlined in this repository is contained in the folder ```sparkfun_pico```. This folder is structured as a ```cmake``` library, ready for use by the ```pico-sdk``` build environment. |
| 8 | + |
| 9 | +### General Use |
| 10 | + |
| 11 | +For a majority of the examples provided in this repository - especially those related to the use of PSRAM on the RP2350 - the following steps are used to build the examples: |
| 12 | + |
| 13 | +* Clone this repository |
| 14 | +* CD into the cloned repository |
| 15 | +* Checkout the submodules in the repository (```git submodule update --init --recursive```) |
| 16 | +* For an example that uses the ```sparkfun_pico``` library, copy ```sparkfun_pico``` folder in this repository to the example folder. (```cd examples/myexample; cp -R ../../sparkfun_pico .```) |
| 17 | + |
| 18 | +At this point, the examples are built following the standard ```pico-sdk``` build process. |
| 19 | + |
| 20 | +>>[!NOTE] |
| 21 | +>> Specify the target SparkFun Board when calling cmake. |
| 22 | +
|
| 23 | +```sh |
| 24 | +export PICO_SDK_PATH=<the path to the pico-sdk> |
| 25 | +cd examples/has_psram |
| 26 | +mkdir build |
| 27 | +cmake .. -DPICO_BOARD=sparkfun_promicro_rp2350 |
| 28 | +make |
| 29 | +``` |
| 30 | + |
| 31 | +### Examples |
| 32 | + |
| 33 | +This repository contains the following examples: |
| 34 | + |
| 35 | +#### [has_psram](examples/has_psram) |
| 36 | + |
| 37 | +One of the more simple examples, this example shows how to detect if PSRAM is on the rp2350 board, and the size of the PSRAM available. It also walks through the available PSRAM, manually setting and verifying values. |
| 38 | + |
| 39 | +#### [psram_allocator](examples/psram_allocator) |
| 40 | + |
| 41 | +This example detects the PSRAM available on the board, and adds it to an allocator, which manages the *allocation* of the PSRAM. PSRAM is accessed (allocated) using a provided API, which mimics the standard malloc/free functionality. |
| 42 | + |
| 43 | +A "Two-Level Segregated Fit" (flsf) allocator is used from [here](https://github.com/espressif/tlsf). |
| 44 | + |
| 45 | +#### [all_allocator](examples/all_allocator) |
| 46 | + |
| 47 | +This example detects the PSRAM available on the board, and adds it as well as the built in SRAM based heap to an allocator to provide an unified access to available memory. The allocator manages the *allocation* of the PSRAM and heap SRAM via a single API. The example also ```wraps``` the built in ```malloc``` and ```free``` suite of commands to integrate with existing examples and uses. |
| 48 | + |
| 49 | +A "Two-Level Segregated Fit" (flsf) allocator is used from [here](https://github.com/espressif/tlsf). |
| 50 | + |
| 51 | +#### [test_qflash](examples/test_qflash) |
| 52 | + |
| 53 | +This is a simple example that is used to verify the Quad SPI bit is set in the flash IC used on the attached board. It doesn't require the use of the ```sparkfun_pico``` library, but is helpful during board development and fits with the goals of this repository. |
0 commit comments