2024年12月21日 星期六

Neovim+LazyVIM

Neovim, 編譯時,相依滿多東西的,麻煩
a. sudo apt install npm

b. 其它的,缺什麼補什麼
   lua, tree-sitter
   fzf, luarocks(不裝,Checkhealth裡會有WARNING),但它不支援lua 5.5

c. 符號亂碼的話,裝Nerd Font字型:
       nerdfonts
   下載:
       JetBrainsMono Nerd Font
   安裝:
       font
   Terminal:
       要選有Nerd Font的字型,所有符號就能正常下載
       ex: JetBrainsMono Nerd Font

LazyVim
安裝:
    How to Install

Commands for LazyVIM
:checkhealth
:checkhealth mason
:Mason  //初始化 Mason.nvim,通過 mason 可以自動裝各種LSP
LazyVim Extras, 剛進去nvim時,壓一下x


compile_commands.json, for clangd //A compilation database describes compile commands for a codebase
放在根專案下
a. Makefie:
    $ sudo apt install bear
    $ bear -- make

b. CMake:
    $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..


ex:
.
├── compile_commands.json
├── include
│   └── hello.h
├── Makefile
└── src
    ├── hello.c
    └── main.c
go to implementation(gI),它只會回應:[Fzf-lua] No implementations found

/home/ubuntu/.config/nvim/lua/config
-- Tab
vim.opt.tabstop = 4 -- number of visual spaces per TAB
vim.opt.softtabstop = 4 -- number of spacesin tab when editing
vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab
vim.opt.expandtab = true -- tabs are spaces, mainly because of python


for kernel
$ make menuconfig

$ make CC=clang

$ python3 ./scripts/clang-tools/gen_compile_commands.py



keymaps

2024年12月17日 星期二

X-LINUX-AI for STM32MP series

  1. Binary download:
  2.     OpenSTLinux latest (6.0.0), login first

  3. Download image to SD card
  4.     Image_flashing

  5. Install X-AI
  6.     X-LINUX-AI_Starter_package

  7. Others:
  8. a. Performance

2024年12月9日 星期一

OpenWrt for STM32MP1/MP2

How to build: bootlin/openwrt-feed-st

Openwrt for STM32MP1/MP2 series
https://github.com/bootlin/openwrt-feed-st

feeds.conf.default, for ST
src-git st https://github.com/bootlin/openwrt-feed-st.git

.config or make menuconfig
....
...
CONFIG_TARGET_stm32=y
# CONFIG_TARGET_sifiveu is not set
# CONFIG_TARGET_starfive is not set
# CONFIG_TARGET_archs38 is not set
# CONFIG_TARGET_omap is not set
# CONFIG_TARGET_uml is not set
# CONFIG_TARGET_zynq is not set
# CONFIG_TARGET_x86 is not set
CONFIG_TARGET_stm32_stm32mp1=y
# CONFIG_TARGET_stm32_stm32mp2 is not set
# CONFIG_TARGET_MULTI_PROFILE is not set
CONFIG_TARGET_stm32_stm32mp1_DEVICE_stm32mp157f-dk2=y
# CONFIG_TARGET_stm32_stm32mp1_DEVICE_stm32mp135f-dk is not set
# CONFIG_TARGET_stm32_stm32mp1_DEVICE_stm32mp157f-dk2-demo is not set
# CONFIG_TARGET_stm32_stm32mp1_DEVICE_stm32mp135f-dk-demo is not set
CONFIG_HAS_SUBTARGETS=y
CONFIG_HAS_DEVICES=y
CONFIG_TARGET_BOARD="stm32"
CONFIG_TARGET_SUBTARGET="stm32mp1"
CONFIG_TARGET_PROFILE="DEVICE_stm32mp157f-dk2"
CONFIG_TARGET_ARCH_PACKAGES="arm_cortex-a7_neon-vfpv4"
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe"
CONFIG_CPU_TYPE="cortex-a7+neon-vfpv4"
...
...


Wifi setting, 可以直接使用(但很不穩@@,容易斷線)
因為br-lan預設是192.168.1.1
修改, /etc/config/network
config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.0.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
還要設置DNS,/etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver ::1
search lan
設置完後,直接ping www.google.com看看


ref:
1. bootlin/openwrt-feed-st
2. 首发STM32MP135构建OpenWRT系统