나는 Beaglebone black에서 ttyS4를 실행하는 데 어려움을 겪고 있습니다.
/boot/uEnv.txt에 UART4를 설정했습니다(질문 하단 참조).
비글본에서는 통신코너와 RS-485 A/B를 배터리 BMS 장치에 연결했습니다. 통신 속도는 9600보드 8N1입니다.
내가 한 일을 알아보려면:
(stty -F /dev/ttyS4 9600 cs8 -cstopb -parenb; cat -v /dev/ttyS4) | od -t x1
로그에서 예상한 바이트 스트림이 아니라는 것을 확인했습니다. A5 01 90 08 XXXX로 시작하는 13바이트가 있어야 합니다.
바이트가 달라지는 원인은 무엇입니까? 이 문제를 해결하려면 어떻게 해야 합니까?
0000000 4d 2d 27 5e 41 21 5e 48 5e 42 58 5e 40 5e 40 5e
0000020 40 5e 40 5e 40 5e 40 4d 2d 51 5e 40 4d 2d 27 5e
0000040 41 21 5e 48 5e 42 58 5e 40 5e 40 5e 40 5e 40 5e
0000060 40 5e 40 4d 2d 51 5e 40 5e 40 4d 2d 27 5e 41 21
0000100 5e 48 5e 42 58 5e 40 5e 40 5e 40 5e 40 5e 40 5e
0000120 40 4d 2d 51 5e 40 4d 2d 27 5e 41 21 5e 48 5e 42
0000140 58 5e 40 5e 40 5e 40 5e 40 5e 40 5e 40 4d 2d 51
내 uEnv.txt:
cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0
uname_r=4.14.108-ti-r131
#uuid=
#dtb=
###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/BB-UART1-00A0.dtbo
#uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo
#uboot_overlay_addr2=/lib/firmware/BB-UART4-00A0.dtbo
#uboot_overlay_addr3=/lib/firmware/BB-UART5-00A0.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###
cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet
#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e
##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
답변1
이해가 안됐는데 최소값을 사용하면 다음과 같습니다.
minicom -Hw -b 9600 -D /dev/ttyS4
올바른 데이터 표시:
b ff fe ff b7 ff ef af fe 9b fb ff f2 ff bf f7 ff ff f3 bd fd df f1 6d df ff ee ff b3 ff bb bb fe 5b ff ff fd ff 9f 7f ff b7 7f fb ff ff fe fb ff ff ff d7
ff ff a5 40 94 08 00 00 00 00 00 00 00 00 81 fa ff ====>a5 01 94 08 08 02 00 00 00 00 00 ec 38 ef ===== b6 de 7f ff f6 ff df bf fb 7f 7f 7b ff df df fe ff ff ff bf
ff ff ff fe ff 7f ff fb df ff fe ff dd ff ff fd f6 f7 dd ff ff ba ff f7 f9 f7 ff fb f6 df ff ff fe ff 7e fa bf 5b 9d fd ff 8b db ff ff ff ff b7 9f df 9b f
f fb ff c9 9f 9b ff 7f ff ff bf ff df ff ff ff ff fd fd bf 97 ff ef ff ff f6 76 fe fe e7 e7 87 ff ff fd ff d2 ff f7 ff ff bb ef d6 ff bb f9 fd ff ef ff ff
ec df ff 7b ff bf fc fb ff ff ff ff ff f7 d3 7f 7f b7 ff bf d7 fb ff fb ff df fe ff ff 7f ff fe fe bf a5 40 95 08 00 00 00 00 00 00 00 00 82 ff a5 01 95
08 01 0c d4 0c d2 0c d2 ec cc a5 01 95 08 02 0c d6 0c d6 0c d4 ec d5 ff fe a5 01 95 08 03 0c d4 0c ce 0c d4 ec cc f7 ff de ff ff ff ff ff 7f fd ff 7f eb f
f 5b 9d cb ff ff 2c 77 fd de 1c ed fc fc 00 f2 1f 77 ed 81 6f fd ff da ff ff ff eb ff ff ff ff ff df fb 6d df e7 f7 b3 bb fe 7f ff ff ff fb df ff ff 79 bf
stty
내 시간이 재설정된 것 같은데요 cat
? 그렇다면 명령은 어떻게 작성해야 할까요?