https://github.com/ambadran/rp-cmake-generator
Python Script to generate and update CMake files needed for any Project based on the `pico-sdk` for raspbery pi pico, pico W or any other rp2040, rp2350 board
https://github.com/ambadran/rp-cmake-generator
Last synced: about 1 month ago
JSON representation
Python Script to generate and update CMake files needed for any Project based on the `pico-sdk` for raspbery pi pico, pico W or any other rp2040, rp2350 board
- Host: GitHub
- URL: https://github.com/ambadran/rp-cmake-generator
- Owner: ambadran
- Created: 2024-10-24T13:01:51.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T18:57:14.000Z (8 months ago)
- Last Synced: 2024-10-25T15:58:48.740Z (8 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CMake files Generator for 'pico-sdk' projects
Python program to automate the generation of the necessary CMake files to ease the compilation, automatically update CMakeLists.txt file and upload of any rp2040, rp2350 board.
By updating CMakeLists.txt file, I mean it will automatically see all the *.c files in your directory and remove them if removed from folder.
**IMP**: This script basically does the exact steps mentioned in the "getting-started-with-pico.pdf" under section "Manually Create your own Project" on page-37.
**IMP**: the `PICO_SDK_PATH` environment variable MUST BE DEFINED to be the path to the 'pico-sdk' folder.
## What is does:
- create empty 'main.c'
- creates the CMakeLists.txt file with `PROJECT_NAME` being the name of the folder it is in
- copies the 'pico_sdk_import.cmake' into project folder from the `PICO_SDK_PATH` folder
- create 'build/' folder
- runs `cmake ..` in the 'build/' folder
- using the `update` parameter, it will update the CMakeLists.txt file with the current executables## Installation:
Assuming you've set the `PICO_SDK_PATH` environment path variable, You can create an alias `rpproject` in your .zshrc/.bashrc file to the cli.py file.
alias rpproject="python3 ~/.../rp-makefile-generator/cli.py"
Then source the file ofcoarse.
source ~/.bashrc
or
source ~/.zshrc
## Usage:
To prepare the project directory:
rpproject new
`board_name` are the any of the board names named in the 'pico-sdk/src/boards/include/boards' folder
To Updates the CMakeLists.mk Makefile with the current source files:
rpproject update
#TODOs:
- finish `update` command
- give option to auto-connect pico w with wifi using the `-DWIFI_SSID="Your Network"
-DWIFI_PASSWORD="Your Password"` options in CMake
- implement `make upload` instead of `picotool load -f .uf2`
- implement `make console` instead of `picocom -b 115200 /dev/ttyACM0`