시리얼 모니터에 아래 메세지 발생
----------------------------------------------------------------------------------------------------------------------------------------------------
Guru Meditation Error: Core 1 panic'ed (LoadStoreError). Exception was unhandled.
Core 1 register dump:
PC : 0x40089cca PS : 0x00060c30 A0 : 0x800db150 A1 : 0x3ffb1ee0
A2 : 0x3f400154 A3 : 0x00000000 A4 : 0x3ffb9940 A5 : 0x00000001
A6 : 0x00000003 A7 : 0x00000000 A8 : 0x3f40014d A9 : 0x3f400153
A10 : 0x3f40014b A11 : 0x0000002e A12 : 0x0000002e A13 : 0x00000000
A14 : 0xffffff80 A15 : 0x00000000 SAR : 0x00000001 EXCCAUSE: 0x00000003
EXCVADDR: 0x3f400153 LBEG : 0x400894a0 LEND : 0x400894bc LCOUNT : 0xffffffff
ELF file SHA256: 0000000000000000
Backtrace: 0x40089cca:0x3ffb1ee0 0x400db14d:0x3ffb1f00 0x400d18d6:0x3ffb1f20 0x400d25fa:0x3ffb1fb0 0x4008c119:0x3ffb1fd0
Rebooting...
----------------------------------------------------------------------------------------------------------------------------------------------------
strtok() 함수 사용하니 문제 발생
검색하니 아래 이슈글 찾음.
https://arduino.stackexchange.com/questions/55130/serial-communication-strtok-issue
Serial Communication - strtok() issue
I'm working on UART communication between an ESP32 (sender) and ESP8266 NodeMCU board(receiver). The host is sending out the following character string: Serial.println("2753192144$1&"); The
arduino.stackexchange.com
NULL 포인터를 참조하는 코드에서 문제가 발생하는 걸로 보임
ESP32에서는 strtok()함수 쓰지 않고, 아래 방법으로 string에서 필요한 데이터 뽑아냄
https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=okarduino&logNo=220762181563
문자열 분리하기1 - String 객체 이용
아두이노로 외부 기기와 통신을 하려고 가정합시다. 데이터가 char형으로 문자 하나만 주고받으면 쉬운데, ...
blog.naver.com
'Embedded > ESP32' 카테고리의 다른 글
ESP32 WiFi 연결을 AP나 공유기쪽에서 잘 안붙여줄때 (0) | 2023.07.11 |
---|---|
ESP32 다운로드 에러 사례 (0) | 2023.06.30 |