-
Notifications
You must be signed in to change notification settings - Fork 0
Raspberry Pi
sudo dd if=what_ever.img of=/dev/sdj status=progress bs=4M
Download from https://archive.raspberrypi.org/debian/pool/main/r/raspi-config/
Follow https://askubuntu.com/questions/1130052/enable-i2c-on-raspberry-pi-ubuntu
sudo apt-get install vim dnsutils build-essential cmake nfs-common libunwind8-dev
sudo apt-get install gcc make binutils-arm-linux-gnueabi
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
Need to set DNS nameserver IP at /etc/resolv.conf file if DHCP is updating to a wrong server
nameserver (some server)
nameserver (more server)
nameserver 8.8.8.8
Command (m for help): p
Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x580a66ff
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 133119 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 133120 54132735 53999616 25.8G 83 Linux
/dev/mmcblk0p4 54132736 62333951 8201216 3.9G 82 Linux swap / Solaris
/etc/fstab
/dev/sda1 /home/maxwell/u ext4 defaults 0 1
attach, edit /etc/fstab
UUID=whatever /ssd ext4 defaults 0 2
reboot and rsync var
sudo rsync -aqxP /var /ssd
change /var in /etc/fstab
/ssd/ssd /home/ubuntu/ssd none bind
/ssd/var /var none bind
mkdir -p $HOME/w/github/rpi && cd $HOME/w/github/rpi
git clone https://github.com/raspberrypi/firmware
cd /opt
sudo mv vc vc.old
sudo cp -Rv $HOME/w/github/rpi/firmware/hardfp/opt/vc .
View running frequency (http://raspberrypi.stackexchange.com/questions/1219/how-do-i-determine-the-current-mhz)
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
- disable apt-get auto updates: https://www.garron.me/en/linux/turn-off-stop-ubuntu-automatic-update.html
edit /etc/apt/apt.conf.d/10periodic and change to
APT::Periodic::Update-Package-Lists "0";
Temperature
/opt/vc/bin/vcgencmd measure_temp
- http://www.elinux.org/RPI_vcgencmd_usage
vcgencmd get_config int
#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"
clock=$(</sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
echo "$((clock/1000)) MHz"
sudo apt-get install libc6-dbg
RPi should be also connected to network with IP address
gdbserver :1234 someprogram
where 1234 is listening port
run gdb
arm-none-eabi-gdb
in gdb,
symbol-file <target binary>
target remote <RPi IP:1234>
where <target binary> is which you are running in RPi
Good link: http://wiki.igrebot.fr/index.php?title=Raspi_Cross_Toolchain
Uses Eclipse as IDE
- Start a Makefile Project
- File > New > Project
- VisualC++ > General > Makefile Project
-
Build command line: build.bat -
Clean commands: clean.bat - Clear
Outputedit box
-
- Project properties
- clean all
VC++ Directories -
NMake- delete
Preprocessor Definitions - add to includes
- D:\SysGCC\Raspberry\arm-linux-gnueabihf\include\c++\4.9
- D:\SysGCC\Raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include
- D:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\include\arm-linux-gnueabihf
- D:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\include
- delete
- Add Source
- Project right click > Add > New Item > C++ File(.cpp)
- Main.cpp
#include <stdio.h>
int main()
{
printf("Hello Pi from windows.\n");
return(0);
}
- Add batch files
- build.bat
set sources=*.cpp
set executable=Main
set pscp_exe="(path of pscp.exe from putty)"
set putty_key="(file path of private key generated with puttygen)"
PATH=D:\SysGCC\Raspberry\arm-linux-gnueabihf\bin:$PATH
PATH=D:\SysGCC\Raspberry\bin:$PATH
D:\SysGCC\Raspberry\bin\arm-linux-gnueabihf-gcc-4.9.exe -Wall -O3 %sources% -o %executable%
%pscp_exe% -i %putty_key% %executable% pi@(raspberry pi address):/home/pi/VS/.
- need to save public key to
~/.ssh/authorized_keysfile
- save as project template ...
http://askubuntu.com/questions/690511/how-to-change-dns-in-ubuntu-15-10
/boot/config.txt
# i2c on
dtparam=i2c_arm=on
# i2s on
dtparam=spi=on
# stop
sudo service mysql stop
sudo service mysql status
# move
sudo rsync -av /var/lib/mysql /var/hdd/mysqldb
# change cfg
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
# change to new location
datadir=/var/hdd/mysqldb/mysql
# and maybe for the log
# update AppArmor
sudo vi /etc/apparmor.d/tunables/alias
# add locations
alias /var/lib/mysql/ -> /var/hdd/mysqldb/mysql/,
alias /var/log/mysql/ -> /var/hdd/log/mysql/,
# restart AppArmor
sudo service apparmor restart
# fake mysql starter
sudo mkdir /var/lib/mysql/mysql -p
# start mysqld
sudo service mysql start
# check
mysql -u root -p
# where?
select @@datadir;
Visit gcc-4-8-on-raspberry-pi-wheezy to install GCC-4.8 from jessie.
-
dnsutilsis missing for raspbianjessie2015-11 version
SSH
# Enable by default
sudo update-rc.d ssh defaults
--> USE raspi-config !!!
Boot logo
# disable boot logo
sudo apt-get remove plymouth
# reinstall
sudo apt-get install lightdm plymouth plymouth-label plymouth-theme-ubuntu-mate-logo
--> USE raspi-config ALSO !!!
CPU clock?
$ lscpu
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Model name: ARMv7 Processor rev 4 (v7l)
CPU max MHz: 1200.0000
CPU min MHz: 600.0000