移植linux 5.5.3到stm32f429-discovery板资料
本帖最后由 bbstr 于 2020-4-15 13:51 编辑前言
选择stm32f429-discovery板来移植linux,主要是考虑到st的mcu在世界范围内实在是太火了,外设资源非常丰富,且429出来很多年,加上主线linux对stm32f4 f7的支持,可以很容易就在f4,f7系列上应用起丰富的linux各种软件资源,产品方案公司只用关心应用层的设计。
目前这个移植已完成的工作
1 u-boot+linux+initramfs可以从内部flash启动并运行。由于linux内核编译出来已超过3M字节,内部flash只有2M无法使用xip功能,因此采用zImage加载到sdram 0x90008000地址运行,整体效率相对xip会有一定折扣,比如3wire-spi模式,读取lcd的id时,会出现overrun。
2 spi+ili9341+tinydrm+fbdev可以工作,lcd上能看到启动日志
3 stmpe811,l3gd20传感器的驱动加入内核,驱动可识别外设。但未验证
下一步
1 将ili9341驱动移入panel下,可以和ltdc对接。提升屏幕刷新速率,支持osd
2 测试dcmi+ov5640,可使用v4l2将视频数据显示到ili9341(可能sdram和内部flash不够)
3 移植linux到stm32f469-discovery
玩linux最大的乐趣不在于将主线的代码做修改移植到自己的板子上,而是发现主线代码的bug并修改。
由于当时是在ubuntu环境下随笔记录,没有中文输入法,就用了英文, 见谅.
开机视频
crosscompile toolchain
get compile tool from
https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2?revision=108bd959-44bd-4619-9c19-26187abf5225&la=en&hash=E788CE92E5DFD64B2A8C246BBA91A249CB8E2D2D
u-boot configure, compile
get u-boot code from https://gitlab.denx.de/u-boot/u-boot
change point:
1 Makefile
line 37 #undefine MK_ARCH
2 open CONFIG_ENV_IS_NOWHERE=y , to save 0x08040000 128k flash memory, we don't need runtime env save feature.
3 open FIT to support itb file load
CONFIG_FIT=y
CONFIG_FIT_EXTERNAL_OFFSET=0x0
CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
4 update cmdline
#define CONFIG_BOOTCOMMAND \
"run bootcmd_ramfs"
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootargs_ramfs=console=ttySTM0,115200 root=/dev/ram rdinit=/linuxrc\0" \
"bootcmd_ramfs=setenv bootargs ${bootargs_ramfs};" \
"bootm 0x08040000\0"
configure step :
make O=../u-boot-build ARCH=arm CROSS_COMPILE=arm-none-eabi- stm32f429-discovery_defconfig
make O=../u-boot-build
sudo apt-get install openocd
openocd -f openocd.cfg -c flash_uboot
openocd configure file, openocd.cfg
source
init
proc flash_uboot {} {
reset halt
flash write_image erase u-boot-build/u-boot-dtb.bin 0x08000000
reset init
shutdown
}
proc flash_full {} {
reset halt
flash write_image erase kernel.itb 0x08040000
reset init
shutdown
}
its configure file, kernel.its
/*
* Simple U-Boot uImage source file containing a single kernel and FDT blob
*/
/dts-v1/;
/ {
description = "Simple image with single Linux kernel and FDT blob";
#address-cells = <1>;
images {
kernel {
description = "Vanilla Linux kernel";
data = /incbin/("./kernel-build/arch/arm/boot/zImage");
type = "kernel";
arch = "arm";
os = "linux";
compression = "none";
load = <0x90008000>;
entry = <0x90008000>;
hash-1 {
algo = "crc32";
};
hash-2 {
algo = "sha1";
};
};
fdt-1 {
description = "Flattened Device Tree blob";
data = /incbin/("./kernel-build/arch/arm/boot/dts/stm32f429-disco.dtb");
type = "flat_dt";
arch = "arm";
compression = "none";
hash-1 {
algo = "crc32";
};
hash-2 {
algo = "sha1";
};
};
};
configurations {
default = "conf-1";
conf-1 {
description = "Boot Linux kernel with FDT blob";
kernel = "kernel";
fdt = "fdt-1";
};
};
};
linux configure, compile
get kernel code from https://www.kernel.org/
change point:
1 arch/arm/boot/dts/stm32f4-pinctrl.dtsi add i2c3 pin mux
i2c3_pins: i2c3@0 {
pins {
pinmux = <STM32_PINMUX('C', 9, AF4)>, /* I2C3_SDA */
<STM32_PINMUX('A', 8, AF4)>; /* I2C3_SCL */
bias-disable;
drive-open-drain;
slew-rate = <3>;
};
};
2 arch/arm/boot/dts/stm32f429-disco.dts add stmpe811 touchscreen dts support
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "3P3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
&i2c3 {
pinctrl-names = "default";
pinctrl-0 = <&i2c3_pins>;
status = "okay";
touch: stmpe811@41 {
compatible = "st,stmpe811";
reg = <0x41>;
interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
interrupt-parent = <&gpioa>;
vio = <®_3p3v>;
vcc = <®_3p3v>;
stmpe_touchscreen {
compatible = "st,stmpe-ts";
st,sample-time = <4>;
st,mod-12b = <1>;
st,ref-sel = <0>;
st,adc-freq = <1>;
st,ave-ctrl = <1>;
st,touch-det-delay = <2>;
st,settling = <2>;
st,fraction-z = <7>;
st,i-drive = <1>;
};
};
};
3 arch/arm/boot/dts/stm32f429.dtsi add i2c3 reg , clk, interrupts
i2c3: i2c@40005c00 {
compatible = "st,stm32f4-i2c";
reg = <0x40005c00 0x400>;
interrupts = <72>,
<73>;
resets = <&rcc STM32F4_APB1_RESET(I2C3)>;
clocks = <&rcc 0 STM32F4_APB1_CLOCK(I2C3)>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
4 arch/arm/boot/dts/stm32f4-pinctrl.dtsi add ltdc, spi5 pin mux
ltdc_pins_disco: ltdc@1 {
pins {
pinmux =
<STM32_PINMUX('C', 6,AF14)>,/* LCD_HSYNC */
<STM32_PINMUX('A', 4,AF14)>,/* LCD_VSYNC */
<STM32_PINMUX('G', 7,AF14)>,/* LCD_CLK */
<STM32_PINMUX('C', 10, AF14)>,/* LCD_R2 */
<STM32_PINMUX('B', 0,AF9)>, /* LCD_R3 */
<STM32_PINMUX('A', 11, AF14)>,/* LCD_R4 */
<STM32_PINMUX('A', 12, AF14)>,/* LCD_R5 */
<STM32_PINMUX('B', 1,AF9)>, /* LCD_R6*/
<STM32_PINMUX('G', 6,AF14)>,/* LCD_R7 */
<STM32_PINMUX('A', 6,AF14)>,/* LCD_G2 */
<STM32_PINMUX('G', 10, AF9)>, /* LCD_G3 */
<STM32_PINMUX('B', 10, AF14)>,/* LCD_G4 */
<STM32_PINMUX('D', 6,AF14)>,/* LCD_B2 */
<STM32_PINMUX('G', 11, AF14)>,/* LCD_B3*/
<STM32_PINMUX('B', 11, AF14)>,/* LCD_G5 */
<STM32_PINMUX('C', 7,AF14)>,/* LCD_G6 */
<STM32_PINMUX('D', 3,AF14)>,/* LCD_G7 */
<STM32_PINMUX('G', 12, AF9)>, /* LCD_B4 */
<STM32_PINMUX('A', 3,AF14)>,/* LCD_B5 */
<STM32_PINMUX('B', 8,AF14)>,/* LCD_B6 */
<STM32_PINMUX('B', 9,AF14)>,/* LCD_B7 */
<STM32_PINMUX('F', 10, AF14)>;/* LCD_DE */
slew-rate = <2>;
};
};
spi5_pins: spi5@0 {
pins1 {
pinmux =
<STM32_PINMUX('F', 7, AF5)>, /* SPI5_CLK */
<STM32_PINMUX('F', 9, AF5)>; /* SPI5_MOSI */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('F', 8, AF5)>; /* SPI5_MISO */
bias-disable;
};
};
5 arch/arm/boot/dts/stm32f429-disco.dts add l3gd20, ili9341 dts
panel_backlight:backlight {
compatible = "gpio-backlight";
gpios = <&gpiog 2 1>;
default-on;
status = "okay";
};
/*bak: actually, ili9341 don't need gpio-bakclight dts node, just add here make tinydrm driver happy*/
&spi5 {
status = "okay";
pinctrl-0 = <&spi5_pins>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
cs-gpios = <&gpioc 1 GPIO_ACTIVE_LOW>,<&gpioc 2 GPIO_ACTIVE_LOW>;
dmas = <&dma2 3 2 0x400 0x0>,
<&dma2 4 2 0x400 0x0>;
dma-names = "rx", "tx";
l3gd20: l3gd20@0 {
compatible = "st,l3gd20-gyro";
spi-max-frequency = <10000000>;
st,drdy-int-pin = <2>;
interrupt-parent = <&gpioa>;
interrupts = <1 IRQ_TYPE_EDGE_RISING>,
<2 IRQ_TYPE_EDGE_RISING>;
reg = <0>;
vddio = <®_3p3v>;
vdd = <®_3p3v>;
};
display: display@1{
compatible = "adafruit,yx240qv29", "ilitek,ili9341";
reg = <1>;
spi-3wire;
spi-max-frequency = <10000000>;
dc = <&gpiod 13 1>;
rotation = <90>;
backlight = <&panel_backlight>;
};
};
6 drivers/spi/spi-stm32.c
7 kernel config change
make O=../kernel-build stm32_defconfig
make O=../kernel-build LOADADDR=0x90008000 zImage dtbs
stm32 2m flash layout
0x08000000 - 0x0803fffff u-boot-dtb.bin
0x08040000 - 0x08200000 kernel.itb
initramfs filesystem
get filesystem from https://elinux.org/File:Stm32_mini_rootfs.cpio.bz2
1 bzip2 -d Stm32_mini_rootfs.cpio.bz2
2 mkdir rootfs
3 cd rootfs/
4 sudo cpio -idmv < ../Stm32_mini_rootfs.cpio
5 paste below strings to init
#!/bin/sh
# devtmpfs does not get automounted for initramfs
/bin/mount -t devtmpfs devtmpfs /dev
exec 0</dev/console
exec 1>/dev/console
exec 2>/dev/console
exec /sbin/init $
use mkimage to create kernel.itb, include zImage with initramfs,dtb
./u-boot-build/tools/mkimage -f kernel.its kernel.itb
use stlink-utils to flash kernel.itb to 0x08040000
TODO: as memory limition, there is no more rom to add user app to verify touch-screen, geting l3gd20 gyro data, drm-utils,will do it after get large memory board. currently just verify the driver register to system.
Log:
U-Boot 2020.04-rc2-gdc67a56-dirty (Feb 26 2020 - 17:13:10 +0800)
DRAM:8 MiB
Flash: 2 MiB
In: serial@40011000
Out: serial@40011000
Err: serial@40011000
Hit any key to stop autoboot:0
## Loading kernel from FIT Image at 08040000 ...
Using 'conf-1' configuration
Trying 'kernel' kernel subimage
Description:Vanilla Linux kernel
Type: Kernel Image
Compression:uncompressed
Data Start: 0x080400e8
Data Size: 1762256 Bytes = 1.7 MiB
Architecture: ARM
OS: Linux
Load Address: 0x90008000
Entry Point:0x90008000
Hash algo: crc32
Hash value: 59603570
Hash algo: sha1
Hash value: 84ebfe63331e4d53b0d1e9c9bd308b5082711ca9
Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 08040000 ...
Using 'conf-1' configuration
Trying 'fdt-1' fdt subimage
Description:Flattened Device Tree blob
Type: Flat Device Tree
Compression:uncompressed
Data Start: 0x081ee5e0
Data Size: 19800 Bytes = 19.3 KiB
Architecture: ARM
Hash algo: crc32
Hash value: 87ea4d4c
Hash algo: sha1
Hash value: 820dc759459a2c7f7dfe641093f9e7c19dacbcea
Verifying Hash Integrity ... crc32+ sha1+ OK
Booting using the fdt blob at 0x81ee5e0
Loading Kernel Image
Loading Device Tree to 905b4000, end 905bbd57 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.5.3-gfa93efe-dirty (th@th-Latitude-XT3) (gcc version 9.2.1 20191025 (release) (GNU Tools for Arm Embedded Processors 9-2019-q4-major)) #3 PREEMPT Wed Feb 26 16:50:54 CST 2020
[ 0.000000] CPU: ARMv7-M revision 1 (ARMv7M), cr=00000000
[ 0.000000] CPU: unknown data cache, unknown instruction cache
[ 0.000000] OF: fdt: Machine model: STMicroelectronics STM32F429i-DISCO board
[ 0.000000] On node 0 totalpages: 2048
[ 0.000000] Normal zone: 16 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 2048 pages, LIFO batch:0
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: 0
[ 0.000000] Built 1 zonelists, mobility grouping off.Total pages: 2032
[ 0.000000] Kernel command line: console=ttySTM0,115200 root=/dev/ram rdinit=/linuxrc loglevel=8 console=/dev/fb0 fbcon=map:0
[ 0.000000] Dentry cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.000000] mem auto-init: stackff, heap allocff, heap freeff
[ 0.000000] Memory: 5072K/8192K available (1671K kernel code, 146K rwdata, 680K rodata, 216K init, 107K bss, 3120K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000]Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] /soc/interrupt-controller@40013c00: bank0
[ 0.000000] random: get_random_bytes called from start_kernel+0x1b3/0x320 with crng_init=0
[ 0.000000] clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 331816030 ns
[ 0.000000] ARM System timer initialized as clocksource
[ 0.000237] sched_clock: 32 bits at 90MHz, resolution 11ns, wraps every 23860929530ns
[ 0.000498] timer@40000c00: STM32 sched_clock registered
[ 0.000955] Switching to timer-based delay loop, resolution 11ns
[ 0.001211] timer@40000c00: STM32 delay timer registered
[ 0.001733] clocksource: timer@40000c00: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 21236227187 ns
[ 0.002316] /soc/timer@40000c00: STM32 clockevent driver initialized (32 bits)
[ 0.008419] Calibrating delay loop (skipped), value calculated using timer frequency.. 180.00 BogoMIPS (lpj=900000)
[ 0.008890] pid_max: default: 4096 minimum: 301
[ 0.012786] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.013309] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.040257] rcu: Hierarchical SRCU implementation.
[ 0.045459] devtmpfs: initialized
[ 0.263198] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.263593] pinctrl core: initialized pinctrl subsystem
[ 0.454026] stm32f429-pinctrl soc:pin-controller: No package detected, use default one
[ 0.468984] stm32f429-pinctrl soc:pin-controller: GPIOA bank added
[ 0.475184] stm32f429-pinctrl soc:pin-controller: GPIOB bank added
[ 0.481153] stm32f429-pinctrl soc:pin-controller: GPIOC bank added
[ 0.487272] stm32f429-pinctrl soc:pin-controller: GPIOD bank added
[ 0.493313] stm32f429-pinctrl soc:pin-controller: GPIOE bank added
[ 0.499418] stm32f429-pinctrl soc:pin-controller: GPIOF bank added
[ 0.505540] stm32f429-pinctrl soc:pin-controller: GPIOG bank added
[ 0.511497] stm32f429-pinctrl soc:pin-controller: GPIOH bank added
[ 0.517922] stm32f429-pinctrl soc:pin-controller: GPIOI bank added
[ 0.523809] stm32f429-pinctrl soc:pin-controller: GPIOJ bank added
[ 0.529952] stm32f429-pinctrl soc:pin-controller: GPIOK bank added
[ 0.530599] stm32f429-pinctrl soc:pin-controller: Pinctrl STM32 initialized
[ 0.718086] stm32-dma 40026000.dma-controller: STM32 DMA driver registered
[ 0.747631] stm32-dma 40026400.dma-controller: STM32 DMA driver registered
[ 0.785824] clocksource: Switched to clocksource timer@40000c00
[ 1.385760] workingset: timestamp_bits=30 max_order=11 bucket_order=0
[ 1.572198] io scheduler mq-deadline registered
[ 1.572446] io scheduler kyber registered
[ 1.595395] STM32 USART driver initialized
[ 1.601590] 40011000.serial: ttySTM0 at MMIO 0x40011000 (irq = 34, base_baud = 5625000) is a stm32-usart
[ 2.015282] printk: console enabled
[ 2.085487] Initialized ili9341 1.0.0 20180514 for spi0.1 on minor 0
[ 2.117646] ili9341 spi0.1: fb0: ili9341drmfb frame buffer device
[ 2.126249] spi_stm32 40015000.spi: driver initialized
[ 2.152951] stm32_rtc 40002800.rtc: registered as rtc0
[ 2.160552] stm32_rtc 40002800.rtc: Date/Time must be initialized
[ 2.170391] i2c /dev entries driver
[ 2.195837] stmpe-i2c 0-0041: stmpe811 detected, chip id: 0x811
[ 2.236797] random: fast init done
[ 2.251960] stmpe-ts stmpe-ts: DMA mask not set
[ 2.281125] input: stmpe-ts as /devices/platform/soc/40005c00.i2c/i2c-0/0-0041/stmpe-ts/input/input0
[ 2.293532] stm32f4-i2c 40005c00.i2c: STM32F4 I2C driver registered
[ 2.339105] st-gyro-spi spi0.0: spi0.0 supply vdd not found, using dummy regulator
[ 2.347726] st-gyro-spi spi0.0: spi0.0 supply vddio not found, using dummy regulator
[ 2.371508] iio iio:device0: interrupts on the rising edge
[ 2.395188] iio iio:device0: registered gyroscope l3gd20
[ 2.423991] input: gpio_keys as /devices/platform/gpio_keys/input/input1
[ 2.434153] stm32_rtc 40002800.rtc: setting system clock to 2000-01-01T00:55:40 UTC (946688140)
[ 2.480310] Freeing unused kernel memory: 216K
[ 2.484813] This architecture does not have kernel memory protection.
[ 2.491595] Run /linuxrc as init process
/ # free
total used free shared buffers cached
Mem: 5288 3644 1644 0 0 648
-/+ buffers/cache: 2996 2292
/ # random: crng init done
/ # ls /sys/class
backlight drm input mmc_host tty
bdi graphics leds regulator wakeup
block i2c-adaptermem rtc watchdog
dma i2c-dev misc spi_master
/ # ls /sys/class/drm
card0 card0-SPI-1version
/ # ls -l /sys/class/drm
lrwxrwxrwx 1 0 0 0 Jan1 01:23 card0 -> ../../devices/platform/soc/40015000.spi/spi_master/spi0/spi0.1/drm/card0
lrwxrwxrwx 1 0 0 0 Jan1 01:23 card0-SPI-1 -> ../../devices/platform/soc/40015000.spi/spi_master/spi0/spi0.1/drm/card0/card0-SPI-1
-r--r--r-- 1 0 0 4096 Jan1 01:23 version
/ # ls -l /sys/class/graphics
lrwxrwxrwx 1 0 0 0 Jan1 01:24 fb0 -> ../../devices/platform/soc/40015000.spi/spi_master/spi0/spi0.1/graphics/fb0
/ # ls -l /sys/class/input
lrwxrwxrwx 1 0 0 0 Jan1 01:24 input0 -> ../../devices/platform/soc/40005c00.i2c/i2c-0/0-0041/stmpe-ts/input/input0
lrwxrwxrwx 1 0 0 0 Jan1 01:24 input1 -> ../../devices/platform/gpio_keys/input/input1
/ # ls -l /sys/class/spi_master
lrwxrwxrwx 1 0 0 0 Jan1 01:24 spi0 -> ../../devices/platform/soc/40015000.spi/spi_master/spi0
/ # ls -l /sys/class/spi_master/spi0
lrwxrwxrwx 1 0 0 0 Jan1 01:24 /sys/class/spi_master/spi0 -> ../../devices/platform/soc/40015000.spi/spi_master/spi0
/ # ls -l /sys/class/spi_master/spi0/
lrwxrwxrwx 1 0 0 0 Jan1 01:24 device -> ../../../40015000.spi
lrwxrwxrwx 1 0 0 0 Jan1 01:24 of_node -> ../../../../../../firmware/devicetree/base/soc/spi@40015000
drwxr-xr-x 2 0 0 0 Jan1 01:24 power
drwxr-xr-x 6 0 0 0 Jan1 01:24 spi0.0
drwxr-xr-x 6 0 0 0 Jan1 01:24 spi0.1
drwxr-xr-x 2 0 0 0 Jan1 01:24 statistics
lrwxrwxrwx 1 0 0 0 Jan1 01:24 subsystem -> ../../../../../../class/spi_master
-rw-r--r-- 1 0 0 4096 Jan1 01:24 uevent
/ # ls -l /sys/class/spi_master/spi0/spi0.0
lrwxrwxrwx 1 0 0 0 Jan1 01:25 driver -> ../../../../../../../bus/spi/drivers/st-gyro-spi
-rw-r--r-- 1 0 0 4096 Jan1 01:25 driver_override
drwxr-xr-x 6 0 0 0 Jan1 01:25 iio:device0
-r--r--r-- 1 0 0 4096 Jan1 01:25 modalias
lrwxrwxrwx 1 0 0 0 Jan1 01:25 of_node -> ../../../../../../../firmware/devicetree/base/soc/spi@40015000/l3gd20@0
drwxr-xr-x 2 0 0 0 Jan1 01:25 power
drwxr-xr-x 2 0 0 0 Jan1 01:25 statistics
lrwxrwxrwx 1 0 0 0 Jan1 01:25 subsystem -> ../../../../../../../bus/spi
drwxr-xr-x 3 0 0 0 Jan1 01:25 trigger0
-rw-r--r-- 1 0 0 4096 Jan1 01:25 uevent
/ # ls -l /sys/class/spi_master/spi0/spi0.1
lrwxrwxrwx 1 0 0 0 Jan1 01:25 driver -> ../../../../../../../bus/spi/drivers/ili9341
-rw-r--r-- 1 0 0 4096 Jan1 01:25 driver_override
drwxr-xr-x 3 0 0 0 Jan1 01:25 drm
drwxr-xr-x 3 0 0 0 Jan1 01:25 graphics
-r--r--r-- 1 0 0 4096 Jan1 01:25 modalias
lrwxrwxrwx 1 0 0 0 Jan1 01:25 of_node -> ../../../../../../../firmware/devicetree/base/soc/spi@40015000/display@1
drwxr-xr-x 2 0 0 0 Jan1 01:25 power
drwxr-xr-x 2 0 0 0 Jan1 01:25 statistics
lrwxrwxrwx 1 0 0 0 Jan1 01:25 subsystem -> ../../../../../../../bus/spi
-rw-r--r-- 1 0 0 4096 Jan1 01:25 uevent
/ # free
total used free shared buffers cached
Mem: 5288 3680 1608 0 0 648
-/+ buffers/cache: 3032 2256
/ # {:lol:}牛,没有MMU怎么跑? powerk6 发表于 2020-4-15 11:55
牛,没有MMU怎么跑?
主线linux已支持没有mmu的arm平台,抓紧时间投入linux阵营啊 {:lol:} 还不如用stm32mp系列的 cloudxxcloud 发表于 2020-4-15 12:20
还不如用stm32mp系列的
等有板子了,玩玩看 感觉现在全志的h2还有其他几家的mpu都非常便宜了,还有nxp,ti等老牌的厂商。 st的不一定还能取得那么大的mpu市场 不明觉厉,吃瓜吃瓜,5.5.3,这版本是真新~ sdram多大 FireBrain 发表于 2020-4-15 13:53
sdram多大
sdram 8Mbyte
flash 2Mbyte heimareed 发表于 2020-4-15 13:43
不明觉厉,吃瓜吃瓜,5.5.3,这版本是真新~
确实,比我的ubuntu的linux内核都新 关注一下 楼主,安卓怎么编译进去? stm32f429没有icache和dcache,放在sdram里运行会损失很大的性能;non-mmu至少从cortex-m7起步比较好。
随便做一下实验,裸奔ARM9是飞快的;但是关闭icache和dcache之后,那个性能乌龟一样。cache太重要的。 学习了,3M 的程序不能移到外部flash是否一样效果? polarbear 发表于 2020-4-15 15:48
楼主,安卓怎么编译进去?
兄台说笑了,哈哈 armstrong 发表于 2020-4-15 17:24
stm32f429没有icache和dcache,放在sdram里运行会损失很大的性能;non-mmu至少从cortex-m7起步比较好。
随 ...
确实跑在sdram里很慢,对于一些实时性要求不高的应用还行 回头有h7平台了,移一个对比看看 小溪 发表于 2020-4-15 18:59
学习了,3M 的程序不能移到外部flash是否一样效果?
stm32f429-disco上没有外部flash,对于一些有qspi flash的板子且支持xip的可以放到外部,不知道是不是比sdram快一点 linux 这几年要在国内井喷了 {:lol:}楼主可以尝试移植到STM32H750VB不,我可以提供一个自己做的开发板,带了QSPI FLASH,可以跑程序,带了PSRAM,SPI FLASH,SD CARD,要是有需要我可以再做个SDRAM的扩展 NIU.
内核到5.XX了。
liyuncan 发表于 2020-4-15 20:19
linux 这几年要在国内井喷了
为什么会井喷呢,嵌入式LINUX的应用场景还是比较有限的,低端的裸奔,高端的安卓,LINUX在工控等领域还稍微有些应用,不至于井喷吧~加上入门门槛高,做的人也没那么多 liyuncan 发表于 2020-4-15 20:19
linux 这几年要在国内井喷了
确实这几年搞linux的人,比10年前多多了,各种派,各种视频监控,机器人,物联网网关都用到了linux 神经猫 发表于 2020-4-15 23:02
楼主可以尝试移植到STM32H750VB不,我可以提供一个自己做的开发板,带了QSPI FLASH,可以跑程序,带 ...
好啊,多谢多谢。qspi拿来xip,psram是立即寻址的并行总线接口吧?多少M的,现在这个429-disco只有8m,把内核跑进去后,仅剩1M多,内部flash仅剩100来k,几乎干不了啥了 shuiluo2 发表于 2020-4-16 08:54
为什么会井喷呢,嵌入式LINUX的应用场景还是比较有限的,低端的裸奔,高端的安卓,LINUX在工控等领域还稍 ...
内核版本虽然很新,但是相对以前2.x的内核,移植门槛是大大降低了,好多工作已经被开源社区给做的很好了,拿来几乎就是改改dts,menuconfig的,涉及到driver部分的修改比较少 很厉害啊 楼主厉害,可否出一个移植教程,虽然介绍以及很详细了,我也看了好几遍,也许我基础差,没能看明白如何修改移植uboot及内核文件系统编译出烧写文件,测试运行一下,来提高在STM32上运行linux的兴趣,想直接烧写看看也进行不了。 小溪 发表于 2020-4-17 09:37
楼主厉害,可否出一个移植教程,虽然介绍以及很详细了,我也看了好几遍,也许我基础差,没能看明白如何修改 ...
烧写帖子里的 stm32f429-disco-linux-5.5.3.zip到0x08000000地址就好了,这个是将u-boot和kernel.itb(dts,zImage,initramfs)打包到一起的
不太擅长教学,如果你对帖子里哪部分不太了解,可以在这里回帖,我尽量以我的知识储备解答。
正好也练练表达能力,说不定哪天失业了转行培训业,哈哈 楼主这个是针对429做的,如果换一个别的mcu的话,有多少工作量?比如gd32f450和429性能相当但是并不能pin2pin的mcu Mark,手上有这个板子有空试试 STM32H750VB 楼主能否出一个STM32H750的移植教程 在buildrooot里也看到有429,像楼主这样一步一步的移植要些功底的。在此感谢楼主分享学习心得。 bbstr 发表于 2020-4-16 10:49
好啊,多谢多谢。qspi拿来xip,psram是立即寻址的并行总线接口吧?多少M的,现在这个429-disco只有8m,把 ...
PSRAM是SPI的,内部是1M 的sram,如果要即使寻址,还是得做个FMC得扩展 神经猫 发表于 2020-4-19 12:06
PSRAM是SPI的,内部是1M 的sram,如果要即使寻址,还是得做个FMC得扩展
那这个psram就跑不了linux了,很多代码里需要立即寻址的 这种ram适合虚拟一个块设备来给app用 血刃修罗 发表于 2020-4-18 10:25
楼主能否出一个STM32H750的移植教程
暂时还没有h750系列的板子,等把429的ltdc的dpi驱动搞完后,内存还足够打算搞搞dcmi驱动ov5640,之后再弄stm32f469-disco板 tim4146 发表于 2020-4-17 22:10
楼主这个是针对429做的,如果换一个别的mcu的话,有多少工作量?比如gd32f450和429性能相当但是并不能pin2p ...
如果只是ip核地址分布差异,管脚的定义差异都还好 改改dts,找找reg定义部分改改都差不多了
reg寄存器定义差太多,就要涉及改各个驱动了 楼主出个编译内核的教程?编译几次都错误。。。{:mad:}{:mad:}{:mad:} litop 发表于 2020-4-20 11:59
楼主出个编译内核的教程?编译几次都错误。。。
报出下编译错误打印 buildroot 它不香吗{:lol:} 本帖最后由 小溪 于 2020-4-20 18:04 编辑
有空来测试验证,编译uboot出错,信息如下:
www@ubuntu:~/www/u-boot-master$ make
UPD include/generated/version_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CC lib/asm-offsets.s
gcc: error: unrecognized command line option ‘-mno-unaligned-access’; did you mean ‘-Wno-aligned-new’?
Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
make: *** Error 1
Makefile:1830: recipe for target 'prepare0' failed
make: *** Error 2
www@ubuntu:~/www/u-boot-master$
下面这几个步骤,还不清楚什么时候操作:
第1步,很清楚修改makefile,交叉编译工具已经安装好,可以执行make stm32f429-discovery_defconfig,其余步骤是生成配置文件后修改吗?
2 open CONFIG_ENV_IS_NOWHERE=y , to save 0x08040000 128k flash memory, we don't need runtime env save feature.
3 open FIT to support itb file load
CONFIG_FIT=y
CONFIG_FIT_EXTERNAL_OFFSET=0x0
CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
4 update cmdline
#define CONFIG_BOOTCOMMAND \
"run bootcmd_ramfs"
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootargs_ramfs=console=ttySTM0,115200 root=/dev/ram rdinit=/linuxrc\0" \
"bootcmd_ramfs=setenv bootargs ${bootargs_ramfs};" \
"bootm 0x08040000\0" 小溪 发表于 2020-4-20 17:46
有空来测试验证,编译uboot出错,信息如下:
www@ubuntu:~/www/u-boot-master$ make
UPD include/gen ...
确认几点
1 gcc工具是否下载的 https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2?revision=108bd959-44bd-4619-9c19-26187abf5225&la=en&hash=E788CE92E5DFD64B2A8C246BBA91A249CB8E2D2D
2 编译前先做个配置,
export PATH=xxxx:$PATH
其中xxx是下载gcc工具解压后从/到bin的全路径,然后
make O=../u-boot-build ARCH=arm CROSS_COMPILE=arm-none-eabi- stm32f429-discovery_defconfig
3 最后做
make O=../u-boot-build
bbstr 发表于 2020-4-20 10:44
那这个psram就跑不了linux了,很多代码里需要立即寻址的 这种ram适合虚拟一个块设备来给app用 ...
还好我设计的时候就把FMC扩展的都预留出来了,所以还是得有FMC扩展板,内部1M还是分区块的,不适合给Linux 神经猫 发表于 2020-4-21 09:28
还好我设计的时候就把FMC扩展的都预留出来了,所以还是得有FMC扩展板,内部1M还是分区块的,不适合给Linu ...
嗯,内部1M也是远远不够用的
请问下楼主,,这个错误怎么解决??谢谢 litop 发表于 2020-4-21 20:55
请问下楼主,,这个错误怎么解决??谢谢
把CONFIG_XIP_KERNEL从内核配置里去掉,参考我给的那个config Thank you !!! 收藏下先,看能不能把手头的1052跑个linux出来 lusson 发表于 2020-4-22 11:37
收藏下先,看能不能把手头的1052跑个linux出来
1052主线目前好像还不支持,搞出来就牛叉了 楼主可否将修改后的Uboot和linux kernel源码打包上来,一楼提供的烧写文件经测试没有问题,如视频中一样运行,楼主对Uboot运行流程非常熟悉,而且将最新版本的5.5.3内核移植可用,厉害了。 zImage加载到sdram 0x90008000地址运行,不知道楼主这个内存地址是怎么得来的?
F429i板子上,SDRAM是8MB容量的,接在Bank2,所以地址是 0xD0000000 开始的8MB范围 本帖最后由 小溪 于 2020-5-4 16:38 编辑
这么好的学习帖不能沉下去,继续关注,顶一下!目前uboot 编译顺利,但是内核含文件系统编译后和uboot 合并后烧写后启动不成功,目前看楼主给的烧写文件bootm 地址与修改说明中08040000不一致,是0802e000 ,不过这个不是我启动不了问题原因,应该是配置内核编译问题,我使用的是5.6.5 厉害了,楼主,支持一个。 看得我又又想去学LINUX了{:mad:} 这个要看下,刚好下半年有空 这是把嘉陵的发动机(无cache,无MMU)来拉豪华房车,最不济也要找个QQ发动机(H7,虽然也无MMU)来拉啊 linux程序能在Windows下直接编译么?如果不能像用keil那样简单,还不如就用keil加rtos。 膜拜大神 多谢分享,有空搞一搞。 谨慎搞这个,有时间还是玩有mmu片子以后SOC成本越来越低这个是趋势。 厉害,大牛 赞一个! 没有mmu,常规的linux应用都需要重新编译吧,好像生态还是不好建设 bbstr 发表于 2020-4-17 11:01
烧写帖子里的 stm32f429-disco-linux-5.5.3.zip到0x08000000地址就好了,这个是将u-boot和kernel.itb(d ...
(引用自26楼)
实际测试stm32f429-disco-linux-5.5.3.zip kernel.itb放在地址 0x0802e000处, 请教一下uboot.bin 和kernel.dtb 如何打包在一个bin里面(stm32f429-disco-linux-5.5.3.bin)用的什么工具? 建议做h750 或h7b0,或者h723. M7核加大内存才能发挥出linux的app生态优势。否则就是一个壳而已。
页:
[1]