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

APP_UART_DATA_READY reset nRF52832

Hi, I am a beginner programmer and I have the next problem.

I am working with nRF52832 SDK 12.2 trying to send AT commands to an ESP8266. I send the AT commands byte by byte through UART which I managed with APP_UART_TX_EMPTY. Then I receive the ESP8266 response in APP_UART_DATA_READY and when I should get a response such as \r\nOK\r\n I get half data instead. When it happens the nRF52 resets. The ESP8266 is working rigth because I check the response with a terminal so I think I could be a problem with UART. Any help will be appreciated.

Thanks in advance

Parents
  • Can you share your uart_event_handle() code here? Are you using an array to buffer up the received bytes? Can it be an array index out of bound issue?

  • I haven't had a solution yet. I have debug and get the reset reason 0x00000004. Here it is my uart_event_handle() :

    void uart_wifi_event_handle(app_uart_evt_t * p_event) { static uint8_t data_wifi_array; uint32_t err_code;

    switch (p_event->evt_type)
    {
    		
    		case APP_UART_DATA_READY:
    				
    		UNUSED_VARIABLE(app_uart_get(&data_wifi_array));
    		
    		
    		if(ind_datawifi_uart == 0)
    			{
    				if(data_wifi_array == 0x0D)
    					{
    					startreadwifiUART=true;
    					memset(cmd_wifi_buff,0,UART_TX_BUF_SIZE);
    					}
    			}
    				
    			if (startreadwifiUART)
    				{
    					cmd_wifi_buff[ind_datawifi_uart]=data_wifi_array;
    					ind_datawifi_uart++;
                                         }
    
        break;
    			
    			case APP_UART_TX_EMPTY:
    				if(wlenps > 0)
    				{	
    					err_code = app_uart_put(stringwifi[windps]);
    					APP_ERROR_CHECK(err_code);
    					windps++;
    				}
    			break;
    
        default:
    				
            break;
    			}
    	}
    

    }

    Where I sent AT commands through APP_UART_TX_EMPTY and I should get the completely response on APP_UART_DATA_READY.

Reply
  • I haven't had a solution yet. I have debug and get the reset reason 0x00000004. Here it is my uart_event_handle() :

    void uart_wifi_event_handle(app_uart_evt_t * p_event) { static uint8_t data_wifi_array; uint32_t err_code;

    switch (p_event->evt_type)
    {
    		
    		case APP_UART_DATA_READY:
    				
    		UNUSED_VARIABLE(app_uart_get(&data_wifi_array));
    		
    		
    		if(ind_datawifi_uart == 0)
    			{
    				if(data_wifi_array == 0x0D)
    					{
    					startreadwifiUART=true;
    					memset(cmd_wifi_buff,0,UART_TX_BUF_SIZE);
    					}
    			}
    				
    			if (startreadwifiUART)
    				{
    					cmd_wifi_buff[ind_datawifi_uart]=data_wifi_array;
    					ind_datawifi_uart++;
                                         }
    
        break;
    			
    			case APP_UART_TX_EMPTY:
    				if(wlenps > 0)
    				{	
    					err_code = app_uart_put(stringwifi[windps]);
    					APP_ERROR_CHECK(err_code);
    					windps++;
    				}
    			break;
    
        default:
    				
            break;
    			}
    	}
    

    }

    Where I sent AT commands through APP_UART_TX_EMPTY and I should get the completely response on APP_UART_DATA_READY.

Children
No Data
Related