记录ok6410 jlink 命令行调试uboot

发布时间:2024-09-25  

1启动ok6410 进入uboot命令行

2\启动JLinkGDBServer -device ARM11

3arm-none-eabi-gdb u-boot

初始化脚本

# Connect to the J-Link GDBServer
target remote localhost:2331
# Set JTAG speed to 30 kHz
monitor endian little
monitor speed 30
# Reset the target
monitor reset
monitor sleep 10
#
# CPU core initialization
#
# Set the processor to service mode
monitor reg cpsr = 0xd3
# Config MMU
# Flush v3/v4 cache
monitor cp15 7, 7, 0, 0 = 0x0
monitor cp15 8, 7, 0, 0 = 0x0
# Disable MMU stuff and caches
monitor cp15 1, 0, 0, 0 =0x1002
# Peri port setup
monitor cp15 15, 2, 0, 4 = 0x70000013
# Disable watchdog
monitor MemU32 0x7e004000 = 0x00000000
monitor sleep 10
# Disable interrupt
monitor MemU32 0x71200014 = 0xffffffff
monitor MemU32 0x71300014 = 0xffffffff
monitor MemU32 0x7120000C = 0x00000000
monitor MemU32 0x7130000C = 0x00000000
monitor MemU32 0x71200F00 = 0x00000000
monitor MemU32 0x71300F00 = 0x00000000
# Set clock
monitor MemU32 0x7e00f900 = 0x000080de
monitor MemU32 0x7e00f000 = 0x0000ffff
monitor MemU32 0x7e00f004 = 0x0000ffff
monitor MemU32 0x7e00f008 = 0x0000ffff
monitor MemU32 0x7e00f028 = 0x00300000
monitor MemU32 0x7e00f020 = 0x01043310
monitor MemU32 0x7e00f00C = 0x810a0301
monitor MemU32 0x7e00f010 = 0x810a0301
monitor MemU32 0x7e00f014 = 0x80200102
monitor MemU32 0x7e00f018 = 0x00000000
monitor MemU32 0x7e00f01c = 0x00000007
monitor sleep 1
# UART Init
monitor MemU32 0x7f008000 = 0x00220022
monitor memU32 0x7f008020 = 0x00002222
monitor memU32 0x7f005008 = 0x00000000
monitor memU32 0x7f00500c = 0x00000000
monitor memU32 0x7f005000 = 0x00000003
monitor memU32 0x7f005004 = 0x00000e45

monitor memU32 0x7f005028 = 0x00000033
monitor memU32 0x7f00502c = 0x0000dfdd
monitor memU32 0x7f005020 = 0x4f4f4f4f
monitor memU32 0x7f005020 = 0x4b4b4b4b

# Config Mobile DDR SDRAM
monitor MemU32 0x7e00f120 = 0x0000000d
monitor MemU32 0x7e001004 = 0x00000004
monitor MemU32 0x7e001010 = 0x0000040f
monitor MemU32 0x7e001014 = 0x00000006
monitor MemU32 0x7e001018 = 0x00000001
monitor MemU32 0x7e00101c = 0x00000002
monitor MemU32 0x7e001020 = 0x00000006
monitor MemU32 0x7e001024 = 0x0000000a
monitor MemU32 0x7e001028 = 0x0000000c
monitor MemU32 0x7e00102c = 0x0000010b
monitor MemU32 0x7e001030 = 0x0000000c
monitor MemU32 0x7e001034 = 0x00000002
monitor MemU32 0x7e001038 = 0x00000002
monitor MemU32 0x7e00103c = 0x00000002
monitor MemU32 0x7e001040 = 0x00000002
monitor MemU32 0x7e001044 = 0x00000010
monitor MemU32 0x7e001048 = 0x00000010
monitor MemU32 0x7e00100C = 0x0001001a
monitor MemU32 0x7e00104C = 0x00000b45
monitor MemU32 0x7e001200 = 0x000150f0
monitor MemU32 0x7e001304 = 0x00000000
monitor MemU32 0x7e001008 = 0x000c0000
monitor MemU32 0x7e001008 = 0x00000000
monitor MemU32 0x7e001008 = 0x00040000
monitor MemU32 0x7e001008 = 0x00040000
monitor MemU32 0x7e001008 = 0x000a0000
monitor MemU32 0x7e001008 = 0x00080032
monitor MemU32 0x7e001004 = 0x00000000
# Setup GDB for faster downloads
#set remote memory-write-packet-size 1024
set remote memory-write-packet-size 4096
set remote memory-write-packet-size fixed

 

然后下面单行输入

monitor speed 6000

b start_armboot

load

continue

上电之后第一次可能无法进入断点,然后退出arm-none-eabi-gdb,重新进入arm-none-eabi-gdb 重新初始化


文章来源于:电子工程世界    原文链接
本站所有转载文章系出于传递更多信息之目的,且明确注明来源,不希望被转载的媒体或个人可与我们联系,我们将立即进行删除处理。

我们与500+贴片厂合作,完美满足客户的定制需求。为品牌提供定制化的推广方案、专属产品特色页,多渠道推广,SEM/SEO精准营销以及与公众号的联合推广...详细>>

利用葫芦芯平台的卓越技术服务和新产品推广能力,原厂代理能轻松打入消费物联网(IOT)、信息与通信(ICT)、汽车及新能源汽车、工业自动化及工业物联网、装备及功率电子...详细>>

充分利用其强大的电子元器件采购流量,创新性地为这些物料提供了一个全新的窗口。我们的高效数字营销技术,不仅可以助你轻松识别与连接到需求方,更能够极大地提高“闲置物料”的处理能力,通过葫芦芯平台...详细>>

我们的目标很明确:构建一个全方位的半导体产业生态系统。成为一家全球领先的半导体互联网生态公司。目前,我们已成功打造了智能汽车、智能家居、大健康医疗、机器人和材料等五大生态领域。更为重要的是...详细>>

我们深知加工与定制类服务商的价值和重要性,因此,我们倾力为您提供最顶尖的营销资源。在我们的平台上,您可以直接接触到100万的研发工程师和采购工程师,以及10万的活跃客户群体...详细>>

凭借我们强大的专业流量和尖端的互联网数字营销技术,我们承诺为原厂提供免费的产品资料推广服务。无论是最新的资讯、技术动态还是创新产品,都可以通过我们的平台迅速传达给目标客户...详细>>

我们不止于将线索转化为潜在客户。葫芦芯平台致力于形成业务闭环,从引流、宣传到最终销售,全程跟进,确保每一个potential lead都得到妥善处理,从而大幅提高转化率。不仅如此...详细>>