楼主是想用 kgdb 来调试内核,但对 dts 不熟悉不知道怎么启用其他的 uart ,求大佬指点。
1
zzz22333 2023-04-28 10:09:11 +08:00
我现在是用的 jlink+openocd 来调试的
|
2
LXGMAX 2023-04-28 11:19:10 +08:00
在`/boot/config.txt`里面打开就行
|
3
wniming OP @LXGMAX 感谢回复,用树莓派官方的 os 和 fedora 官方的 os 确实是可以,但我用不了。
首先我不用树莓派官方的 os ,其次我用的 fedora 的内核是直接让 u-boot 或让树莓派自己的固件去加载的,而不是 fedora 官方镜像那种 u-boot 加载 grub ,再让 grub 加载的,fedora 的官方镜像启动一次要好几分钟,我自己编译的内核不用 initramfs ,自己写 init 脚本,从上电到能 ssh 登录就 11 秒,所以我不想用 fedora 官方镜像,想找一个办法在我目前的系统上启用其它的串口。 |
4
wniming OP 就这一个问题我整了 2 天没搞定,难受死了,树莓派性能太差了,稍微修改一下再重试都要等好久
|
5
LXGMAX 2023-04-28 15:20:02 +08:00
@wniming 内核改下 dts 参考: https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
然后加入 ``` &uart3 { status = "okay"; }; ``` 要用哪个就启用哪个 |
6
wniming OP @LXGMAX 感谢回复,内核的这个 dts 实际是启动不了树莓派 4b 的,u-boot 官方的树莓派 4b 的 dts 也是实际启动不了树莓派 4b 的,我现在只呢用从树莓派 os 系统镜像里提取的 dts 来启动,所以修改内核的 dts 这种方法我是用不了的。
|
7
wniming OP @LXGMAX
如果我直接用 mainline 内核的 dts 编译出来的 dtb 就是这种报错: DRAM: 3.9 GiB RPI 4 Model B (0xc03115) Core: 175 devices, 17 uclasses, devicetree: board MMC: mmc@7e300000: 0, mmc@7e340000: 1 Loading Environment from FAT... Card did not respond to voltage select! : -110 ** Bad device specification mmc 0 ** In: serial Out: vidconsole Err: vidconsole Net: eth0: ethernet@7d580000 PCIe BRCM: link up, 5.0 Gbps x1 (SSC) starting USB... Bus xhci_pci: Register 5000420 NbrPorts 5 Starting the controller USB XHCI 1.00 scanning bus xhci_pci for devices... 4 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found Hit any key to stop autoboot: 0 Card did not respond to voltage select! : -110 switch to partitions #0, OK mmc1 is current device Scanning mmc 1:1... Found U-Boot script /boot.scr 493 bytes read in 6 ms (80.1 KiB/s) ## Executing script at 02400000 Card did not respond to voltage select! : -110 ** Bad device specification mmc 0 ** Couldn't find partition mmc 0:1 Can't set block device 46483968 bytes read in 144 ms (307.9 MiB/s) 17868889 bytes read in 56 ms (304.3 MiB/s) ERROR: Did not find a cmdline Flattened Device Tree Could not find a valid device tree SCRIPT FAILED: continuing... MMC Device 2 not found no mmc device at slot 2 Device 0: Vendor: ZX1 256G Rev: U091 Prod: Type: Hard Disk Capacity: 244198.3 MB = 238.4 GB (500118192 x 512) ... is now current device Scanning usb 0:2... BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 BOOTP broadcast 4 DHCP client bound to address 192.168.2.150 (3010 ms) *** Warning: no boot file name; using 'C0A80296.img' Using ethernet@7d580000 device TFTP from server 192.168.2.1; our IP address is 192.168.2.150 Filename 'C0A80296.img'. Load address: 0x1000000 Loading: T T T T T T T T T T Retry count exceeded; starting again missing environment variable: pxeuuid Retrieving file: pxelinux.cfg/01-e4-5f-01-a8-b0-00 Using ethernet@7d580000 device TFTP from server 192.168.2.1; our IP address is 192.168.2.150 Filename 'pxelinux.cfg/01-e4-5f-01-a8-b0-00'. Load address: 0x2500000 Loading: * |