BLE woes ?
-
Hello All,
First post (and first lopy adventure).
It's better to tell now that I am a noob about python (working normally in C/C++ with Particle Photons and RedBear Duos), but I kickstarted lopy and here I am. So please forgive me if I write stupid or obvious things.I wrote a simple program to sniff ble advertisers around, and it works. But between the 200th and 300th iteration lopy hangs with
Guru Meditation Error of type StoreProhibited occurred on core 0. Exception was unhandled.
Am I doing something of terribly wrong here ? Thanks !
from network import Bluetooth import binascii import gc gc.enable() bt = Bluetooth() times = 0 bt.start_scan(5) while True: while bt.isscanning(): adv = bt.get_adv() if adv: name = bt.resolve_adv_data(adv.data, bt.ADV_NAME_CMPL) if name: print("%s %s %s" % (binascii.hexlify(adv.mac), name, binascii.hexlify(bt.resolve_adv_data(adv.data, bt.ADV_MANUFACTURER_DATA)))) times += 1 alloc = gc.mem_alloc() free = gc.mem_free() print("lap %d heap %d free %d" % (times, alloc, free)) bt.start_scan(5)
-
@duffo64, thanks a lot for your report. We will check into it.
-
Thanks @abilio,
and sorry for this. Firmware is the latest 1.2.2.b1
If you see, my program prints logs (from 163 thru 168) losing all advertisements, and then Guru appears:lap 163 heap 32944 free 15056 lap 164 heap 33024 free 14976 lap 165 heap 33104 free 14896 lap 166 heap 33184 free 14816 lap 167 heap 33264 free 14736 lap 168 heap 33344 free 14656 Guru Meditation Error of type StoreProhibited occurred on core 0. Exception was unhandled. Register dump: PC : 0x4017b452 PS : 0x00060d30 A0 : 0x8017b476 A1 : 0x3fffc450 A2 : 0x000002a4 A3 : 0x00060f23 A4 : 0x00060f23 A5 : 0xb33f0000 A6 : 0xb33fffff A7 : 0x00000001 A8 : 0x00000001 A9 : 0x3fffc430 A10 : 0x00000000 A11 : 0x000002b0 A12 : 0x40081684 A13 : 0x3fff8af0 A14 : 0x00000001 A15 : 0x3ffc3590 SAR : 0x00000013 EXCCAUSE: 0x0000001d EXCVADDR: 0x00000005 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000 Backtrace: 0x4017b452:0x3fffc450 0x4017b476:0x3fffc470 0x4016c3a0:0x3fffc490 0x4015c9e1:0x3fffc4b0 0x40188d3d:0x3fffc4dets Jun 8 2016 00:22:57 rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0x00 clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:QIO, clock div:2 load:0x3fff9010,len:8 load:0x3fff9018,len:248 load:0x40078000,len:4072 load:0x4009f000,len:940 entry 0x4009f1ec
-
@duffo64, in order to help you out, we're going to need the firmware version number, and also a copy of the Guru Meditation Error dump (with all the registers) would be fine. Thanks in advance