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

nRF52832 Rebootig once in a while - unknown reason

Hi,

I made a temperature logging device using nRF52832 (SDK 12.3.0). The temperature sensor is read over I2C every 5 minutes and data is sent over radio communication. There is also battery voltage reading on 12 hours. The software is rather simple. Here is a very simplified code:

while(1) {

__SEV();
__WFE();
__WFE();

if(temperature_reading time){

//read temperature sensor

nrf_drv_twi_rx(...

}

if(voltage_reading_time){

//read voltage;

nrf_drv_saadc_sample_convert(NRF_SAADC_INPUT_VDD, &adc_buf);

}

if(send_data_time){

//Radio send data;

}

}

The problem I have is that the device is rebooting once in a while. For example if I turn on 50 of these devices a few will reboot in the period of one day (every day different one will reboot). This reboot is random in general, but as far as I managed to debug it, it is always rebooting after sensor is read and data is sent. It seems like it reboots once it reach __SEV(); __WFE(); __WFE(); sequence, but as I wrote not always but once in a while. 

reset_reason = NRF_POWER->RESETREAS; after reset gives value zero (0). I triple checked the battery contact and possible hardware related issues and that is not the reason. If it is hardware it wouldn't reboot in n*5 minutes interval (after reading and sending data).

I am trying to solve this issue for over the two months now. Any help or hint would be appreciated very much.

Parents
  • Are you using a coin cell or a battery with more oomph? The coin cell is most susceptible to causing resets; if not using the DC-DC convertor, worth enabling it to see if it affects the frequency with which the problem occurs:

       // DC-DC power supply enable, saves over using internal LDO regulator
       nrf_power_dcdcen_set(true);

    If using a coin cell temporarily add 100uF to 150uF capacitor to the coin cell to see if it affects the issue. Unless there is already significant capacitance such as that then it may be effective regardless of battery type.

    There are two errata which may be relevant: 

          // Errata 220: CPU: RAM is not ready when written - Disable IRQ while using WFE
          // Enable SEVONPEND to disable interrupts so the internal events that generate the interrupt cause wakeuup in __WFE context and not in interrupt context
          // Before: ENABLE_WAKEUP_SOURCE -> __WFE -> WAKEUP_SOURCE_ISR -> CONTINUE_FROM_ISR  next line of __WFE
          // After:  ENABLE_WAKEUP_SOURCE -> SEVONPEND -> DISABLE_INTERRUPTS -> __WFE -> WAKEUP inside __WFE -> ENABLE_interrupts -> WAKEUP_SOURCE_ISR
          //
          // Errata 75: MWU: Increased current consumption
          // This has to be handled by turning off MWU but it is used in SoftDevice
          // see https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_EngB%2FERR%2FnRF52832%2FEngineeringB%2Flatest%2Fanomaly_832_75.html
          //
          // Errata 220: Enable SEVONPEND
          SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
          __disable_irq();
          // Errata 75: MWU Disable
          uint32_t MWU_AccessWatchMask = NRF_MWU->REGIONEN & MWU_ACCESS_WATCH_MASK;
          // Handle MNU if any areas are enabled
          if (MWU_AccessWatchMask)
          {
             NRF_MWU->REGIONENCLR = MWU_AccessWatchMask; // Disable write access watch in region[0] and PREGION[0]
             __WFE();
             __NOP(); __NOP(); __NOP(); __NOP();
             // Errata 75: MWU Enable
             NRF_MWU->REGIONENSET = MWU_AccessWatchMask;
          }
          else
          {
             __WFE();
             __NOP(); __NOP(); __NOP(); __NOP();
          }
          __enable_irq();

    There is a VDD ramp issue which may be relevant, typical with insufficient gap between BLE and other events or lack of storage capacitance on the battery, see 18.10.2 Device startup times Note 10

    // Note 10: A step increase in supply voltage of 300 mV or more, with rise time
    // of 300 ms or less, within the valid supply range, may result in a system reset.

  • hmolesworth, thanks for the quick reply. I will try all the things you mentioned, and get back with results. Meanwhile regarding the battery and capacitors.

    I am not using coin cell battery. I am using SAFT 3.6V Lithium 14500 Li-SOCI2 battery (without DC-DC converter). Between the battery and the nRF52832 there is a P-MOSFET as a battery reverse polarity protection. Regarding the capacitors, there are several between the nrfVDD and GND: 100nF on nRF pin-13 (VDD pin); 100nF on nRF pin-36 (VDD pin); 4.7uF on nRF pin-48 (VDD pin); and also a 100 nF on VDD pin of temperature sensor.

Reply
  • hmolesworth, thanks for the quick reply. I will try all the things you mentioned, and get back with results. Meanwhile regarding the battery and capacitors.

    I am not using coin cell battery. I am using SAFT 3.6V Lithium 14500 Li-SOCI2 battery (without DC-DC converter). Between the battery and the nRF52832 there is a P-MOSFET as a battery reverse polarity protection. Regarding the capacitors, there are several between the nrfVDD and GND: 100nF on nRF pin-13 (VDD pin); 100nF on nRF pin-36 (VDD pin); 4.7uF on nRF pin-48 (VDD pin); and also a 100 nF on VDD pin of temperature sensor.

Children
No Data
Related