一些個人的筆記。
測試引用一。
測試引用二, 粗體字測試,使用OK。 以後再更新。
– changcs
步驟如下
git clone git://git.code.sf.net/p/openocd/code openocd-code.git
- run
./bootstrap - run
./configure --help - run
./configure --enable-jlink - run
make
- connect Jlink JTAG cable to DUT
- connect Jlink to PC with USB cable. You can use
lsusbcommand to check. - power on the target board.
- run
openocd
cd tcl;
../src/openocd -f interface/jlink.cfg -f board/ti_beaglebone_black.cfg -c “init; halt”
Test via telnet interface and use reg command to display registers
$ telnet 127.0.0.1 4444
若要進行 JTAG 除錯, 需要從 u-boot 關掉 watchdog timer 。 方法如下: 找出 ti_am335x_common.h 裏面 WATCHDOG 的 define ,改為 undef 。
make am335x_boneblack_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make
劃分一個 vfat partition 在 2048 sector 處,長度 128MB。 並設定成 bootable partition 。
mkfs.vfat -F 32 -n boot /dev/sdX1
mount /dev/sdX1 /mnt
cp MLO u-boot.img /mnt
umount /mnt
這是 Arch Linux 建議的方法。
dd if=/dev/zero of=/dev/sdX bs=1M count=8
fdisk to create an empty partition table and a ext4 FS after 2048 sectors
dd if=MLO of=/dev/sdX count=1 seek=1 conv=notrunc bs=128k
dd if=u-boot.img of=/dev/sdX count=2 seek=1 conv=notrunc bs=384k
參考 BeagleBone Black | Arch Linux ARM。
- 若要使用 JTAG debug linux kernel,要加上patch。
- 確定開啟
CONFIG_DEBUG_INFO
git clone git://github.com/beagleboard/linux.git cd linux git checkout 4.4 make V=1 distclean make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- V=1 bb.org_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- V=1 zImage dtbs modules make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/new/prefix modules_install
假設 TFTP server 的 IP 是 192.168.1.1。
把 arch/arm/boot/zImage 和 arch/arm/boot/dts/am335x-boneblack.dtb 放到
TFTP directory 之後,接上網路線,用以下 u-boot 命令開機。
dhcp ${loadaddr} 192.168.1.1:zImage
tftpboot ${fdtaddr} 192.168.1.1:am335x-boneblack.dtb
setenv bootargs "console=ttyO0,115200n8 coherent_pool=1M root=/dev/mmcblk1p1 rw rootwait fixrtc"
bootz $loadaddr - $fdtaddr
建議使用 emacs 的 gud-gdb mode 。接下來可以使用 step , next , until 這些命令來除錯。
openwrt 的 gdb 在 staging_dir/toolchain-arm_*_${libc}*/bin/*-gdb 。
要看目前的 call stack , 可以使用 info stack 或是 frame 命令。
$ arm-none-eabi-gdb --fullname vmlinux
(gdb) target extended-remote :3334
(gdb) hbreak start_kernel
(gdb) continue
u-boot> dhcp ${loadaddr} 192.168.1.1:zImage
u-boot> tftpboot ${fdtaddr} 192.168.1.1:am335x-boneblack.dtb
u-boot> setenv bootargs "console=ttyO0,115200n8 coherent_pool=1M root=/dev/mmcblk1p1 rw rootwait fixrtc"
u-boot> bootz $loadaddr - $fdtaddr
- BeagleBone Black 从零到一 2 MLO、U-Boot
- U-Boot on BeagleBone Black
- AM335x U-Boot User’s Guide
- BeagleBone Black 从零到一 (3 Linux 镜像、initramfs、Device Tree及根文件系统)
- Beagleboard:BeagleBoneBlack Rebuilding Software Image
- BeagleBone Black | Arch Linux ARM
nc543 mentioned Official OpenWrt Support BeagleBone Black.
When the menu appear, select Target System as TI OMAP3/4/AM33xx,
Target Profile as TI AM335x BeagleBone Black.
More details can be found here. Actions:
- run
./scripts/feeds update -a - run
./scripts/feeds install -a - run
make menuconfigand set target - run
make defconfigto set default config for build system and device - run
make kernel_menuconfig(optional and checkCONFIG_COLLECT_KERNEL_DEBUG=y) - run
make menuconfigand modify set of package - run
./scripts/diffconfig.sh > diffconfig - run
make download - run
./scripts/diffconfig.sh
Note make printdb can show available make targets.
ionice -c 3 nice -n19 make V=sc
zcat bin/targets/omap/generic/openwrt-omap-ti_am335x-bone-black-ext4-sdcard.img.gz | sudo dd of=/dev/sdX bs=4096 conv=fsync
Plug the SD card into BeagleBone Black, then power on BeagleBone Black with the BOOT button (S2) pressed to boot from SD.
Built-in:
bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit;fi;run findfdt; run init_console; run envboot; run distro_bootcmd
init_console=if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;else setenv console ttyO0,115200n8;fi;
importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
board_name=A335BNLT
findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name = A335_ICE; then setenv fdtfile am335x-icev2.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
loadaddr=0x82000000
fdtaddr=0x88000000
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
uEnv.txt:
bootpart=0:1
bootdir=/
bootfile=zImage
fdtdir=/dtbs
uenvcmd=run loadfdt; run loadimage; run uenvbootargs ; bootz ${loadaddr} - ${fdtaddr}
loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}
devtype=mmc
uenvbootargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rootwait
Plug the SD card into BeagleBone Black, then power on BeagleBone Black with the BOOT button (S2) pressed to boot from SD.
load mmc 0:1 0x88000000 /dtbs/am335x-boneblack.dtb load mmc 0:1 0x82000000 /zImage setenv bootargs "console=ttyO0,115200n8 root=/dev/mmcblk0p2 rootwait" bootz 0x82000000 - 0x88000000
Openwrt Technical Reference link and git repository.
AMD64 Installation Guide and X86 Installation Guide
emerge –sync # or
emerge-webrsync
emerge –ask –verbose –update –deep –with-bdeps=y –newuse @world # or
emerge -uDNav –with-bdeps=y @world
In the next example, a user call john is created:
root # useradd -m -G users john
From Adding a user to a group - Gentoo Wiki
root # gpasswd -a larry wheel
root # mkdir -p /etc/modules-load.d
root # nano -w /etc/modules-load.d/network.conf
Browse Gentoo WiKi
- Install
laymanby
USE=”git” emerge -av app-portage/layman
layman -L
git clonemy gentoo-zh overlay intogit-localby
git clone https://github.com/changcs/gentoo-zh.git gentoo-zh.git
- Apply
temp gentoo-zh2stash - Add my
gentoo-zhoverlay
layman -o file:///home/changcs/git-local/gentoo-zh.git/repo.xml -f -a gentoo-zh2
- Set
windowkeys=NOin/etc/conf.d/keymaps. - Create
personal.map.gzby revising/usr/share/keymaps/i386/qwerty/us.map.gz. - Set
keymap=personalin/etc/conf.d/keymaps.
- Set
PermitRootLogintoyesin/etc/ssh/sshd_config.
From How to Enable X Forwarding Over SSH on Gentoo Server.
Enable X11Forwarding in /etc/ssh/sshd_config
X11Forwarding yes /etc/init.d/sshd reload
emerge -av app-shells/bash-completion find /usr -name git-prompt.sh.bz2 cp /usr/share/doc/git-1.8.5.5/git-prompt.sh.bz2 ~ bunzip2 git-prompt.sh.bz2 mv git-prompt.sh .git-prompt.sh Paste into ~/.bashrc # Bash completion if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] ' export GIT_PS1_SHOWDIRTYSTATE=1 source ~/.git-prompt.sh
URL will be provided later.
Browse Disk Quotas
emerge -av sys-fs/lvm2 cat sys-fs/lvm2 lvm2create_initrd readline > /etc/portage/package.use/lvm2 pvdisplay # cfdisk to create a dos extended partition at/dev/sdd6 pvcreate /dev/sdd6 vgcreate home_vg /dev/sdd6 vgdisplay lvcreate -l 100%FREE -n home home_vg ls -l /dev/home_vg home -> ../dm-2 mkfs.ext4 /dev/home_vg/home mount -t ext4 /dev/home_vg/home /home3
Browse Portage Local Mirror
sleep 5; xwd -root | xwdtopnm | pnmtopng > capture.png
Browse Gentoo VirtualBox
echo "app-emulation/virtualbox-bin PUEL" >> /etc/portage/package.license/virtualbox-bin emerge -av app-emulation/virtualbox gpasswd -a <user> vboxusers
vboxmanage startvm VMname --type headless vboxmanage controlvm VMname poweroff
Browse 修正 emacs 在X11下不能使用中文輸入法的問題
Browse Gentoo wiki IBus
Browse Gentoo Knowledge Base:Unmasking a package
Browse Emerge Strategy when hacking a software
When I want to hack a package for which an ebuild exists (say foo-x.y.z.ebuild), this is what I do. Code: ebuild /usr/portage/path-to-the-ebuild/foo-x.y.z.ebuild prepare Go to the extracted source directory: Code: cd /tmp/portage/path-to-the-ebuild/foo-x.y.x/work and there I edit, hack, etc. the sources. Then I use the command merge to compile the hacked sources and install: Code: ebuild /usr/portage/path-to-the-ebuild/foo-x.y.z.ebuild merge Everything is installed in the proper places. I can uninstall with the command ebuild ... unmerge.
Browse Variables - Gentoo Development Guide
Browse Github gentoo-binhost of coldnew
ssh-keygen -t rsa -C your_email@example.com
- The import web page can be found at
Settings - SSH and PGP keys. - Then test with
ssh -T git@github.com
emerge -av app-text/texlive dev-texlive/texlive-langcjk
Copy necessary fonts to /usr/share/texmf-dist/fonts directory
from Debian latex-cjkchinesearphic-bsmi00lp packages:
/usr/share/texmf/fonts/afm/arphic /usr/share/texmf/fonts/tfm/arphic /usr/share/texmf/fonts/vf/arphic /usr/share/texmf/fonts/type1/arphic /usr/share/texmf/fonts/map/dvips/arphic
Unmark Map bsmiu.map in /etc/texmf/updmap.d/00updmap.cfg, and run
texmf-update.
Finally you have to run mktexlsr command to refresh the kpathsea caches.
According to todays update breaks fonts in texlive Issue No 28051
sed -i 's:`kpsewhich -var-value=TEXMFROOT`:"/usr/share/texmf-dist":' /usr/bin/updmap updmap-sys --syncwithtrees updmap-sys
Please note you may need to copy /usr/share/tlpkg to /usr/share/texmf-dist for updmap-sys to run.
Browse How to overcome the circular dependencies between certifi and setuptools
Browse Basic guide to write Gentoo Ebuilds and ebuild variables
Browse Gentoo epatch Introduction by coldnew
rc-update add elogind boot
Browse Gentoo Home router
turn-on-gnus-dired-mode
C-c C-m C-a to run gnus-dired-attach
zip -r9 library.zip unpacked
echo ‘#!/usr/bin/env python’ > my_executable_zip
cat output_of_setup_py_bdist.zip >> my_executable_zip
chmod +x my_executable_zip
Browse
Please browse
Browse
Browse PyConTW 2013: MyHDL designing digital hardware with Python by Jan Decaluwe
