SHARE
TWEET

Untitled

a guest Jun 19th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uint8_t data[128];
  2. data[0] = ''; //null terminate so we don't print garbage
  3.  
  4. for( ; ; ) {
  5.     //get a chunk of data off the FIFO buffer
  6.     const int uart_num = UART_NUM_2;
  7.     int length = 0;
  8.     IotLogInfo( "preread" );
  9.     length = uart_read_bytes(uart_num, data, 10, 1000 / portTICK_RATE_MS); //read 10 bytes or time out after a second.
  10.  
  11.     if(length == -1)
  12.         IotLogInfo( "read reported error! -1" );
  13.  
  14.     //did we rx anything?
  15.     if(length > 0){
  16.         data[length] = ''; //null terminate the string
  17.         IotLogInfo( "Rx: %n bytes", length );
  18.         IotLogInfo( "Rx: %s ", data );
  19.     }
  20.     else{
  21.         IotLogInfo( "rx no data" );
  22.     }
  23. }
  24.      
  25. 110 11021 [_readSerialForM] [INFO ][DEMO][110210] preread
  26.  
  27. 111 11121 [_readSerialForM] [INFO ][DEMO][111210] rx no data
  28.  
  29. 112 11221 [_readSerialForM] [INFO ][DEMO][112210] preread
  30.  
  31. 113 11321 [_readSerialForM] [INFO ][DEMO][113210] rx no data
  32.  
  33. 114 11421 [_readSerialForM] [INFO ][DEMO][114210] preread
  34.  
  35. Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.
  36. Core 0 register dump:
  37. PC      : 0x4011dd49  PS      : 0x00060130  A0      : 0x801abf6d  A1      : 0x3ffeaed0  
  38. A2      : 0x3ffeaee0  A3      : 0x00000000  A4      : 0x00000004  A5      : 0x00000001  
  39. A6      : 0x3ffeaee0  A7      : 0x00000018  A8      : 0x00000009  A9      : 0x00000004  
  40. A10     : 0x00000024  A11     : 0x0000002a  A12     : 0xffffffff  A13     : 0x3f40149c  
  41. A14     : 0x00ff0000  A15     : 0xff000000  SAR     : 0x00000004  EXCCAUSE: 0x0000001d  
  42. EXCVADDR: 0x00000004  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff  
  43.  
  44. Backtrace: 0x4011dd49:0x3ffeaed0 0x401abf6a:0x3ffeb1e0 0x401abfa6:0x3ffeb270 0x401739f7:0x3ffeb2b0 0x400d469a:0x3ffeb330
  45.  
  46. Rebooting...
  47. ets Jun  8 2016 00:22:57
  48.  
  49. rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
  50. configsip: 0, SPIWP:0xee
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top