LiteBSD
bootup
code:shell
% sudo cu -l /dev/cu.usbserial-A503Q1B2 -s 115200
Connected.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
4.4BSD-Lite build 0 compiled 2016-01-03
root@goa.vak.ru:litebsd-sources/sys/compile/WIFIRE.pic32
cpu: PIC32MZ2048EFG100 rev A1, 200 MHz
oscillator: system PLL div 1:6 mult x50
cache: 16/4 kbytes
real mem = 512 kbytes
avail mem = 344 kbytes
using 18 buffers containing 73728 bytes of memory
spi1 at pins sdi=RD14/sdo=RC1/sck=RD1
spi2 at pins sdi=RF0/sdo=RD11/sck=RG6
spi3 at pins sdi=RB10/sdo=RC4/sck=RB14
spi4 at pins sdi=RF5/sdo=RG0/sck=RD10
uart1 at pins rx=RF1/tx=RD15, interrupts 112/113/114
uart4 at pins rx=RF2/tx=RF8, interrupts 170/171/172, console
sd0 at port spi3, pin cs=RC3
gpio0 at portA, pins -i---ii-iiiiiiii
gpio1 at portB, pins i---i-iiiiiiiiii
gpio2 at portC, pins iiii---------i--
gpio3 at portD, pins --ii------iiii-i
gpio4 at portE, pins ------iiiiiiiiii
gpio5 at portF, pins --ii--------i---
gpio6 at portG, pins iiii--iii-------
mrf0 at port spi4, pins cs=RD9, irq=RA15, reset=RF4, hibernate=RG1
mrf0: MRF24WG version 31.c, MAC address 00:1e:c0:1a:41:5d
bpf: mrf0 attached
sd0: function groups 1/1/1/1/1/3, max current 200 mA
sd0: type SDHC, size 1966080 kbytes, speed 50 Mbit/sec
sd0a: partition type b7, sector 2, size 204800 kbytes
sd0b: partition type b8, sector 409602, size 32768 kbytes
sd0c: partition type b7, sector 475138, size 102400 kbytes
bpf: sl0 attached
bpf: lo0 attached
WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!
starting file system checks.
/dev/rsd0a: 2335 files, 16815 blocks used, 33400 free
/dev/rsd0a: MARKING FILE SYSTEM CLEAN
starting network
clearing /tmp
standard daemons: update cron.
Wed Jul 11 20:39:01 JST 2018
4.4BSD-Lite (bsd.net) (console)
login:
code:shell
# uname -a
4.4BSD bsd.net 4.4BSD-Lite 4.4BSD-Lite build 0 compiled 2016-01-03 root@goa.vak.ru:litebsd-sources/sys/compile/WIFIRE.pic32 MIPS
demo
code:led.sh
portio -o e
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
do
echo $i
portio -s e${i}
sleep 1
portio -c e${i}
sleep 1
done
while true
do
portio -s e
sleep 1
portio -c e
sleep 1
done
code:gpio.c
int main(int argc, char **argv) {
int fd;
fd=open("/dev/portd", O_RDWR);
ioctl(fd, GPIO_PORTD|GPIO_CONFOUT, 1<<3|1<<11);
while (1) {
ioctl(fd, GPIO_PORTD|GPIO_SET, 1<<3|1<<11);
sleep(1);
ioctl(fd, GPIO_PORTD|GPIO_CLEAR, 1<<3|1<<11);
sleep(1);
}
}
code:demo.sh
# BTN (RA4, RA5)
BTN="a4 a5"
portio -i a4 a5
# portio -i a5
# echo ----------ii---- > /dev/confa
# Internal LED (RG6, RD4, RB11, RG15)
INT_LED="g6 g15 d4 b11"
portio -o ${INT_LED}
portio -c ${INT_LED}
# External LED
# 1st: (RG6, RF0, RD11, RG9, RD3, RA14)
# 2nd: (RE0-7)
EXT_LED="g6 f0 d11 g9 d3 e0-7"
# EXT_LED="g6 f0 d11 g9 d3 a14 e0-7"
# If set a14, BTN: a4,a5 setting broken
portio -o ${EXT_LED}
portio -c ${EXT_LED}
# Show port configration
PORTS="a d e f g"
# PORTS="a b c d e f g"
for p in ${PORTS}
do
echo -n "${p}:";cat /dev/conf${p}
done
echo "BTN:"${BTN}
echo "INT LED:"${INT_LED}
echo "EXT LED:"${EXT_LED}
# exit
while true
do
portio -r e
BTN1=portio -g a4
BTN2=portio -g a5
echo 'BTN:'${BTN1},${BTN2}
# portio -c b11
portio -c ${EXT_LED}
else
# portio -s b11
# portio -s ${EXT_LED}
for l in ${EXT_LED}
do
echo ${l}
portio -s ${l}
done
fi
portio -c d4
else
portio -s d4
fi
done
while true
do
for l in ${EXT_LED}
do
portio -s ${l}
# sleep 1
portio -c ${l}
# sleep 1
done
done