사용자 도구

사이트 도구

English

comfilepi:gpio_init:edit_binfile

dt-blob.bin 직접 고치기

GPIO의 디폴트 상태를 결정하는 파일이 /boot/dt-blob.bin입니다. 이 파일 내용을 바꾸면 최초상태를 Off로 할 수 있습니다.

  • 혹시 모르니까 기존/boot/dt-blob.bin 파일을 백업하세요.
    cp /boot/dt-blob.bin dt-blob-backup.bin

  • 우선 텍스트형태로 만들어야 바꿀 수 있습니다. bin파일을 아래 명령어로 텍스트파일인 dts로 만드세요.
    sudo dtc -I dtb -O dts -o dt-blob.dts /boot/dt-blob.bin

  1. 텍스트 에디터 (보조 프로그램에 있음)를 사용해서 dt-blob.dts을 오픈하세요.



  • 중간즈음에 오면 pins_cm3라는 부분이 있습니다.

  • pins_cm3 { pin_config { … 안쪽에 아래 소스를 카피해서 넣으세요. (VNC를 사용해서 PC에서 작업하시면 편합니다. Ctrl+c로 카피해서 ctrl+v로 넣으세요.)
pin@p17 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO17
pin@p18 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO18
pin@p19 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO19
pin@p20 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO20
pin@p21 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO21
pin@p22 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO22
pin@p23 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO23
pin@p24 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO24
pin@p25 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO25
pin@p26 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO26
pin@p27 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO27

  • 다른이름으로 저장하기 누른뒤 dt-blob2.dts라는 이름으로 저장하세요.
  1. dts를 다시 bin으로 바꾸어야 합니다.
    sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob2.dts
  • 다시 껏다 켜보세요. CPIO의 출력포트의 최초상태가 Off인 것을 확인할 수 있습니다.

ComfilePi (컴파일 파이)

comfilepi/gpio_init/edit_binfile.txt · 마지막으로 수정됨: 2020/11/22 23:55 저자 Comfile Technology