I have a custom firmware based on the SimpleBLEPeripheral on a custom board using the CC2640, BLE stack 2.1.0, and CCSv6. The board has various sensors which use GPIO hwi to post semaphores to a task to read data from the sensors when the GPIO asserts. For some reason, the system intermittently locks up (could be minutes or hours) if I have a 32kHz crystal installed. If I remove the crystal, then the internal RC oscillator seems to be used and the system seems to be stable for a long time (>12hrs). However, removing the crystal does not allow the iOS application to remain connected, whereas the Android application seems to be okay with it. In any case, I need the BLE frequency to be in spec and need the crystal installed and working properly. I'm thinking that somehow the various sensor hwi interrupts combined with the BLE stack going to sleep between connection events for some reason causes the system lockup. If I shut off the sensors and just leave the hardware in a BLE connected state to the iOS application, then the connection seems to stay good indefinitely. Any thoughts on what I should look for?
Thanks!