soypat/cyw43439

Might be user error...

DMXMax opened this issue · 5 comments

DMXMax commented

Thanks for all the work on this. I'm trying to get my pico w to blink via tinygo.

However, going into the blinky directory and running
tinygo flash -target=pico main.go

followed by tinygo monitor gives me the following output

Connected to /dev/cu.usbmodem142401. Press Ctrl-C to exit.
panic: runtime error at 0x10006709: nil pointer dereference

I suspect user error, and was hoping for some insight in how to make the blink work.

soypat commented

Does this happen with the DHCP example too?

DMXMax commented

I haven't tried it with that. I will try it tomorrow and report

DMXMax commented

I get this output:

tinygo flash -monitor -target=pico ./examples/dhcp/.
Connected to /dev/cu.usbmodem141401. Press Ctrl-C to exit.
starting program
INFO Init:start slog.Level=DEBUG
DEBUG read back bus ctl got=177
DEBUG current bus ctl00010030writing:000300b1 got:feedbead
DEBUG flashing firmware chip_id=43439 fwlen=230321
DEBUG bp_write addr=0 last16=442030312d39353536366436612d30f0
DEBUG bp_write:done status=no status
DEBUG flashing nvram
DEBUG bp_write addr=523540 last16=006274635f6d6f64653d31000000636f
DEBUG bp_write:done status=no status
DEBUG core up
CY43 hndarm_armr addr: 0x18003000, cr4_idx: 0
CY43 000000.001
CY43 RTE (SDIO-CDC) 7.95.62 (b03806e CY) on BCM43439 r5 @ 37.4/81.6/81.6MHz
CY43 000000.003 sdpcmdcdc0: Broadcom SDPCMD CDC driver
CY43 000000.008 reclaim section 0: Returned 46156 bytes to the heap
CY43 000000.012 wlc_bmac_info_init: host_enab 1
CY43 000000.037 wl0: wlc_ampdu_tx_set: AGG Mode = MAC+Ucode txmaxpkts 64 txmaxpkts_agg 0
CY43 000000.048 wl0: wlc_channels_commit: no valid channel for "#n" nbands 1 bandlocked 0
CY43 000000.053 wl0: Broadcom BCM43439 802.11 Wireless Controller 7.95.62 (b03806e CY)
CY43 000000.055 TCAM: 256 used: 77 exceed:0
CY43 000000.058 reclaim section 1: Returned 86104 bytes to the heap
DEBUG base init done
DEBUG initControl clm_len=4752
DEBUG sendIoctl kind=2 cmd=SET_VAR len=1044
DEBUG rx len=256 hdr=asyncev
D rx ?256 hdr=asyncev
DEBUG sendn?@uc?C!xv

And it just stops there.

soypat commented

I've run into this issue many times since, it's always because I forget to add the -stack-size flag to the compiler. This then results in a runtime stack overflow. Use 8kB of stack size like so:

tinygo flash -target=pico -stack-size=8kb main.go

DMXMax commented

Success! Thanks very much! Clearly I ran into the same issue.