求助::
想用,IAR +Wiggler 调试44B0 可是不知道怎样调试下栽到sdram
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.
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
与电子爱好者谈读图二被打赏50分 | |
【FRDM-MCXN947评测】Core1适配运行FreeRtos被打赏50分 | |
【FRDM-MCXN947评测】双核调试被打赏50分 | |
【CPKCORRA8D1B评测】---移植CoreMark被打赏50分 | |
【CPKCORRA8D1B评测】---打开硬件定时器被打赏50分 | |
【FRDM-MCXA156评测】4、CAN loopback模式测试被打赏50分 | |
【CPKcorRA8D1评测】--搭建初始环境被打赏50分 | |
【FRDM-MCXA156评测】3、使用FlexIO模拟UART被打赏50分 | |
【FRDM-MCXA156评测】2、rt-thread MCXA156 BSP制作被打赏50分 | |
【FRDM-MCXN947评测】核间通信MUTEX被打赏50分 |