기본 콘텐츠로 건너뛰기

6월, 2008의 게시물 표시

Modbus slave source code

That`s pretty easy. Try to get the standard of the protocol. I did that and in a few hours worked fine. Try this: int address, function, register, quantity address=incomingframe[0] function=incomingframe[1] register=(int)(incomingframe[2]+incomingframe[3]) quantity=(int)(incomingframe[4]+incomingframe[5]) if addres==myAddress then select case function case 0: break; case 1: case 2: //send data required by register and quantity case 3: case 4: //send data required by register and quantity case 6: //write single register case 15: //write multiple coils, mask found within message case 16: //write multiple holdings, asi sent in incoming message end case; endif; good luck.

GDB Manual

사용법 help 도움말, 명령어 분류 목록 출력 help [class] 해당 class에 속한 명령어 목록 표시 help [command] 해당 command에 대한 도움말 표시 *** class와 command의 축약형도 지원됨 명령어 분류 목록 running 프로그램 수행 support 지원 도구 stack 스택 검사 user-defined 사용자 정의 명령 data 데이타 검사 aliases 다른 명령어의 별칭 files 검사할 파일 obscure 기타 status 상태 조회 internals 유지보수 명령 breakpoints 어떤 포인트에서 프로그램을 중단하게 만듦 프로그램의 수행 (running) show args 디버깅할 프로그램에 전달되는 argument를 보여준다.이 명령어 다음에 몇 개의 argument가 온다. info handle 프로그램이 각종 신호를 입력으로 받았을 때, 디버거의 동작법을 보여준다. kill 디버깅 중인 프로그램의 실행을 취소한다. target 타겟 기계나 프로세스에 연결한다.첫번째 argument는 타겟 기계의 타입이나 프로토콜이다. 나머지 argument는 타겟 프로토콜에 의해서 해석 되어진다. 특정 프로토콜에 작동하는 argument에 관해 추가 정보가 필요하면, [help target 프로토콜명]을 친다. [target 서브 명령어 목록] target exec 타겟으로서 실행 파일을 사용한다. target extended-remote 시리얼 라인을 경유해 떨어져 있는 컴퓨터를 타겟으로 사용 target remote 시리얼 라인을 경유해 떨어져 있는 컴퓨터를 타겟으로 사용 target core 타겟으로서 코어 파일을 사용한다. target child ([run] 명령어에 의해 시작된) 유닉스의 자식 프로세스를 타겟으로 사용한다. handle 신호를 어떻게 다룰지 상술함argument는 신호와 그 신호에 적용할 동작이다. 심벌 신호(즉 SIGSEGV)가 권장 사항이지만, 1-15의 숫자 신호도 GDB

GDB Debugging Tool for Embedded Linux

Compile GDB for ARM Target Preinstallation : ARM-LINUX-GCC 1. Compile for GDB #tar xvf gdb-6.8.tar.tar #cd gdb-6.8 #./configure -target=arm-linux : Target 을 Embedded Linux for ARM 으로 설정한다. : --prefix=/usr/local/bin 또는 GDB 가 설치될 Directory 를 명시한다. (Option) #make #make install 여기까지 정상적으로 진행된 경우, /usr/local/bin/ 에서 arm-linux-run, arm-linux-gdb, arm-linux-gdbtui 이렇게 3개의 실행파일이 생성된 것을 확인할 수 있다. file 명령으로 arm-linux-gdb 를 확인하면 "ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GN/Linux 2.4.1, not stripped" 로 표시되는 것을 확인할 수 있다. 2. Compile for GDBServer #cd gdb-6.8/gdb/gdbserver #./configure -target=arm-linux --host=arm-linux Target 이 Embedded Linux for ARM 이므로 Target 에 복사될 gdbserver 는 host 를 arm-linux 로 설정하여 다시 configure 를 실행하는 것이다. #make CC=arm-linux-gcc 여기까지 정상적으로 진행된 경우, gdb608/gdb/gdbserver 에 gdbreplay, gdbserver 이렇게 2개의 실행파일이 생성된 것을 확인할 수 있다. file 명령으로 gdbserver 를 확인하면 "ELF 32-bit LSB executable, ARM, vers