在U-Boot-2009-03移植笔记(从Nandflash启动一)中,我们写好了nandflash的读驱动,并且试图将u-boot本身从nandflash中读到sdram中,最后同时点亮led1和led2,可惜结果并不是我们想要的结果,本文就使用openjtag的调试方法,来诊断问题(不熟悉调试方法的,请参考U-Boot-2009-03移植笔记(调试篇))。
问题的发现
我们反编译u-boot文件,发现我们的程序还是在33f800090调用了nand_init_ll函数,那么我们在0x00000090和0x00000094两个地址设置断点,如图:
发现程序在0x00000090之后就跑飞了,怎么办?我们看看u-boot的反汇编代码:
先看0x00000090,发现没有问题,如图:
再来看看nand_init_ll函数本身,发现函数地址是0x33f8dcf0,如果映射到0地址,应该是0x0000dcf0,超出4K,无法在sram中被执行。知道问题的原因,也就很好解决。
问题的解决
打开board/xinna2440/u-boot.lds,将nand_op.c的代码放到前4k:
重新编译,烧写,发现led1和led2都被点亮.
文章来源于:电子工程世界 原文链接
本站所有转载文章系出于传递更多信息之目的,且明确注明来源,不希望被转载的媒体或个人可与我们联系,我们将立即进行删除处理。
相关文章

STM32F系列向G系列切换应用总结—Boot mode及Option byte(2023-06-09)
STM32F系列向G系列切换应用总结—Boot mode及Option byte;很多客户在使用STM32G系列替代STM32F系列时,我们经常会收到客户反馈如果使用串口下载程序?如何修改boot......

u-boot-2015.01在tq2440上的初步移植(2023-06-26)
u-boot-2015.01在tq2440上的初步移植;开发板: tq2440
工具: Win7 + VMware + Debian6
U-boot版本: u-boot......

u-boot移植s3c2410(2023-05-10)
u-boot移植s3c2410;u-boot的向s3c2410板上的移植(只是编译而以)可谓是千辛万苦啊(对于菜鸟而言,(*^__^*) ,高手除外),下面就是我的痛苦经历。
过程如下:
下载u......

STM32F207内部Flash编程详解(2023-09-19)
器的构成
主要存储区块包含4个16K字节扇区,1个64K字节扇区和7个128K字节扇区。
系统存储器是用于在系统boot模式启动设备的。这一块是预留给ST的。包括bootloader程序,boot程序......

如何在STM32单片机中加入RDP功能(2023-06-15)
机对其进行去除读保护;
2、配置Boot区,用SRAM运行程序,在SRAM的主程序中执行去除RDP操作;
3、购买了STLink II,下载STVP,选择Option Byte的编程,将Option......

u-boot分析与移植——基于u-boot-2011.3和FL2440(2024-08-29)
u-boot分析与移植——基于u-boot-2011.3和FL2440;关于移植的基本方法可以先阅读u-boot的README文档
If the system board that you......

把驱动编译进内核的3种方法(mini2440 key按键为例)(2024-06-20)
on MACH_MINI2440
default y if MACH_MINI2440
help
This option enables support for key connected to GPIO lines......

你知道嵌入式Linux内核?文件系统的制作也是有密切关联的(2023-01-11)
+ boot parameters + kernel + root filesystem
嵌入式Linux系统使用的是Linux内核,制作方法基本和X86平台的Linux内核一致,下面......

Linux-2.6.39在Tiny6410上的移植(2024-09-20)
'root=' boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable......

Linux 3.3.0移植到S3C6410开发板上之一(2024-09-19)
-block(31,2)
Please append a correct 'root=' boot option; here are the available partitions:
1f00......