|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
usb demo代碼在flash可以運(yùn)行,無法在ram里面運(yùn)行?(問題已經(jīng)解決) |
| 作者:starm 欄目:MCU技術(shù) |
IAR EWARM 4.41 & JLINK & STR912FW44 & Windows 2003 我把中斷向量表復(fù)制到ram的最高端, 一共64bytes. 在FLASH里面, 中斷都沒有問題. 但是在ram里面不正常. 我測試了0x04000000 0x50000000 兩個(gè)開始地址都不行. 謝謝! 91x_vect.s 中的改動(dòng): //******************************************************************************* // Import the __program_start address from 91x_init.s //******************************************************************************* IMPORT __program_start //******************************************************************************* // Import exception handlers //******************************************************************************* IMPORT Undefined_Handler IMPORT SWI_Handler IMPORT Prefetch_Handler IMPORT Abort_Handler IMPORT FIQ_Handler PUBLIC CopyStart PUBLIC CopyEnd //******************************************************************************* // Exception vectors at Boot FLASH 0x00000000 //******************************************************************************* LDR PC, Reset_Addr // @0x00000000 LDR PC, Undefined_Addr // @0x00000004 LDR PC, SWI_Addr // @0x00000008 LDR PC, Prefetch_Addr // @0x0000000C LDR PC, Abort_Addr // @0x00000010 LDR PC, Reserve_Addr // @0x00000014 LDR PC, IRQ_Addr // @0x00000018 LDR PC, FIQ_Addr // @0x0000001C Reset_Addr DCD __program_start // @0x00000020 Undefined_Addr DCD 0x50017FC4 // @0x00000024 SWI_Addr DCD 0x50017FC8 // @0x00000028 Prefetch_Addr DCD 0x50017FCC // @0x0000002C Abort_Addr DCD 0x50017FD0 // @0x00000030 Reserve_Addr DCD 0x50017FD4 // @0x00000034 IRQ_Addr DCD 0x50017FD8 // @0x00000038 FIQ_Addr DCD 0x50017FDC // @0x0000003C //******************************************************************************* // Exception vectors at RAM 0x50017FC0 : Copy from 0x00000040 : 64 Bytes //******************************************************************************* CopyStart LDR PC, Reset_Addr_RAM // @0x00000040 To 0x50017FC0 LDR PC, Undefined_Addr_RAM // @0x00000044 To 0x50017FC4 LDR PC, SWI_Addr_RAM // @0x00000048 To 0x50017FC8 LDR PC, Prefetch_Addr_RAM // @0x0000004C To 0x50017FCC LDR PC, Abort_Addr_RAM // @0x00000050 To 0x50017FD0 LDR PC, Reserve_Addr_RAM // @0x00000054 To 0x50017FD4 LDR PC, IRQ_Addr_RAM // @0x00000058 To 0x50017FD8 LDR PC, FIQ_Addr_RAM // @0x0000005C To 0x50017FDC Reset_Addr_RAM DCD __program_start // @0x00000060 To 0x50017FE0 Undefined_Addr_RAM DCD UndefinedHandler&n |
| 2樓: | >>參與討論 |
| 作者: starm 于 2007/1/15 16:28:00 發(fā)布:
附上整個(gè)工程文件 可以選擇DebugInB0, 在FLASH調(diào)試, 運(yùn)行正常. 如果選擇DebugInRam, 在ram調(diào)試, 就無法通過枚舉了. http://bbs.21ic.com/upfiles/img/20071/2007115162852849.rar |
|
| 3樓: | >>參與討論 |
| 作者: starm 于 2007/1/15 16:34:00 發(fā)布:
為了在RAM調(diào)試, 需要先通過jtag使能內(nèi)部的RAM 調(diào)試時(shí)先加載這個(gè)91x_ram.mac文件: 其中包含了這個(gè)設(shè)置函數(shù): execUserPreload() { __message "Enable 96KB RAM to download code ... \n"; // SCU_CLKCNTR Fmstr = OSC, RCLK = Fmstr, HCLK = RCLK, PCLK = RCLK, BCLK = RCLK/2 __writeMEMORY32(0x00020002, 0x5C002000, "MEMORY"); // SCU_PWRMNG POWER Mode = Run mode, __writeMEMORY32(0x00000000, 0x5C00200C, "MEMORY"); // SCU_PCGR0 FMI, PQFBC, SRAM, SRAM_ARBITER, EMI, EXT_MEM_CLK clk enable __writeMEMORY32(0x000000DB, 0x5C002014, "MEMORY"); // SCU_PRR0 RST_FMI, RST_PQFBC, RST_SRAM_ARBITER, RST_EMI, RST_PFQBC_AHB out of reset __writeMEMORY32(0x00001053, 0x5C00201C, "MEMORY"); // SCU_SCR0 PFQBC enabled,SRAM_SIZE = 96kB // DTCM & AHB wait-states disabled __writeMEMORY32(0x00000191, 0x5C002034, "MEMORY"); } 難道問題在這里么? |
|
| 4樓: | >>參與討論 |
| 作者: starm 于 2007/1/15 21:41:00 發(fā)布:
難道問題在這里么? 為了在RAM調(diào)試, 需要先通過jtag使能內(nèi)部的RAM 調(diào)試時(shí)先加載這個(gè)91x_ram.mac文件: 其中包含了這個(gè)設(shè)置函數(shù): execUserPreload() { __message "Enable 96KB RAM to download code ... \n"; // SCU_CLKCNTR Fmstr = OSC, RCLK = Fmstr, HCLK = RCLK, PCLK = RCLK, BCLK = RCLK/2 __writeMEMORY32(0x00020002, 0x5C002000, "MEMORY"); // SCU_PWRMNG POWER Mode = Run mode, __writeMEMORY32(0x00000000, 0x5C00200C, "MEMORY"); // SCU_PCGR0 FMI, PQFBC, SRAM, SRAM_ARBITER, EMI, EXT_MEM_CLK clk enable __writeMEMORY32(0x000000DB, 0x5C002014, "MEMORY"); // SCU_PRR0 RST_FMI, RST_PQFBC, RST_SRAM_ARBITER, RST_EMI, RST_PFQBC_AHB out of reset __writeMEMORY32(0x00001053, 0x5C00201C, "MEMORY"); // SCU_SCR0 PFQBC enabled,SRAM_SIZE = 96kB // DTCM & AHB wait-states disabled __writeMEMORY32(0x00000191, 0x5C002034, "MEMORY"); } 把藍(lán)色部分注釋掉, 依然不能正常運(yùn)行. 當(dāng)中斷發(fā)生了, 接著就是一直在 預(yù)取中止 里面死循環(huán)了. |
|
| 5樓: | >>參與討論 |
| 作者: starm 于 2007/1/17 13:54:00 發(fā)布:
通過把中斷向量表放到ram低端, 可以解決問題 91x_vect.s 中的改動(dòng): PROGRAM ?RESET COMMON INTVEC:CODE(2) CODE32 VectorAddress EQU 0xFFFFF030 // VIC Vector address register address. VectorAddressDAISY EQU 0xFC000030 // DAISY VIC Vector address register I_Bit EQU 0x80 // when I bit is set, IRQ is disabled F_Bit EQU 0x40 // when F bit is set, FIQ is disabled //******************************************************************************* // Import the __program_start address from 91x_init.s //******************************************************************************* IMPORT __program_start //******************************************************************************* // Import exception handlers //******************************************************************************* IMPORT Undefined_Handler IMPORT SWI_Handler IMPORT Prefetch_Handler IMPORT Abort_Handler IMPORT FIQ_Handler PUBLIC CopyStart PUBLIC CopyEnd //******************************************************************************* // Exception vectors at Boot FLASH 0x00000000 //******************************************************************************* LDR PC, Reset_Addr // @0x00000000 LDR PC, Undefined_Addr // @0x00000004 LDR PC, SWI_Addr // @0x00000008 LDR PC, Prefetch_Addr // @0x0000000C LDR PC, Abort_Addr // @0x00000010 LDR PC, Reserve_Addr // @0x00000014 LDR PC, IRQ_Addr // @0x00000018 LDR PC, FIQ_Addr // @0x0000001C Reset_Addr DCD __program_start // @0x00000020 Undefined_Addr DCD 0x04000004 // @0x00000024 SWI_Addr DCD 0x04000008 // @0x00000028 Prefetch_Addr DCD 0x0400000C // @0x0000002C Abort_Addr DCD 0x04000010 // @0x00000030 Reserve_Addr DCD 0x04000014 // @0x00000034 IRQ_Addr DCD 0x04000018 // @0x00000038 FIQ_Addr DCD 0x0400001C // @0x0000003C //******************************************************************************* // Exception vectors at RAM 0x04000000 : Copy from 0x00000040 : 64 Bytes //******************************************************************************* CopyStart LDR PC, Reset_Addr_RAM // @0x00000040 To 0x04000000 LDR PC, Undefined_Addr_RAM // @0x00000044 To 0x04000004 LDR PC, SWI_Addr_RAM // @0x00000048 To 0x04000008 LDR PC, Prefetch_Addr_RAM // @0x0000004C To 0x0400000C LDR PC, Abort_Addr_RAM // @0x00000050 To 0x04000010 LDR PC, Reserve_Addr_RAM // @0x00000054 To 0x04000014 LDR PC, IRQ_Addr_RAM & |
|
| 6樓: | >>參與討論 |
| 作者: starm 于 2007/1/17 14:05:00 發(fā)布:
提供相關(guān)文件僅供參考: 1. 首先在FLASH調(diào)試, 把代碼寫入boot FLASH, 然后可以 2. 在RAM調(diào)試了 http://bbs.21ic.com/upfiles/img/20071/200711714444117.rar |
|
| 7樓: | >>參與討論 |
| 作者: starm 于 2007/1/17 14:13:00 發(fā)布:
整個(gè)usb DEMO的項(xiàng)目文件, 僅供參考. 1. 其中P6.7 為低, usb 上拉電阻連接 其中P6.7 為高, usb 上拉電阻斷開 2. P6.4 P6.5 兩個(gè)pin作為輸入, 移動(dòng)鼠標(biāo)指針. http://bbs.21ic.com/upfiles/img/20071/2007117141154233.rar |
|
|
|
| 免費(fèi)注冊(cè)為維庫電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |