Skip to content

Pico W and Pico 2W "slice out of range" #381

@mlsorensen

Description

@mlsorensen

Hi, in experimenting with tinygo on some microcontrollers, I found that running the simple scanner example results in "slice out of range" on the Pico devices.

I don't know if this is just an idiosyncracy of my environment (i.e. a certain device or too many devices), but thought it was worth mentioning since it reproduces across several models of Pico with the stock example.

tinygo flash -target pico-w -tags=bledebug ./examples/scanner

time=1970-01-01T00:00:01.521Z level=DEBUG-2 msg=hci_ringbuf_debug h2bt_in=80 h2bt_out=80 bt2h_in=616 bt2h_out=212
time=1970-01-01T00:00:01.522Z level=DEBUG-2 msg=hci_read inputlen=52
time=1970-01-01T00:00:01.522Z level=DEBUG-2 msg=hci_read_ringbuf len=4 advptr=false
time=1970-01-01T00:00:01.523Z level=DEBUG-2 msg=hci_wait_read_buffered n=4
time=1970-01-01T00:00:01.523Z level=DEBUG-2 msg=hci_available_ringbuf available=3644
time=1970-01-01T00:00:01.524Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.524Z level=DEBUG-2 msg=hci_read_ringbuf len=52 advptr=true
time=1970-01-01T00:00:01.525Z level=DEBUG-2 msg=hci_wait_read_buffered n=52
time=1970-01-01T00:00:01.526Z level=DEBUG-2 msg=hci_available_ringbuf available=3644
time=1970-01-01T00:00:01.526Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.527Z level=DEBUG-2 msg=hci_advance_read_ringbuf newptr=264 oldptr=212 n=52 err=false
time=1970-01-01T00:00:01.527Z level=DEBUG-2 msg=bt_toggle_intr:start
time=1970-01-01T00:00:01.529Z level=DEBUG-2 msg=hci_available_ringbuf available=3652
time=1970-01-01T00:00:01.530Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.530Z level=DEBUG msg=hci_buffered buffered=48 avail=3652
time=1970-01-01T00:00:01.531Z level=DEBUG-2 msg=hci_ringbuf_debug h2bt_in=80 h2bt_out=80 bt2h_in=708 bt2h_out=264
time=1970-01-01T00:00:01.532Z level=DEBUG-2 msg=hci_available_ringbuf available=3604
time=1970-01-01T00:00:01.532Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.533Z level=DEBUG msg=hci_buffered buffered=48 avail=3604
time=1970-01-01T00:00:01.533Z level=DEBUG-2 msg=hci_ringbuf_debug h2bt_in=80 h2bt_out=80 bt2h_in=792 bt2h_out=264
time=1970-01-01T00:00:01.534Z level=DEBUG-2 msg=hci_read inputlen=48
time=1970-01-01T00:00:01.534Z level=DEBUG-2 msg=hci_read_ringbuf len=4 advptr=false
time=1970-01-01T00:00:01.535Z level=DEBUG-2 msg=hci_wait_read_buffered n=4
time=1970-01-01T00:00:01.536Z level=DEBUG-2 msg=hci_available_ringbuf available=3528
time=1970-01-01T00:00:01.536Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.537Z level=DEBUG-2 msg=hci_read_ringbuf len=48 advptr=true
time=1970-01-01T00:00:01.537Z level=DEBUG-2 msg=hci_wait_read_buffered n=48
time=1970-01-01T00:00:01.538Z level=DEBUG-2 msg=hci_available_ringbuf available=3488
time=1970-01-01T00:00:01.538Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.539Z level=DEBUG-2 msg=hci_advance_read_ringbuf newptr=312 oldptr=264 n=48 err=false
time=1970-01-01T00:00:01.540Z level=DEBUG-2 msg=bt_toggle_intr:start
hci event data recv: 6 040e04010c2000
evtCmdComplete 8204 0
time=1970-01-01T00:00:01.541Z level=DEBUG-2 msg=hci_available_ringbuf available=3536
time=1970-01-01T00:00:01.541Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.542Z level=DEBUG msg=hci_buffered buffered=39 avail=3536
time=1970-01-01T00:00:01.543Z level=DEBUG-2 msg=hci_ringbuf_debug h2bt_in=80 h2bt_out=80 bt2h_in=872 bt2h_out=312
time=1970-01-01T00:00:01.543Z level=DEBUG-2 msg=hci_available_ringbuf available=3536
time=1970-01-01T00:00:01.544Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.544Z level=DEBUG msg=hci_buffered buffered=39 avail=3536
time=1970-01-01T00:00:01.545Z level=DEBUG-2 msg=hci_ringbuf_debug h2bt_in=80 h2bt_out=80 bt2h_in=908 bt2h_out=312
time=1970-01-01T00:00:01.546Z level=DEBUG-2 msg=hci_read inputlen=40
time=1970-01-01T00:00:01.546Z level=DEBUG-2 msg=hci_read_ringbuf len=4 advptr=false
time=1970-01-01T00:00:01.547Z level=DEBUG-2 msg=hci_wait_read_buffered n=4
time=1970-01-01T00:00:01.547Z level=DEBUG-2 msg=hci_available_ringbuf available=3500
time=1970-01-01T00:00:01.548Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.548Z level=DEBUG-2 msg=hci_read_ringbuf len=40 advptr=true
time=1970-01-01T00:00:01.549Z level=DEBUG-2 msg=hci_wait_read_buffered n=40
time=1970-01-01T00:00:01.550Z level=DEBUG-2 msg=hci_available_ringbuf available=3500
time=1970-01-01T00:00:01.550Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.551Z level=DEBUG-2 msg=hci_advance_read_ringbuf newptr=352 oldptr=312 n=40 err=false
time=1970-01-01T00:00:01.551Z level=DEBUG-2 msg=bt_toggle_intr:start
time=1970-01-01T00:00:01.553Z level=DEBUG-2 msg=hci_available_ringbuf available=3540
time=1970-01-01T00:00:01.554Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.554Z level=DEBUG msg=hci_buffered buffered=39 avail=3540
time=1970-01-01T00:00:01.555Z level=DEBUG-2 msg=hci_ringbuf_debug h2bt_in=80 h2bt_out=80 bt2h_in=908 bt2h_out=352
time=1970-01-01T00:00:01.556Z level=DEBUG-2 msg=hci_available_ringbuf available=3540
time=1970-01-01T00:00:01.556Z level=DEBUG-2 msg=hci_raw_read_ringbuf
time=1970-01-01T00:00:01.557Z level=DEBUG msg=hci_buffered buffered=39 avail=3540
time=1970-01-01T00:00:01.557Z level=DEBUG-2 msg=hci_ringbuf_debug h2bt_in=80 h2bt_out=80 bt2h_in=908 bt2h_out=352
panic: runtime error at 0x10021f9f: slice out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions