clean up rocketry code and update readme with dev instructions

This commit is contained in:
Travis Shears 2025-04-06 13:14:24 +02:00
parent 48749aa689
commit 0f1d868f0f
2 changed files with 96 additions and 236 deletions

View file

@ -11,9 +11,9 @@ I have since switch to using C.
Right now the station is fairly limited measuring only temperature, humidity,
and atmospheric pressure. I have plans to expand the project to in the end measure:
- tempature
- humidity
- atmospheric pressure
- tempature
- humidity
- atmospheric pressure
- noise levels
- wind speed
- wind direction
@ -23,12 +23,100 @@ and atmospheric pressure. I have plans to expand the project to in the end measu
## Hardware
Sensors:
- [BME280](https://shop.pimoroni.com/products/bme280-breakout?variant=29420960677971)
- Node1: [BME280](https://shop.pimoroni.com/products/bme280-breakout?variant=29420960677971)
MCs:
- [Raspberry Pi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/)
- Node1: [Raspberry Pi Pico W](https://www.raspberrypi.com/products/raspberry-pi-pico/)
Other:
- [Weatherproof Enclosure](https://shop.pimoroni.com/products/weatherproof-cover-for-outdoor-sensors?variant=40047884468307)
_Note: I would not recommend buying from pimoroni from EU as shipping tax is huge!_
## Dev
### Env Setup
From build folder run:
```shell
$ cmake -DPICO_BOARD=pico_w ..
```
This creates the needed makefiles
### Build
This turns the test.c file in the root dir into .elf and .uf2 files:
```shell
$ make node1
```
### Flash
Once you have the .uf2 file you can transfer it to the pico by putting the pico
in bootsel mode (hold button and plug it into pc) or you can flash the .elf file
to the pico using `openocd`:
```shell
openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "program node1.elf verify reset exit"
```
*note: after flashing with openocd the program will be paused. To unpause connect and run "continue"*
### Shell
You screen
```shell
$ fd tty.usb /dev
/dev/tty.usbmodem102
$ screen /dev/tty.usbmodem102 115200
```
Exit shell Ctrl+A Ctrl+|
### Open debug connection
```shell
$ openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"
```
then in another window
```shell
$ lldb ./test.elf
```
Once in lldb you can do a bunch of stuff, see https://web.navan.dev/posts/2024-08-08-openocd-macos-lldb.html.
```shell
(lldb) platform select remote-gdb-server
...
(lldb) process connect connect://localhost:3333
```
Set breakpoint:
```shell
(lldb) breakpoint set --hardware --name main
(lldb) continue # Continue execution
(lldb) step # Step in
(lldb) next # Step over
(lldb) finish # Step out
```
Check vars:
```shell
(lldb) frame variable
(lldb) print variable_name
```
Restarting the program:
```shell
(lldb) process plugin packet monitor reset run
```