Random Syntax Error While Booting



  • Running a LoPy4 with various versions of firmware, I have seen random failures where I get a syntax error upon waking from deepsleep. I've seen it fail in different files and I know all of the files are good cause the code will run until it with core dumps or gets this syntax error and the location is always different. Anyone seeing something like this? This log is from 1.17.3 FW.

    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    Debug print statements TRUE
    mem_free: 2549648
    creating ody_globals
    SN: a45052e8
    boot_monitor interval: 10
    starting main: tank_main.py
    Tank_MAIN.PY version: 0.0.174
    LORA setup: tx_power=20, spread_factor=10
    Serial Number:a45052e8
    SEQ 53
    Sending Pkt, vals: dir_addr=-0x5bafa3bc, last_addr=0, group=0, control=0, payload_len=15, payload_type=1, seq=53, src_addr=0xa45052e8, rcv_first=0, rssi_rcv=0, checksum=-7, payload=b'\x00\x00'
    
    (rx_timestamp=0, rssi=0, snr=0.0, sfrx=0, sftx=10, tx_trials=0, tx_power=20, tx_time_on_air=206, tx_counter=1, tx_frequency=918900000)
    RCVD b'a45052e8a4505c4400000892003ea4505c4400000000'
    From GW, vals: dir_addr=0xa45052e8, last_addr=0xa4505c44, group=0, ctrl=0, payload_len=8, payload_type=146, seq=62, src_addr=0xa4505c44, directive=0, dir_value=0, rssi=-11, payload=b''
    
    PKT RECEIVED src: b'a45052e8', dir: b'a45052e8'
    Response: {'success': True, 'dir_response': None}
    boot_monitor interval: 10
    Deep sleeping: 10000
    ets Jun  8 2016 00:22:57
    
    rst:0x5 (DEEPSLEEP_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    Debug print statements TRUE
    mem_free: 2549648
    creating ody_globals
    SN: a45052e8
    boot_monitor interval: 10
    starting main: tank_main.py
    Tank_MAIN.PY version: 0.0.174
    LORA setup: tx_power=20, spread_factor=10
    Serial Number:a45052e8
    SEQ 54
    Sending Pkt, vals: dir_addr=-0x5bafa3bc, last_addr=0, group=0, control=0, payload_len=15, payload_type=1, seq=54, src_addr=0xa45052e8, rcv_first=0, rssi_rcv=0, checksum=-8, payload=b'\x00\x00'
    
    (rx_timestamp=0, rssi=0, snr=0.0, sfrx=0, sftx=10, tx_trials=0, tx_power=20, tx_time_on_air=206, tx_counter=1, tx_frequency=918900000)
    RCVD b'a45052e8a4505c44000008920036a4585c4400000000'
    From GW, vals: dir_addr=0xa45052e8, last_addr=0xa4505c44, group=0, ctrl=0, payload_len=8, payload_type=146, seq=54, src_addr=0xa4585c44, directive=0, dir_value=0, rssi=-13, payload=b''
    
    PKT RECEIVED src: b'a45052e8', dir: b'a45052e8'
    Response: {'success': True, 'dir_response': None}
    boot_monitor interval: 10
    Deep sleeping: 10000
    ets Jun  8 2016 00:22:57
    
    rst:0x5 (DEEPSLEEP_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    Debug print statements TRUE
    mem_free: 2549648
    creating ody_globals
    SN: a45052e8
    boot_monitor interval: 10
    starting main: tank_main.py
    Traceback (most recent call last):
      File "main.py", line 9, in <module>
      File "tank_main.py", line 17, in <module>
      File "/flash/lib/pack_data.py", line 85
    SyntaxError: invalid syntax
    MicroPython v1.8.6-849-83e2f7f on 2018-03-19; LoPy with ESP32
    Type "help()" for more information.
    >>>
    


  • @jcaron It's powered off of my desktop Windows 10 PC. It's most likely a timing issue in the FW. My guess would be that during the import a read value is getting corrupted. I know there is no syntax error in the code. the same code can run for a week with a deepsleep reboot every 30 seconds.



  • @ssmith What do you power your LoPy with? There's a spike in current draw during boot, and not all batteries / power supplies are able to cope with that, this may result in random behaviour.



  • @ssmith

    Could you share you code?


Log in to reply
 

Pycom on Twitter