Hi,
anyone tried the gpio-pins or knows if any kernel-patch is needed?
I want to communicate to an arduino via uart/serial and reset the bpi via the arduino (maybe reset-switch is accessable via pins)
i’m just taking some time to refer to the broken schematic on hand, hope that would help you step a little
uart2 is for console output while uart0/1 all available on the 40 pins out called U[R,T] XD[0,1]. They should use the same driver as uart2. please feel free to enable those uart nodes in your dts files, they would be mapped to ttyS0, and ttyS1 after system boots, but also note your console has to utilize ttyS2 if you enable ttyS0 and ttyS1 all, otherwise you can’t any get kernel messages out.
No reset is exported to user pin. you could make the reset using software scheme that controls the reboot also with your uart as discussed in 1) delivering some specific commands.
please refer http://elixir.free-electrons.com/linux/v4.13-rc7/source/arch/arm/boot/dts/mt7623.dtsi
and add the missing uart nodes to the dtsi BPI providing. and also notes it is better to send pull request back to BPI.
sharing is the force and helps the next one person doesn’t make the same mistake again and concentrate what we need to care.
maybe is it required to add hardware link to your arduino with SYSRSTB_MT6323 to imitate manual operation as long press X second to reset.
@garywang which dts will be used (where do i have to add uart0/1)?
i have:
mt7623a-evb.dts
mt7623.dtsi
mt7623n-bpi-r2.dts / dtb <<< maybe this dts
mt7623n-evb.dts
i assume that only bpi-r2.dts will be used (dtb is compiled), but maybe uart should be added to mt7623n.dts (where uart 2 is defined)…in bpi-r2.dts it seems uart2 is only enabled via
&uart2{status=“okay”;}
did i need such line also for uart0/1?
what does that mean:
chosen {stdout-path=&uart2;}
i think thats the definition of debug-console (which port is used for serial-console)
The uImage(with dtb) is in partition 1 and modules of kernel is in partition 2 of SD card, there is a script for you reference.
mount /dev/mmcblk0p1 /mnt/
cp SD/BPI-BOOT/bananapi/bpi-r2/linux/* /mnt/bananapi/bpi-r2/linux/
umount /mnt
mount /dev/mmcblk0p2 /mnt/
cp SD/BPI-ROOT/* /mnt/ -rf
umount /mnt
#!/bin/bash
DEV=/dev/ttyS2
while read line; do
echo "["$(date "+%Y-%m-%d %H:%M:%S")"] from Arduino: "$line
done < <(cat $DEV)
here i see my keepalives…if i try to send via
echo "AT" >/dev/ttyS2
i get no response (my arduino sends back “AT”-Strings)…arduino is connected also via usb to my workstation, if i send same string via ardiono-console, i see the response in the console and my script-output…so there is a problem with sending to the device (same construction works with raspi [script+send on another terminal via echo])