BP hangs on I2C read

I’m working through the Teensy CTF shared recently

My BP hangs occasionally when reading from an I2C device. Perhaps it’s the Teensy code. But here is something odd. If I use script, it happens every time.

When I go into I2C mode and type

[0x84 0x00]
[0x85 r:16]

it works. But if I do this:


I2C> cat s.scr
[0x84 0x00]
[0x85 r:16]
pause

I2C> script s.scr
I2C> [0x84 0x00]

I2C START
TX: 0x84 ACK 0x00 ACK
I2C STOP

Logic analyzer: 1043 samples captured
I2C> [0x85 r:16]

My BP6 hangs.

2 Likes

Thanks so much for the bug report. Does it hang with and without the logic analyzer active?

I’ll investigate further.

1 Like

It saus “Logic analyzer J: 1025 samples captured” but I’m not using the logic analyzer. I just go into I2C more, set voltage and pull-ups, do a scan and run the script.

I repeated it after typing “logic start” and get this



I2C> [0x85 r:16]

┼──────────────────────────────────────────────────────────────────────────────┼
6		22		38		54		70
0############################################################################0
1############################################################################1
2############################################################################2
3############################################################################3
4############################################################################4
5############################################################################5
6############################################################################6
7############################################################################7
Vout: 3.29V/300.0mA max | Pull-ups: ON |
1.Vout  2.IO0   3.IO1   4.IO2   5.IO3   6.IO4   7.IO5   8.IO6   9.IO7   10.GND

I returns

Bus Pirate 6
Firmware main branch @ unknown (Nov 18 2025 10:42:22)RP2350B with 512KB RAM, 128Mbit FLASH
S/N: 442CD5B5206B7C03
Storage:   0.10GB (FAT16 File System)

Configuration file: Loaded
Active binmode: Follow along logic analyzer
Available modes: HiZ 1WIRE UART HDUART I2C SPI 2WIRE 3WIRE DIO LED INFRARED JTAG
Active mode: I2C

I2C speed: 100 kHz
Clock stretching: OFF

Display format: Auto
Data format: 8 bits, MSB bitorder
Pull-up resistors: ON
Power supply: ON (3.3V/3.29V)
Current limit: OK (3.2mA/300.0mA)
Frequency generators: OFF

1 Like

I would go to binmode and choose another mode then. It looks like it is a FALA issue.

I2C> cat i2c.scr
[0x84 0x00]
[0x85 r:16]
pause

I2C> script i2c.scr
I2C> [0x84 0x00]

I2C START
TX: 0x84 NACK 0x00 NACK
I2C STOP
I2C> [0x85 r:16]

I2C START
TX: 0x85 NACK
RX: 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK
    0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF ACK 0xFF NACK

I2C STOP
I2C> pause
Press any key

Without FALA is seems ok with latest firmware.

Logic analyzer speed: 3200000Hz (8x oversampling)
Use the 'logic' command to change capture settings

I2C> script i2c.scr
I2C> [0x84 0x00]

I2C START
TX: 0x84 NACK 0x00 NACK
I2C STOP

Logic analyzer: 3606 samples captured
I2C> [0x85 r:16]

With FALA I get the same hang as you. I’m probing the issue now.

1 Like

Appears to be 2 issues:

  • script always crashes FALA
  • After 10-20 quick command repeats FALA also crashes
1 Like

If I use binmode 1 (SUMP) it also hangs when I run the script.

If I use binmode 2 it doesn’t hang.

2 Likes

I am unable to replicate the crash in SUMP mode.

1 Like

I tried to replicate it again and was unable to. I can now run my script that reads 16*64 I2C registers using SUMP mode.

2 Likes