Chinaunix首页 | 论坛 | 博客
  • 博客访问: 124264
  • 博文数量: 29
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 200
  • 用 户 组: 普通用户
  • 注册时间: 2014-12-18 18:29
文章分类

全部博文(29)

文章存档

2016年(1)

2015年(24)

2014年(4)

我的朋友

分类: 嵌入式

2015-01-05 01:15:54

现在在sdram中偶尔成功调试代码



gdbinit初始化代码在网上找的参考:(现在这个设置10次能有两次成功,可能需要修改某些项设置才能完全正确)


点击(此处)折叠或打开

  1. # Connect to the J-Link GDBServer
  2. target remote localhost:2331
  3. # Set JTAG speed to 30 kHz
  4. monitor endian little
  5. monitor speed 30
  6. # Reset the target
  7. #monitor reset
  8. monitor sleep 10
  9. #
  10. # CPU core initialization
  11. #
  12. # Set the processor to service mode
  13. monitor reg cpsr = 0xd3
  14. # Config MMU
  15. # Flush v3/v4 cache
  16. monitor cp15 7, 7, 0, 0 = 0x0
  17. monitor cp15 8, 7, 0, 0 = 0x0
  18. # Disable MMU stuff and caches
  19. monitor cp15 1, 0, 0, 0 =0x1002
  20. # Peri port setup
  21. monitor cp15 15, 2, 0, 4 = 0x70000013
  22. # Disable watchdog
  23. monitor MemU32 0x7e004000 = 0x00000000
  24. monitor MemU32 0x7e004000
  25. monitor sleep 10
  26. # Disable interrupt
  27. monitor MemU32 0x71200014 = 0xffffffff// 和参考不一样,别的地方应该也有需要改的
  28. monitor MemU32 0x71200014
  29. monitor MemU32 0x71300014 = 0xffffffff
  30. monitor MemU32 0x71300014
  31. monitor MemU32 0x7120001C = 0xffffffff
  32. monitor MemU32 0x7130001C = 0xffffffff
  33. monitor MemU32 0x71200F00 = 0x00000000
  34. monitor MemU32 0x71300F00 = 0x00000000
  35. # Set clock
  36. monitor MemU32 0x7e00f900 = 0x000080de
  37. monitor MemU32 0x7e00f000 = 0x0000ffff
  38. monitor MemU32 0x7e00f004 = 0x0000ffff
  39. Monitor MemU32 0x7e00f008 = 0x0000ffff
  40. Monitor MemU32 0x7e00f028 = 0x00300000
  41. monitor MemU32 0x7e00f020 = 0x01043310
  42. monitor MemU32 0x7e00f00C = 0x810a0301
  43. monitor MemU32 0x7e00f010 = 0x810a0301
  44. Monitor MemU32 0x7e00f014 = 0x80200201
  45. Monitor MemU32 0x7e00f018 = 0x00000000
  46. Monitor MemU32 0x7e00f01c = 0x00002007
  47. monitor sleep 1
  48. # UART Init
  49. Monitor MemU32 0x7f008000 = 0x00220022
  50. Monitor memU32 0x7f008020 = 0x00002222
  51. Monitor memU32 0x7f005008 = 0x00000000
  52. Monitor memU32 0x7f00500c = 0x00000000
  53. Monitor memU32 0x7f005000 = 0x00000003
  54. Monitor memU32 0x7f005004 = 0x00000e45
  55. Monitor memU32 0x7f00502c = 0x00001fff
  56. Monitor memU32 0x7f005020 = 0x4f4f4f4f
  57. Monitor memU32 0x7f005020 = 0x4b4b4b4b

  58. # Config Mobile DDR SDRAM
  59. monitor MemU32 0x7e00f120 = 0x0000000d
  60. monitor MemU32 0x7e001004 = 0x00000004
  61. monitor MemU32 0x7e001010 = 0x0000040f
  62. monitor MemU32 0x7e001014 = 0x00000006
  63. monitor MemU32 0x7e001018 = 0x00000001
  64. monitor MemU32 0x7e00101c = 0x00000002
  65. monitor MemU32 0x7e001020 = 0x00000006
  66. monitor MemU32 0x7e001024 = 0x0000000a
  67. monitor MemU32 0x7e001028 = 0x0000000c
  68. monitor MemU32 0x7e00102c = 0x0000010b
  69. monitor MemU32 0x7e001030 = 0x0000000c
  70. monitor MemU32 0x7e001034 = 0x00000002
  71. monitor MemU32 0x7e001038 = 0x00000002
  72. monitor MemU32 0x7e00103c = 0x00000002
  73. monitor MemU32 0x7e001040 = 0x00000002
  74. monitor MemU32 0x7e001044 = 0x00000010
  75. monitor MemU32 0x7e001048 = 0x00000010
  76. monitor MemU32 0x7e00100C = 0x0001001a
  77. monitor MemU32 0x7e00104C = 0x00000b45
  78. monitor MemU32 0x7e001200 = 0x000150f0
  79. monitor MemU32 0x7e001304 = 0x00000000
  80. monitor MemU32 0x7e001008 = 0x000c0000
  81. monitor MemU32 0x7e001008 = 0x00000000
  82. monitor MemU32 0x7e001008 = 0x00040000
  83. monitor MemU32 0x7e001008 = 0x00040000
  84. monitor MemU32 0x7e001008 = 0x000a0000
  85. monitor MemU32 0x7e001008 = 0x00080032
  86. monitor MemU32 0x7e001004 = 0x00000000
  87. # Setup GDB for faster downloads
  88. #set remote memory-write-packet-size 1024
  89. set remote memory-write-packet-size 4096
  90. set remote memory-write-packet-size fixed
  91. monitor speed 12000
  92. load
  93. monitor go

阅读(1385) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~