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

nRF52832 DK is resetting when sent wifi config. form android app.

Hi,

I am using nRF52832 Dk and SD132, sdk is 13.1. I have sent my sensor data to server using external wifi module which is interface with nRF52832 DK.

Everything working but for low power consumption i have control WiFi CH_PD(Chip Enable Power Down) via nRF52832 GPIO with 10K resistor.

In nordic program on/off this GPIO pin whenever i want to use WiFi after sending done data to server this pin is LOW. 

But now problem facing is when i want to configure new WiFi credential through AT cmd and sent it to nRF52832 by android. At this time i have High GPIO pin and ON WiFi chip but same time nRF52 is reset at start gain it not process as per the AT command configuration new WiFi credentials.

I have following few questions:

  1. Why nRF52 is reset when sending AT command via android.
  2. Is it write GPIO pin configuration for High and LOW.

nrf_gpio_range_cfg_output(12, 12);

nrf_gpio_pin_write(12,1);

      3. For controlling this Ch_PD pin is it need to use transistor or MOSFET with nRF52chip.

      Looking forward your reply...

Thanks in Advanced......

Parents
  • Hi,

    In 99% of all cases where the board resets, it is because a function in your code has returned an error code. The error code is then processed by APP_ERROR_CHECK() which will reset your device unless you specifically tell it not to do it. Have you tried debugging like this

    You probably don't need a MOSFET. I'm guessing that Ch_PD is just a regular input pin on your WiFi chip, and I have never seen anyone using a MOSFET to control such an input. MOSFETs are usually only used if you need to turn on and off loads that draw a lot of current or use higher voltages than your microcontroller (motors, very bright LEDs, etc.). 

  • Thanks for your reply,

    I saw the above debugging link but i am using eclipse IDE. In that i debugging my code when i send wifi credentials to nRF52832 i see in debugging like : 

    :ERROR:Fatal
    :INFO:Hit weak handler

    But not seeking any error code.

    Can you please tell me how i can see error code the following i have written function:

    void ESP_WiFi_config()
    {
    NRF_LOG_INFO("WiFi Config. Start\r\n");
    nrf_gpio_range_cfg_output(12, 12);
    nrf_gpio_pin_write(12,1);
    nrf_delay_ms(5000);
    NRF_LOG_INFO("WiFi_Txbuff: 1\r\n");
    sprintf((char*)WiFi_Txbuff, "AT+CWJAP_DEF=\"%s\",\"%s\"\r\n\r\n", ssid_buff, passkey_buff);
    printf((char*)WiFi_Txbuff);
    NRF_LOG_INFO("WiFi_Txbuff: 2\r\n");
    // nrf_delay_ms(5000);
    }

    When goes in this function and high GPIO 12 pin at that time my Nordic Dk is reset.

    How i can see error code.

    Thanks, 

  • When you see those messages printed to your terminal it means that you have ended up in a function called:

    __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)

    which is defined inside the file SDK_13.1.0\components\libraries\util\app_error_weak.c. 

    You can modify that function to look something like this instead, to make it print out some more informative messages:

    __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
        static error_info_t  * p_error_info;
        p_error_info = (error_info_t*)info;
        NRF_LOG_ERROR("Error: ID: %d, PC: 0x%X\n\r", id, pc);
        NRF_LOG_ERROR("Error: Code: 0x%04X (%d), Line: %d, File: %s\n\r", p_error_info->err_code, p_error_info->err_code, p_error_info->line_num, (uint32_t)p_error_info->p_file_name);
        NRF_LOG_FINAL_FLUSH();
        // On assert, the system can only recover with a reset.
    #ifndef DEBUG
        NRF_LOG_INFO("Hit weak handler\r\n");
        NVIC_SystemReset();
    #else
        app_error_save_and_stop(id, pc, info);
    #endif // DEBUG
    }

Reply
  • When you see those messages printed to your terminal it means that you have ended up in a function called:

    __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)

    which is defined inside the file SDK_13.1.0\components\libraries\util\app_error_weak.c. 

    You can modify that function to look something like this instead, to make it print out some more informative messages:

    __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
        static error_info_t  * p_error_info;
        p_error_info = (error_info_t*)info;
        NRF_LOG_ERROR("Error: ID: %d, PC: 0x%X\n\r", id, pc);
        NRF_LOG_ERROR("Error: Code: 0x%04X (%d), Line: %d, File: %s\n\r", p_error_info->err_code, p_error_info->err_code, p_error_info->line_num, (uint32_t)p_error_info->p_file_name);
        NRF_LOG_FINAL_FLUSH();
        // On assert, the system can only recover with a reset.
    #ifndef DEBUG
        NRF_LOG_INFO("Hit weak handler\r\n");
        NVIC_SystemReset();
    #else
        app_error_save_and_stop(id, pc, info);
    #endif // DEBUG
    }

Children
No Data
Related