Hello…I am a new user trying use the Bus Pirate as an embedded controller in a test fixture. Articles under test are controlled by I2C from the Bus Pirate. I developed a successful script in Tera Term and saved it on the Bus Pirate to run with the push button. This also works fine except it seems to always need some form of a USB host which I have supplied with an RPi 3. I would like to dispense with the RPi since it serves no other purpose here. I have tried supplying 5V power to the Bus Pirate’s USB-C connector using a “power only” USB -C cable but it still seems to need a USB host to work. Is there a way to make the Bus Pirate independent of a USB host? Thanks!
I think this should be possible. We already did an update to make the scripting work before connecting a terminal. It should be possible to stand alone as well. Let me have a look.
I investigated this. The button does now work before any connection, that wasn’t a major issue.
However, the stuff happening in the Bus Pirate generates text output which eventually fills the output queue and then it freezes.
void _putchar(char character)
{
if(tud_cdc_n_connected(0)){
tx_fifo_put(&character);
}
}
The immediate fix for this is to skip output if there is no connected host, but this additional check for each character slows all the fancy new VT100 stuff way down.
switch (tx_state) {
case IDLE:
bytes_available = spsc_queue_level(&tx_fifo);
if (bytes_available) {
//flush if no host connected (prevents filling the FIFO and blocking Core0 when no terminal is attached)
if (!tud_cdc_n_connected(0)) {
spsc_queue_flush(&tx_fifo);
return;
}
I think this is the smarter fix: on core 1 when servicing the tx queue, check if host is attached and if not, then just flush the queue.
In a few minutes there should be a auto build of the firmware for you to test.