Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Last active March 24, 2021 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lupyuen/5ddbcdd1054c775521291c3d114f6cee to your computer and use it in GitHub Desktop.
Save lupyuen/5ddbcdd1054c775521291c3d114f6cee to your computer and use it in GitHub Desktop.
BL602 LoRa Channel Activity Detection Exception

RISC-V Disassembly is here: https://github.com/lupyuen/bl_iot_sdk/releases/tag/v7.0.2

# create_task

# init_driver
SX1276 init
SX1276 interrupt init
SX1276 register handler: GPIO 11
SX1276 register handler: GPIO 0
SX1276 register handler: GPIO 5
SX1276 register handler: GPIO 12
TODO: os_cputime_delay_usecs 1000
TODO: os_cputime_delay_usecs 6000
Foreground Task Stack:
dump_stack: frame pointer=0x4200e140
=== stack start ===
@ 0x4200e13c: 0x23000ee2
@ 0x4200e140: 0x00000000
@ 0x4200e144: 0x00000001
@ 0x4200e148: 0x00000000
@ 0x4200e14c: 0x00000000
@ 0x4200e150: 0x00000000
@ 0x4200e154: 0x00000001
@ 0x4200e158: 0x4200d258
@ 0x4200e15c: 0x80000208
@ 0x4200e160: 0x42011518
@ 0x4200e164: 0x23000b20
@ 0x4200e168: 0x23000aec
@ 0x4200e16c: 0x23000be0
@ 0x4200e170: 0x23000bac
@ 0x4200e174: 0x23000aba
@ 0x4200e178: 0x42011290
@ 0x4200e17c: 0x00000001
@ 0x4200e180: 0x4200fd2c
@ 0x4200e184: 0x4200d1e8
@ 0x4200e188: 0x4200e1c0
@ 0x4200e18c: 0x230069e4
@ 0x4200e190: 0x4201153c
@ 0x4200e194: 0x23004000
@ 0x4200e198: 0x00000000
@ 0x4200e19c: 0x4200fd2c
@ 0x4200e1a0: 0x00000004
@ 0x4200e1a4: 0x00000001
@ 0x4200e1a8: 0x00000000
@ 0x4200e1ac: 0x420112c8
@ 0x4200e1b0: 0x4200e1e0
@ 0x4200e1b4: 0x4200fd2c
@ 0x4200e1b8: 0x4200e230
@ 0x4200e1bc: 0x23007982
@ 0x4200e1c0: 0x00000000
@ 0x4200e1c4: 0x00000010
@ 0x4200e1c8: 0x4200e230
@ 0x4200e1cc: 0x00000002
@ 0x4200e1d0: 0x42010dd8
@ 0x4200e1d4: 0x00000002
@ 0x4200e1d8: 0x4200e210
@ 0x4200e1dc: 0x00000005
@ 0x4200e1e0: 0x00000001
@ 0x4200e1e4: 0x00000000
@ 0x4200e1e8: 0x00000000
@ 0x4200e1ec: 0x00000000
@ 0x4200e1f0: 0x00000000
@ 0x4200e1f4: 0x00000002
@ 0x4200e1f8: 0x4200e210
@ 0x4200e1fc: 0xa5a5a5a5
@ 0x4200e200: 0xa5a5a5a5
@ 0x4200e204: 0xa5a5a5a5
@ 0x4200e208: 0xa5a5a5a5
@ 0x4200e20c: 0x00000001
@ 0x4200e210: 0x00000004
@ 0x4200e214: 0x00000001
@ 0x4200e218: 0x0000000c
@ 0x4200e21c: 0x00000002
@ 0x4200e220: 0x00000001
@ 0x4200e224: 0x00000003
@ 0x4200e228: 0x4200e250
@ 0x4200e22c: 0x23007ad4
@ 0x4200e230: 0x00000a0d
@ 0x4200e234: 0x00000001
@ 0x4200e238: 0x0000000c
=== stack end ===


# 
SX1276 DIO3: Channel activity detection
Background Task Stack:
dump_stack: frame pointer=0x42011f90
=== stack start ===
@ 0x42011f8c: 0x23002bce
@ 0x42011f90: 0xa5a5a5a5
@ 0x42011f94: 0x4200f458
@ 0x42011f98: 0x42011fb0
@ 0x42011f9c: 0x23000cd2
@ 0x42011fa0: 0xa5a5a5a5
@ 0x42011fa4: 0xa5a5a5a5
@ 0x42011fa8: 0xa5a5a5a5
@ 0x42011fac: 0x00000000
@ 0x42011fb0: 0xa5a5a5a5
@ 0x42011fb4: 0xa5a5a5a5
@ 0x42011fb8: 0x00000000
@ 0x42011fbc: 0x80000068
@ 0x42011fc0: 0x42011e00
@ 0x42011fc4: 0x00008983
@ 0x42011fc8: 0x4200fe88
@ 0x42011fcc: 0x4200fe88
@ 0x42011fd0: 0x42011fc0
@ 0x42011fd4: 0x4200fe80
@ 0x42011fd8: 0x0000001f
@ 0x42011fdc: 0x4201174c
@ 0x42011fe0: 0x4201174c
@ 0x42011fe4: 0x42011fc0
@ 0x42011fe8: 0x00000000
@ 0x42011fec: 0x00000001
@ 0x42011ff0: 0x420117f8
@ 0x42011ff4: 0x00656c62
@ 0x42011ff8: 0x8ca80bf2
@ 0x42011ffc: 0x41f024ba
@ 0x42012000:0x00824c39
@ 0x42012004: 0x00000000
@ 0x42012008: 0x00000005
@ 0x4201200c: 0xba642436
@ 0x42012010: 0x00000001
@ 0x42012014: 0x00000000
@ 0x42012018: 0x00000000
@ 0x4201201c: 0xe48c0000
@ 0x42012020: 0x00000000
@ 0x42012024: 0x80000020
@ 0x42012028: 0x42012048
@ 0x4201202c: 0x42010b90
@ 0x42012030: 0x00000002
@ 0x42012034: 0x2300c460
@ 0x42012038: 0x00000000
@ 0x4201203c: 0x00000000
@ 0x42012040: 0x00000000
@ 0x42012044: 0x80000020
@ 0x42012048: 0x42010b80
@ 0x4201204c: 0x42012028
@ 0x42012050: 0x00000003
@ 0x42012054: 0x2300c4da
@ 0x42012058: 0x00000000
@ 0x4201205c: 0x00000000
@ 0x42012060: 0x42030000
@ 0x42012064: 0x0001d798
@ 0x42012068: 0x4200d1b4
@ 0x4201206c: 0x4000a288
@ 0x42012070: 0x00000000
@ 0x42012074: 0x86000001
@ 0x42012078: 0x00000000
@ 0x4201207c: 0x00000018
@ 0x42012080: 0x4000a28c
@ 0x42012084: 0x4200d1b0
@ 0x42012088: 0x00000000
=== stack end ===

Exception Entry--->>>
mcause 38000001, mepc 00000000, mtval 00000000
Exception code: 1
  msg: Instruction access fault
=== backtrace start ===
backtrace_stack: frame pointer=0x42011e70
backtrace: 0x2300ba88 (@ 0x42011e6c)
backtrace: 0x2300a852 (@ 0x42011e9c)
backtrace: 0x00000004   <--- TRAP
backtrace: INVALID!!!
=== backtrace end ===

Exception Handler Stack:
dump_stack: frame pointer=0x42011e70
=== stack start ===
@ 0x42011e6c: 0x2300ba98
@ 0x42011e70: 0x42010518
@ 0x42011e74: 0x00000001
@ 0x42011e78: 0x4000a000
@ 0x42011e7c: 0x00000000
@ 0x42011e80: 0x00000001
@ 0x42011e84: 0x00000001
@ 0x42011e88: 0xffffffff
@ 0x42011e8c: 0xa5a5a5a5
@ 0x42011e90: 0x42011000
@ 0x42011e94: 0x4200f458
@ 0x42011e98: 0x42011fb0
@ 0x42011e9c: 0x2300a852
@ 0x42011ea0: 0x00000004
@ 0x42011ea4: 0x00000000
@ 0x42011ea8: 0x00000000
@ 0x42011eac: 0x00000000
@ 0x42011eb0: 0x00000000
@ 0x42011eb4: 0x00000000
@ 0x42011eb8: 0x00000000
@ 0x42011ebc: 0x00000000
@ 0x42011ec0: 0x00000000
@ 0x42011ec4: 0x00000000
@ 0x42011ec8: 0x00000000
@ 0x42011ecc: 0x00000000
@ 0x42011ed0: 0x00000000
@ 0x42011ed4: 0x00000000
@ 0x42011ed8: 0x00000000
@ 0x42011edc: 0x00000000
@ 0x42011ee0: 0x00000000
@ 0x42011ee4: 0x00000000
@ 0x42011ee8: 0x00000000
@ 0x42011eec: 0x00000000
@ 0x42011ef0: 0x00000000
@ 0x42011ef4: 0x00000000
@ 0x42011ef8: 0x00000000
@ 0x42011efc: 0x00000000
@ 0x42011f00: 0x00000000
@ 0x42011f04: 0x00000000
@ 0x42011f08: 0x00000000
@ 0x42011f0c: 0x00000000
@ 0x42011f10: 0x00000000
@ 0x42011f14: 0x00000000
@ 0x42011f18: 0x00000000
@ 0x42011f1c: 0x00000000
@ 0x42011f20: 0x00000000
@ 0x42011f24: 0x00000000
@ 0x42011f28: 0x42011f50
@ 0x42011f2c: 0x23000cd2
@ 0x42011f30: 0x04000000
@ 0x42011f34: 0x00000001
@ 0x42011f38: 0x4000a28c
@ 0x42011f3c: 0x42011fb0
@ 0x42011f40: 0x4200f458
@ 0x42011f44: 0x00000000
@ 0x42011f48: 0x00000001
@ 0x42011f4c: 0x42049ff8
@ 0x42011f50: 0x00020000
@ 0x42011f54: 0x00000001
@ 0x42011f58: 0x40000188
@ 0x42011f5c: 0x00000001
@ 0x42011f60: 0x82000fff
@ 0x42011f64: 0x42011000
@ 0x42011f68: 0xa5a5a5a5
=== stack end ===
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment