这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » 44bo 用 IAR +Wiggler 调试,怎样初始化sdram??

共2条 1/1 1 跳转至

44bo 用 IAR +Wiggler 调试,怎样初始化sdram??

菜鸟
2005-05-10 23:43:40     打赏

求助::

想用,IAR +Wiggler 调试44B0 可是不知道怎样调试下栽到sdram




关键词: +Wiggler     调试     怎样     初始化     sdram    

菜鸟
2005-05-11 00:10:00     打赏
2楼

You must configure the memory controller before you download your application code. You can do this best by using a C-SPY macro function that is executed before the code download takes place—execUserPreload(). The macro functions __writeMemory32() will perform the necessary initialization of the memory controller. The following example illustrates a macro used to setup the memory controller and remap on the Atmel AT91EB55 chip, similar mechanisms exist in processors from other ARM vendors. execUserPreload() { __message "Setup memory controller, do remap command\n"; // Flash at 0x01000000, 16MB, 2 hold, 16 bits, 3 WS __writeMemory32(0x01002529, 0xffe00000, "Memory"); // RAM at 0x02000000, 16MB, 0 hold, 16 bits, 1 WS __writeMemory32(0x02002121, 0xffe00004, "Memory"); // unused __writeMemory32(0x20000000, 0xffe00008, "Memory"); // unused __writeMemory32(0x30000000, 0xffe0000c, "Memory"); // unused __writeMemory32(0x40000000, 0xffe00010, "Memory"); // unused __writeMemory32(0x50000000, 0xffe00014, "Memory"); // unused __writeMemory32(0x60000000, 0xffe00018, "Memory"); // unused __writeMemory32(0x70000000, 0xffe0001c, "Memory"); // REMAP command __writeMemory32(0x00000001, 0xffe00020, "Memory"); // standard read __writeMemory32(0x00000006, 0xffe00024, "Memory"); } Note that the setup macro execUserReset() may have to be defined in the same way to reinitialize the memory mapping after a C-SPY reset. This can be needed if you have setup your hardware debugger system to do a hardware reset on C-SPY reset. It can be convenient to register a macro file during the C-SPY startup sequence, especially if you have several ready-made macro functions. C-SPY can then execute the macros before main is reached. You achieve this by specifying a macro file which you load before starting the debugger. Your macro functions will be automatically registered each time you start the C-SPY Debugger. If you define the macro functions by using the setup macro function names you can define exactly at which stage you want the macro function to be executed. Follow these steps: 1 Create a new text file where you can define your macro function. For example: execUserSetup() {... _ _orderInterrupt("IRQ", 4000, 2000, 0, 0, 100); } This macro function generates a repeating interrupt that is first activated after 4000 cycles and then repeated approximately every 2000th cycle. Because the macro is defined with the execUserSetup() function name, it will be executed directly after your application has been downloaded. 2 Save the file using the filename extension mac. 3 Before you start C-SPY, choose Project>Options and click the Setup tab in the Debugger category. Select the check box Use Setup file and choose the macro file you just created. The interrupt macro will now be loaded during the C-SPY startup sequence.


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]