Monday, February 19, 2018

beaglebone

To install ubuntu on SD follow this guide
 https://qiita.com/TsutomuNakamura/items/ca25402f8f7569642564

in short:
create two partitions,  vfat + ext4, where you extract the uboot and image ,respectively.

(files available at http://www.armhf.com/download/)

The OTG ethernet (ethernet over usb) must be enabled (ubuntu 14.04),
by editing the files on the SD or using the serial console.

Using the serial console:
pinheader J1, pin 1:GND, pin 4:beaglebone rx, pin 5 beaglebone TX
On the PC
screen /dev/ttyUSB0 115200

/etc/modules
g_ether

/etc/network/interfaces
auto lo
iface lo inet loopback

auto usb0
iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.1
    dns-nameservers 8.8.8.8
The 192.168.7.2 is the IP usually used by beaglebone. However, if network manager is used for sharing the connection (by setting IPv4 Settings / Method = Shared to other computers) it is better to set it to 10.42.0.2 as the pc IP is hardcoded on old distributions (source https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1098362 )

auto lo
iface lo inet loopback

auto usb0
iface usb0 inet static
    address 10.42.0.2
    netmask 255.255.255.0
    network 10.42.0.0
    gateway 10.42.0.1
   dns-nameservers 8.8.8.8

(tested on debian)
to assign a fixed mac address to the gadget ethernet, create a file /etc/modprobe.d/something.conf containing

options g_ether host_addr=fa:b1:00:fa:b1:00 dev_addr=fa:b1:00:fa:b1:00

sources:
https://qiita.com/chromabox/items/d4368ccebb0f8822ce74
and
https://askubuntu.com/questions/51226/how-to-add-kernel-module-parameters


The serials must be enabled by creating custom dtb files. Kernel 3.14 does not have capemgr anymore, editing /boot/uboot/uEnv.txt is useless
sudo apt install device-tree-compiler
in /boot/dtbs do
sudo dtc -I dtb -O dts -o am335x-boneblack.dts am335x-boneblack.dtb
this create a text file with the settings. Enable the serial port by editing the file, and then generate a new blob with
sudo dtc -I dts -O dtb -o am335x-boneblack.dtb am335x-boneblack.dts

The edits to do are as follows

/*on debian you may need to add the definitions*/

pinmux_uart1_pins {
pinctrl-single,pins = <0x180 0x30 0x184 0x0>;
linux,phandle = <0x29>;
phandle = <0x29>;
};


pinmux_uart2_pins {                                                            
 108                        pinctrl-single,pins = <0x150 0x21 0x154 0x1>;                          
 109                        linux,phandle = <0x82>;                                                
 110                        phandle = <0x82>;                                                      
 111                };                                                                             
 112                                                                                               
 113                pinmux_uart4_pins {                                                            
 114                        pinctrl-single,pins = <0x70 0x26 0x74 0x6>;                            
 115                        linux,phandle = <0x84>;                                                
 116                        phandle = <0x84>;                                                      
 117                };                         

TO

pinmux_uart2_pins {                                                            
 108                        pinctrl-single,pins = <0x150 0x21 0x154 0x1>;                          
 109                        linux,phandle = <0x82>;                                                
 110                        phandle = <0x82>;                                                      
 111                };                                                                             
 112                                                                                               
 113                pinmux_uart4_pins {                                                            
 114                        pinctrl-single,pins = <0x70 0x26 0x74 0x6>;                            
 115                        linux,phandle = <0x84>;                                                
 116                        phandle = <0x84>;                                                      
 117                };                         


AND

1047                serial@48024000 {                                                            
1048                        compatible = "ti,omap3-uart";                                        
1049                        ti,hwmods = "uart3";                                                
1050                        clock-frequency = <0x2dc6c00>;                                      
1051                        reg = <0x48024000 0x2000>;                                          
1052                        interrupts = <0x4a>;                                                
1053                        status = "disabled";                                                
1054                };    

1065                serial@481a8000 {                                                            
1066                        compatible = "ti,omap3-uart";                                        
1067                        ti,hwmods = "uart5";                                                
1068                        clock-frequency = <0x2dc6c00>;                                      
1069                        reg = <0x481a8000 0x2000>;                                          
1070                        interrupts = <0x2d>;                                                
1071                        status = "disabled";                                                
1072                };

TO

1051                serial@48024000 {                                                            
1052                        compatible = "ti,omap3-uart";                                        
1053                        ti,hwmods = "uart3";                                                
1054                        clock-frequency = <0x2dc6c00>;                                      
1055                        reg = <0x48024000 0x2000>;                                          
1056                        interrupts = <0x4a>;                                                
1057                        status = "okay";                                                    
1058                        pinctrl-names = "default";                                          
1059                        pinctrl-0 = <0x82>;                                                  
1060                        linux,phandle = <0x92>;                                              
1061                        phandle = <0x92>;                                                    
1062                };    

1073                serial@481a8000 {                                                            
1074                        compatible = "ti,omap3-uart";                                        
1075                        ti,hwmods = "uart5";                                                
1076                        clock-frequency = <0x2dc6c00>;                                      
1077                        reg = <0x481a8000 0x2000>;                                          
1078                        interrupts = <0x2d>;                                                
1079                        pinctrl-names = "default";                                          
1080                        pinctrl-0 = <0x84>;                                                  
1081                        status = "okay";                                                    
1082                        linux,phandle = <0x94>;                                              
1083                        phandle = <0x94>;                                                    
1084                };      

where the handles specified in pinmux should not be used elsewhere, and the pinctrl-0 handle in the serial section should be the one specified in the pinmux
source:https://billwaa.wordpress.com/2014/10/13/beaglebone-black-enable-all-uart-ports-at-boot/

to change the i2c speed search for

i2c@4819c000 {
compatible = "ti,omap4-i2c";
#address-cells = <0x1>;
#size-cells = <0x0>;
ti,hwmods = "i2c3";
reg = <0x4819c000 0x1000>;
interrupts = <0x1e>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x7>;
clock-frequency = <0x186a0>;
linux,phandle = <0x27>;
phandle = <0x27>;
where the frequency is in Hz (in hex),default 100KHz

source: http://randymxj.com/?p=538

tested kernel compilation way:
https://longervision.github.io/2018/01/10/beaglebone-black-uboot-kernel/


No comments:

Post a Comment