【问题标题】:u-boot hard fault error after ram initializationram初始化后u-boot硬故障错误
【发布时间】:2020-11-23 22:01:20
【问题描述】:

我在 Waveshare coreH7 stm32h743 板上移植了 U-boot。我使用 stm32h743-disco 文件和设备树作为移植模板。我的板载 SDRAM 是 8MBytes 的 IS42S16400J。我已经计算了我的 sdram 的参数,并将它们放在我的板设备树文件中,如下所示:

/*
             * Memory configuration from sdram datasheet IS42S32800G-6BLI
             * firsct bank is bank@0
             * second bank is bank@1
             */
            bank2: bank@1 {
                st,sdram-control = /bits/ 8 <NO_COL_8
                                 NO_ROW_12
                                 MWIDTH_16
                                 BANKS_4
                                 CAS_3
                                 SDCLK_2
                                 RD_BURST_EN
                                 RD_PIPE_DL_0>;
                st,sdram-timing = /bits/ 8 <TMRD_1
                                TXSR_1
                                TRAS_1
                                TRC_6
                                TRP_2
                                TWR_1
                                TRCD_1>;
                st,sdram-refcount = <300>;
            };

另外,我已将 rcc 值配置为以 100MHz 为 dram 供电。

但是当uboot开始初始化时,它会进入硬故障中断。

这是日志:

lib/fdtdec.c:fdtdec_setup_mem_size_base_fdt() fdtdec_setup_mem_size_base_fdt: Initial DRAM size 2000000
include/initcall.h:initcall_run_list() initcall: 08008a89
common/board_f.c:setup_dest_addr() Monitor len: 00039F80
common/board_f.c:setup_dest_addr() Ram size: 02000000
common/board_f.c:setup_dest_addr() Ram top: D2000000
include/initcall.h:initcall_run_list() initcall: 08008665
include/initcall.h:initcall_run_list() initcall: 0800117d
arch/arm/lib/cache.c:arm_reserve_mmu() TLB table from d1ff0000 to d1ff4000
include/initcall.h:initcall_run_list() initcall: 080088c3
include/initcall.h:initcall_run_list() initcall: 080088c7
include/initcall.h:initcall_run_list() initcall: 080086b1
common/board_f.c:reserve_uboot() Reserving 231k for U-Boot at: d1fb6000
include/initcall.h:initcall_run_list() initcall: 080088ed
common/board_f.c:reserve_malloc() Reserving 1032k for malloc() at: d1eb4000
include/initcall.h:initcall_run_list() initcall: 08008821
Hard fault
pc : 0800087e    lr : 00000000    xPSR : 21000000
r12 : d1eb3ff0   r3 : 00000000    r2 : 00000010
r1 : 00000000    r0 : d1eb3fb0
Resetting CPU ...

有什么问题? ram初始化不成功?为什么?也许错误的参数?我怎么知道 ram 已成功初始化? 这是u-boot的正常信息日志:

U-Boot 2020.07-00610-g610e1487c8-dirty (Aug 04 2020 - 00:34:13 +0430)

Model: Waveshare STM32H743i-Coreh7 board
DRAM:  Hard fault
pc : 0800087e    lr : 00000000    xPSR : 21000000
r12 : d1eb3ff0   r3 : 00000000    r2 : 00000010
r1 : 00000000    r0 : d1eb3fb0
Resetting CPU ...

【问题讨论】:

  • 内存大小 02000000 ??那是对的吗 ?我不知道这种板子,但我认为如果你移植了你的引导,那么也许你在某个地方有一些旧的配置。再次检查设置内存大小的步骤
  • @secretsquirrel 哦,是的,你是对的,这是不正确的,但我教它自动检测内存大小。那么,我应该在哪里配置内存大小?
  • @secretsquirrel 我找到了。我认为它在我的板设备树中。

标签: linux microcontroller stm32 hardware u-boot


【解决方案1】:

您的内存大小错误。正如您所提到的,实际内存大小为 8MB,即十六进制数为 0x7A1200。但在 U-boot 日志中是“Initial DRAM size 2000000”。您应该在开发板的设备树中更改它。

memory {
      device_type = "memory";
      reg = <0xd0000000 0x7A1200>;
};

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-08
    • 1970-01-01
    • 1970-01-01
    • 2021-08-29
    • 2016-12-16
    • 1970-01-01
    相关资源
    最近更新 更多