-
Notifications
You must be signed in to change notification settings - Fork 48
Switch to Ninja and add README #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also build for W picos as well
Adds some simple command line instructions, along with basic setup instructions for other OSes that can't use this script
|
||
For more details on debugging with GDB, see the [GDB docs](https://sourceware.org/gdb/current/onlinedocs/gdb.html/) | ||
|
||
## Multiple Terminals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really something we should include? won't most people just open multiple terminal instances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this script is to support Raspberry Pi OS Lite (as VS Code can be used everywhere else), I wanted to include how to have multiple terminals on that
cd pico/pico-examples | ||
``` | ||
|
||
Depending on the board you're using (eg pico2), replace `build_pico` with the relevant build directory (eg `build_pico2`) in the following commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this advice to create a board-specific build
directory - IIRC we've never done that elsewhere in any of our other documentation?
(also, I suspect the vast majority of people will only have a single board and/or single type of board?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recommendation was to follow how the script works (which uses board specific build directories), as then you can follow the instructions above exactly. Also, it avoids the need to say that you need to delete build directories when switching between Pico and Pico 2, but not Pico and Pico W
This expanded documentation is great; but in order to avoid duplication of effort, I wonder if it might be better to add it to https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf instead and then have this README.md point people to that? 🤔 |
I think I want to put the command line Getting Started here instead - that document should really focus on VS Code for getting started, as that's the easiest way to get set up (if you have a GUI). It also means the script and the documentation are in the same place, so they're easier to keep in sync. |
Fair enough; as long as there's no duplication of documentation, and each place points to where "the other thing" is documented, I think I'm happy 🙂 |
|
||
To debug programs on the Pico-series microcontroller, you first need to attach a debugger such as the [Debug Probe](https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#getting-started). Once that's done, you can attach OpenOCD to your Pico-series microcontroller with: | ||
```bash | ||
openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this ought to mention using rp2350.cfg
for Pico 2?
gdb -ex "target extended-remote localhost:3333" | ||
``` | ||
|
||
Then in GDB, run the following (replacing blink.elf with the path to blink.elf if it's not in the current directory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The earlier example of using picotool
used the explicit path build_pico/blink/blink.uf2
, so perhaps this example ought to be using the explicit path build_pico/blink/blink.elf
?
|
||
Depending on the board you're using (eg pico2), replace `build_pico` with the relevant build directory (eg `build_pico2`) in the following commands. | ||
|
||
> If you're not using one of the default boards (pico, pico_w, pico2, or pico2_w), you'll need to create a new build directory for your board - you can do this with this command (replace `$board` with the board you are using): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
People might not realise that $board
actually appears twice, so perhaps "replace $board
with..." should be replaced with "replace both instances of $board
with..." ?
### Prerequisites | ||
#### Windows | ||
|
||
If you're on Windows, it is **strongly recommended** to use [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) and then follow the [Linux instructions](#linux) inside that. You should also install [usbipd](https://github.com/dorssel/usbipd-win) to access USB devices inside WSL2 (see the docs there for instructions). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting - in the past we explicitly told people that WSL wasn't supported 😂
* `screen -S minicom` - open a new terminal called `minicom` | ||
* Ctrl+A then D - detach from the current terminal | ||
* `screen -r minicom` - re-attach to an existing terminal called `minicom` | ||
* `screen -ls` - list existing terminals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like you've done for gdb
above, it might be nice to link to additional screen
documentation here.
Install Ninja and switch the pico-examples build over to that, so you get automatic multithreading without
-j
giving simpler command line instructions, and a shorter build output.Add a README which:
apt
should work with the script)