Linux - BeagleBone Black

These methods are tested on bone-debian-9.9-iot-armhf-2019-08-03-4gb.img with kernel 4.14.108-ti-r113.

1. Development tools:
Image writer: Win32 Disk Imager

SSH client: Putty

File manager: WinSCP

2. Wifi (BeagleBone Black Wireless): Connect wifi.
connmanctl enable wifi scan wifi services agent on connect <ID of network which is next to name of wifi> <Password of wifi> quit

Remove auto-connect.
connmanctl config <ID> auto-connect off quit

Check whether it connects.
timeout 1 ping 8.8.8.8

3. USB network (BeagleBone Black): Open Windows control panel and go to network adapter setting. Share network of computer with the board. Make network adapter of the board get IP address AUTOMATICALLY. Create file named resolv.conf with the following content.
domain localdomain search localdomain nameserver 8.8.8.8 nameserver 8.8.4.4

Create shell script with the following content and execute the script.
echo temppwd | sudo -S sudo /sbin/route add default gw 192.168.7.1 printf " (Automatically log in.)\n" sudo cp --remove-destination resolv.conf /etc/resolv.conf timeout 1 ping 8.8.8.8
The shell script need to be executed every time when the board boots up.

4. Pin configuration: BeagleBone Black Wireless with image which is on SD card need some change before pin configuration.
sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=10


Open /boot/uEnv.txt and edit the following lines.
###Overide capes with eeprom #uboot_overlay_addr0=/lib/firmware/.dtbo #uboot_overlay_addr1=/lib/firmware/.dtbo #uboot_overlay_addr2=/lib/firmware/.dtbo #uboot_overlay_addr3=/lib/firmware/.dtbo ### ###Additional custom capes #uboot_overlay_addr4=/lib/firmware/.dtbo #uboot_overlay_addr5=/lib/firmware/.dtbo #uboot_overlay_addr6=/lib/firmware/.dtbo #uboot_overlay_addr7=/lib/firmware/.dtbo ### ###Custom Cape #dtb_overlay=/lib/firmware/.dtbo

Take PWM0, UART1, and I2C1 for example,
###Overide capes with eeprom uboot_overlay_addr0=/lib/firmware/BB-PWM0-00A0.dtbo uboot_overlay_addr1=/lib/firmware/BB-UART1-00A0.dtbo uboot_overlay_addr2=/lib/firmware/BB-I2C1-00A0.dtbo

5. Develop the Linux kernel modules. Install kernel headers.
sudo apt update sudo apt install linux-headers-$(uname -r)

Create one folder, one C file, one Makefile with the following content.
obj-m+=.o KDIR=/lib/modules/$(shell uname -r)/build all: make -C $(KDIR) M=$(shell pwd) modules clean: make -C $(KDIR) M=$(shell pwd) clean
Warning: One tab key and four spaces are different in Makefile!



Comments

Popular posts from this blog

Manual - Modbus TCP Client

Manual - TCP / UDP Client

Manual - MQTT Client