This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

LPCOMP Interrupt Resets MCU (nRF51-DK)

Hi All,

I am new to nRF development and purchased the nRF51-DK (PCA10028). I have successfully experimented with the examples for ble_app_uart and lpcomp. My Application will require a a combination of these two examples. As such I have added code from the lpcom example to the blu_app_uart example so that Button 1 will will trigger an interrupt via the LPCOMP. I have found the code works fine when the nRF51 has established a GATT server client connection with my Bluetooth central device (iPhone). However when the nRF51 has not yet established a connection (in advertising mode) a button press will cause the MCU to reset. I have attached the serial log below for your reference

image description

Is there any reason an interrupt from LPCOMP will cause the MCU to reset? I suspect it may be related to this application note found in the LPCOMP example documentation

If LPCOMP IRQ priority is set to NRF_APP_PRIORITY_HIGH, there is a limitation in calling SoftDevice functions from the event handler

I have attached my uVision code for your reference

LPCOMP Code - arm5_no_pack.zip

Related