STM32 Experiment & Note —— (013) OpenWrt cross-compilation (Not translated)
»
(001) HAL Library LED Lighting
(002) HAL Library LCD Frame Animation
(003) HAL Library FFT Dynamic Spectrum
(004) HAL Library FFT Speed Up
(005) HAL Library Understanding DMA
(006) Watchdog Summary
(007) GPIO Usage Steps
(008) CubeIDE Implementation of USB Peripherals*
(009) Why C99
(010) Linux UDP
(011) Linux TCP
(012) Temperature Control of Arm
(013) OpenWrt cross-compilation
(014) Basic data type in C99
(015) C99 struct
(016) C99 enum
(017) C99 funciont and L-Value, R-Value
(018) C99 pointer*
(019) C99 With only value assignment*
(020) C99 array with space, pointer with no space
(021) C99 No template function
(022) POSIX pthread multi-threads mutex*
(023) POSIX pthread multi-threads programming*
(024) C99 if
(025) C99 switch
(026) C99 loop
(027) C99 time and wait*
(028) High-precision calculation with GMP*
(029) Web Service Lib*
(030) International Components for Unicode (ICU)*
(031) Performance of C is higher than C++, because...*
(032) C99 weak function
(033) MTU TCP SOCKET
(034) STM32 UART Continually Sending Data
(035) STM32 UART Continually Receiving Data
(037) STM32 Normal and Circle
(038) STM32 UART clear transfer error flag
(039) STM32 UART Idle Callback
(040) STM32 UART, RS232 single TX line
(041) STM32 RS485 Differential signal communication
(042) STM32 HAL DMA Poll For Transfer
(043) STM32 enter low power comsuption mode
(044) STM32 Clear Flag of TCx in DMA IRQ
(045) STM32软件函数命名规范
(046) Deal with Idle in xxxCpltCallback
(047) C99 Built in macros
(048) isr enabled after calling ***_IT
(049) Procedure of starting STM32
(050) Load new firmware online
(051) SCB->VTOR
(052) STM32 Address space in programme
(053) STM32 Move program to other space
(054) STM32 Bootloader
(055) Keil中的下载算法
(056)编译器优化出错点
🍓(001) Close Swapfile
🍓(002) Format USB disk to ext4 with 1k blocks
🍓(003) Query Linux Version info and CPU info
🍓(004) Speed up latest version of Ubuntu
🍓(005) Clone 360 Browser Core Source Code Script
🍓(006) Before run Firefox in Ubuntu24.04
🍓(007) MAC Address
🍓(008) RMII & PHY
🍓(009) Ubuntu Server firewall configuration
🍓(010) Linux yield cpu by code
🍓(011) Linux Hardware Concept
🍓(012) Linux Inter-Process Communication
🍓(013) Ban Git force push
🍓(014) Ban Git reset --hard
🍓(015) Save unsaved cache to disk immedutely
🍓(016) 拷贝pre-receive到每个git仓库的脚本
🍓(017) sshd密码输入错误禁用IP3分钟
🖥️(001) 异机备份低功耗自用Git服务器搭建
🖥️(002) OpenWRT配置注意事项
🕹️(001) while(1){} cpu reentered
🕹️(002) functions for multi-thread in FreeRTOS
🕹️(003) FreeRTOS critical code zone
🕹️(004) FreeRTOS fix NULL not defined error
🕹️(005) lowest priority interrupt of ARM: PENDSV
🕹️(006) Configuration of tasks priority levels
🕹️(006) Cautions of different priority tasks locked
🕹️(008) Close scheduling of same priority tasks
🕹️(009) OTA Technology
🕹️(010) FreeRTOS create static task
🕹️(011) FreeRTOS list task list
🕹️(012) FreeRTOS HeapSize statistics
🕹️(013) FreeRTOS xTaskGetHandle
🕹️(014) FreeRTOS common method of create tasks
🕹️(015) FreeRTOS fix problem of tasks locked
🕹️(016) FreeRTOS Superest interrupt: SVC
🕹️(017) FreeRTOS interrupt call in privilege mode
🕹️(018) FreeRTOS SVC enter user mode
🕹️(019) FreeRTOS delay util
🕹️(020) FreeRTOS low consumption by Tickless
🕹️(021) FreeRTOS IdleHook
🕹️(022) FreeRTOS Hooks
🕹️(023) FreeRTOS yield CPU by code
🕹️(024) FreeRTOS semaphore
🕹️(025) FreeRTOS resolve priority inversion
🕹️(026) FreeRTOS get task priority
🕹️(027) FreeRTOS set task priority
🕹️(028) FreeRTOS function prefix
🕹️(029) Don't call RTOS function in IRQ handle
🕹️(030) Bottom half operation decrease semaphore
🕹️(031) Support Suspending for ever
🕹️(032) Call FreeRTOS SysCall in ISR
🕹️(033) Principle of Top Half and bottom haf
🕹️(034) FATFS in STM32 support exFat
🕹️(035) Message Queue in FreeRTOS
🕹️(036) Timer Tasks in FreeRTOS
🕹️(037) Reason of can not ping board
🕹️(038) LwIP Tcp Server Sample Code
🕹️(039) mutex equals binarySempahore
🕹️(040) Relationship between MEMP and Pbuf
🕹️(041) FreeRTOS连接ESP WiFi(待完成)
📟(001)CMSIS标准学习
🕹️(001)函数调用被优化
    一个概念:交叉编译、cross-compilation,英文原意:跨平台编译。
    也就是在x86_64架构的操作系统上编译arm32架构的操作系统上运行的程序或者在x86_64架构的操作系统上编译arm64架构的操作系统上运行的程序。

    下面是x86_64架构下的OpenWrt交叉编译过程:

    1. 在OpenWrt官网下载对应的toolchain工具包,并解压缩到/home/xxx/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/目录

    2.后续使用root账号操作
    sudo su
    [输入root账号密码]

    3.在终端中运行以下命令设置环境变量的:
    PATH=$PATH:/home/xxx/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/bin
    export PATH
    STAGING_DIR=/home/xxx/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl
    export STAGING_DIR

    4.下载OpenWrt源码:
    git clone https://git.openwrt.org/openwrt/openwrt.git
    git checkout v23.05.5

    5.安装需要的软件包
    cd openwrt
    ./scripts/feeds update -a
    cd ../
    mkdir host
    mkdir build
    ./scripts/feeds install -a

    6.开始openwrt的编译配置(进入视频上的熟悉界面-编译配置界面)
    make menuconfig

界面如下

 .config - OpenWrt Configuration
 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ┌───────────────────────────────────────────────────── OpenWrt Configuration ──────────────────────────────────────────────────────┐
  │  Arrow keys navigate the menu.  <Enter> selects submenus ---> (or empty submenus ----).  Highlighted letters are hotkeys.        │  
  │  Pressing <Y> includes, <N> excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> for Search.         │  
  │  Legend: [*] built-in  [ ] excluded  <M> module  < > module capable                                                              │  
  │                                                                                                                                  │  
  │ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │  
  │ │                                Target System (Atheros ATH79)  --->                                                           │ │  
  │ │                                Subtarget (Generic)  --->                                                                     │ │  
  │ │                                Target Profile (8devices Carambola2)  --->                                                    │ │  
  │ │                                Target Images  --->                                                                           │ │  
  │ │                            [ ] Enable experimental features by default (NEW)                                                 │ │  
  │ │                                Global build settings  --->                                                                   │ │  
  │ │                            [ ] Advanced configuration options (for developers) (NEW)  ----                                   │ │  
  │ │                            [ ] Build the OpenWrt Image Builder (NEW)                                                         │ │  
  │ │                            [ ] Build the OpenWrt SDK (NEW)                                                                   │ │  
  │ │                            [ ] Package the OpenWrt-based Toolchain (NEW)                                                     │ │  
  │ └────────────────────────────v(+)──────────────────────────────────────────────────────────────────────────────────────────────┘ │  
  ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤  
  │                                     <Select>    < Exit >    < Help >    < Save >    < Load >                                     │  
  └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘  
    
    7.配置过程中指定目标硬件主板以及其他配置项后Save、Exit

    8.Exit后,开始编译
    FORCE_UNSAFE_CONFIGURE=1
    export FORCE_UNSAFE_CONFIGURE
    make -j4 V=s

    9.make后,系统会生成您勾选的镜像文件

    10.用烧写工具烧写到SD卡,将SD卡插入树莓派4B主板,即可让树莓派4B变成OpenWrt路由器。

    musl/gdb-12.1/gdb/data-directory/python': No such file or directory的问题的解决:
    ln -s -f /usr/local/bin/python3 /usr/local/bin/python

    附注:
    什么是eabi?为什么要使用交叉编译?
    eabi就是Embeded Application Binary Interface,也就是嵌入式应用程序二进制接口。和STM32一样,OpenWrt用的也是eabi,那个toolchain的gcc也就是arm版的交叉编译eabi。使用eabi和交叉编译,是因为,stm32的简单芯片不具备编译环境或者芯片上的编译环境的速度比不上PC机上的编译速度,比如:arm64的树莓派4B性能没有x86_64的PC机性能高。
«
--Alex.Zhang
--www.v-signon.com Learningers Co-Encouraged
Back
Personal Art: www.up-task.com Unit: Individual
中文 Русский 京ICP备19038994号-2
If the content on this website infringes upon your any rights, please contact me at 1307776259@qq.com for removal