我正试图让Uboot在飞思卡尔mx28evk板上运行。它编译得很好,并给我一个图像,我可以dd复制到SD卡。如何调试uBoot?
当我打开电路板时,串口调试控制台没有输出,甚至没有出现错误信息。我可以确认,虽然董事会工作正常卡上的另一个工作形象。
什么是适当的下一步找出导致问题的原因?在uBoot分区上是否有任何模式或幻数,我可以查找以确认它是有效的uBoot?
我正试图让Uboot在飞思卡尔mx28evk板上运行。它编译得很好,并给我一个图像,我可以dd复制到SD卡。如何调试uBoot?
当我打开电路板时,串口调试控制台没有输出,甚至没有出现错误信息。我可以确认,虽然董事会工作正常卡上的另一个工作形象。
什么是适当的下一步找出导致问题的原因?在uBoot分区上是否有任何模式或幻数,我可以查找以确认它是有效的uBoot?
假设已配置一个的U-Boot版本如u-boot-2013.07
与mx28evk_config
配置和使用的工具链如arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
建u-boot.sb
生成文件目标,并转换目标到.sd
文件使用./tools/mxsboot sd u-boot.sb u-boot.sd
,那么最可能的问题是您在PMU或SDRAM配置中有错误。这些配置中的错误可能会导致重置循环重置发生在您到达U-Boot横幅打印输出之前。
确保您已经设置了EVK交换机作为the Denx U-Boot doc/README.mx28evk
file规定:设置启动模式DIP开关:
,你为了调试这类问题需要下一步是把串行输出年初,在SPL SRAM代码。开始时在arch/arm/cpu/arm926ejs/mxs/spl_boot.c:mxs_common_spl_init()
中输入putc
。例如:
void mxs_common_spl_init(const iomux_cfg_t *iomux_setup,
const unsigned int iomux_size)
{
struct mxs_spl_data *data = (struct mxs_spl_data *)
((CONFIG_SYS_TEXT_BASE - sizeof(struct mxs_spl_data)) & ~0xf);
debug_putc('a');
uint8_t bootmode = mxs_get_bootmode_index();
debug_putc('b');
mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
debug_putc('c');
mxs_power_init();
debug_putc('d');
mxs_mem_init();
debug_putc('e');
data->mem_dram_size = mxs_mem_get_size();
data->boot_mode_idx = bootmode;
mxs_power_wait_pswitch();
}
,我使用的,这是从飞思卡尔i.MX28 bootlet代码借的putc
:
void debug_putc(char ch)
{
int loop = 0;
while (((*(volatile hw_uartdbgfr_t *) ((0x80000000 + 0x74000) + 0x18)).U)&0x00000020)
{
loop++;
if (loop > 10000)
break;
};
((*(volatile hw_uartdbgdr_t *) ((0x80000000 + 0x74000) + 0x0)).U = (ch));
}
,你需要的类型是:
typedef unsigned int reg32_t;
typedef unsigned short reg16_t;
typedef unsigned char reg8_t;
typedef union
{
reg32_t U;
struct
{
unsigned DIV_EMI : 6;
unsigned RSRVD1 : 2;
unsigned DIV_XTAL : 4;
unsigned RSRVD2 : 4;
unsigned DCC_RESYNC_ENABLE : 1;
unsigned BUSY_DCC_RESYNC : 1;
unsigned RSRVD3 : 8;
unsigned BUSY_SYNC_MODE : 1;
unsigned BUSY_REF_CPU : 1;
unsigned BUSY_REF_EMI : 1;
unsigned BUSY_REF_XTAL : 1;
unsigned SYNC_MODE_EN : 1;
unsigned CLKGATE : 1;
} B;
} hw_clkctrl_emi_t;
typedef union
{
reg32_t U;
struct
{
unsigned TRG : 5;
unsigned RSRVD1 : 3;
unsigned BO_OFFSET : 3;
unsigned RSRVD2 : 1;
unsigned LINREG_OFFSET : 2;
unsigned RSRVD3 : 2;
unsigned DISABLE_FET : 1;
unsigned ENABLE_LINREG : 1;
unsigned DISABLE_STEPPING : 1;
unsigned PWDN_BRNOUT : 1;
unsigned RSRVD4 : 12;
} B;
} hw_power_vddactrl_t;
typedef union
{
reg32_t U;
struct
{
reg8_t DATA;
unsigned FE : 1;
unsigned PE : 1;
unsigned BE : 1;
unsigned OE : 1;
unsigned RESERVED : 4;
reg16_t UNAVAILABLE;
} B;
} hw_uartdbgdr_t;
typedef union
{
reg32_t U;
struct
{
unsigned CTS : 1;
unsigned DSR : 1;
unsigned DCD : 1;
unsigned BUSY : 1;
unsigned RXFE : 1;
unsigned TXFF : 1;
unsigned RXFF : 1;
unsigned TXFE : 1;
unsigned RI : 1;
unsigned RESERVED : 7;
reg16_t UNAVAILABLE;
} B;
} hw_uartdbgfr_t;
void debug_putc(char c);
我把类型arch/arm/cpu/arm926ejs/mxs/mxs_init.h
和spl_boot.c
的putc
实施。我也倾向于把很多putc
报表spl_power_init.c
和spl_mem_init.c
。
注意,误编程PMU spl_power_init.c
可能会导致复位,当你到spl_mem_init.c
只会出现以后。别让这个假冒出来。
尝试使SD卡没有U形引导(mk_mx28_sd的/ dev/sdX的)
尝试使SD卡用的U-Boot之前重新编译bootlets(./ltib -p boot_stream.spec -f)( mk_mx28_sd -u的/ dev/sdX的)
如果您使用的是启用了SPL的最新版本的U-Boot,则无法使用bootlet来启动它。相反,你需要建立''u-boot.sd''目标(''./tools/mxsboot sd u-boot.sb u-boot.sd''),''dd''到SD卡并开机。 U-Boot的SPL特性实际上是对bootlet概念的一般重写。请参阅http://www.emlinews.net/2012/10/u-boot-spl-framework-becomes-generic/。 –
*“它编译得很好”* - 你在使用什么编译器?问题一开始就可能是正确的。否则,对于大多数人来说,使用在线仿真器(例如J-Link)将是下一步。 – sawdust
请指出您编译的U-Boot的版本。另请参阅https://community.freescale.com/thread/304614 –