Skip to content

Commit e29fc4c

Browse files
committed
Add program command to replicate the baud rate 1200 available with Pico stdio library.
1 parent 66b7f7d commit e29fc4c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

prawnblaster/prawnblaster.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "pico/stdlib.h"
2424
#include "pico/multicore.h"
25+
#include "pico/bootrom.h"
2526
#include "hardware/dma.h"
2627
#include "hardware/pio.h"
2728
#include "hardware/pll.h"
@@ -1313,6 +1314,10 @@ void loop()
13131314
fast_serial_printf("ok\r\n");
13141315
}
13151316
}
1317+
else if (strncmp(readstring, "program", 7) == 0)
1318+
{
1319+
reset_usb_boot(0, 0);
1320+
}
13161321
else
13171322
{
13181323
fast_serial_printf("invalid request: %s\r\n", readstring);

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Note: the commands are only read if terminated with `\r\n`.
8484
* `getoutpin <pseudoclock:int>`: Gets the currently set trigger output pin for pseudoclock `pseudoclock`. Returns either an integer corresponding to the set pin or `default` to indicate it will use try and use the default pin as defined above for `setoutpin`. See FAQ below for more details on what happens if it can't use the default.
8585
* `debug <state:str>`: Turns on extra debug messages printed over serial. `state` should be `on` or `off` (no string quotes required).
8686
* `setpio <core:int>`: Sets whether the PrawnBlaster should use pio0 or pio1 in the RP2040 chip (both have 4 state machines). Defaults to `0` (pio0) on powerup. May be useful if your particular board shows different timing behaviour (on the sub 10ns scale) between the PIO cores and you care about this level of precision. Otherwise you can leave this as the default.
87+
* `program`: Equivalent to disconnecting the Pico, holding down the "bootsel" button, and reconnecting the Pico. Places the Pico into firmware flashing mode; the PrawnBlaster serial port should disappear and the Pico should mount as a mass storage device.
8788

8889
## Reconfiguring the internal clock.
8990
The clock frequency (and even source) can be reconfigured at runtime (it is initially set to 100 MHz on every boot).

0 commit comments

Comments
 (0)