JTAG로 Flash 태우기
후자의 경우 원래 boot의 초기화는 UrJTAG와 OpenOCD에서 이루어져야 하기 때문에 상당히 어려운 길이다.각종 검색이 있으면 정보가 있을 수 있고, 없을 경우 안내기의 코드를 참고하여 초기화 처리를 해야 한다.
가능한 한 잘못된 프로그램을 삭제하거나 태우지 않았으면 좋겠지만, 먼저 구우지 않으면 Flash가 보이지 않으면 후자가 될 수 있으니 포기하지 말고 계속 노력하세요.^^;
규격을 모르는 JTAG 커넥터 등이 엄격해서 저도 잘 안 되는 게 많아요.
추기: 확인 판매 절차를 만들었습니다.
KS88695의 경우
구 SOC의 KS88695(ARM 922T)의 OpenOCD(0.1.0) 설정 파일입니다.KS88695는 KENDIN이 개발한 SOC로, 이후 KENDIN이 미켈에 인수되면서 미켈도 판매를 시작했다.
# KS8695 OpenOCD configuration
source ../../tcl/target/ks869x.cfg
set _FLASHNAME $_CHIPNAME.flash0
flash bank $_FLASHNAME cfi 0x02000000 0x0200000 2 2 $_TARGETNAME
init
proc flash_ks { } {
halt
mww 0x3ffe600 0xff
mww 0x3ffe608 0xa0
mww 0x3ff4010 0x8fe00040
echo "... init routine ..."
#this is the board init configuration file
#which sets up the sdram and flash memory
#so that user can download code into sdram
#and run it.
#This file is used to enabe the demo board
#when there is no code resides in the flash
#memory
# adapter_khz 8000
# arm7_9 dcc_downloads enable ;# Enable faster DCC downloads
#Time to set up the SDRAM and Flash memory
#comment set up external banks
#CAN ALE
#B31:22 = 3FC (end address = 0x3FCFFFF)
#B21:12 = 3FC (start address = 0x3FC0000)
#dword(0x03FF4000) = 0xFF3FCFFF
mww 0x03ff4000 0xff3fcfff
#CAN RD
#B31:22 = 3FD (end address = 0x3FDFFFF)
#B21:12 = 3FD (start address = 0x3FD0000)
#dword(0x03FF4004) = 0xFF7FDFFF
mww 0x03ff4004 0xff7fdfff
#CAN WR
#B31:22 = 3FE (end address = 0x3FEFFFF)
#B21:12 = 3FE (start address = 0x3FE0000)
#dword(0x03FF4008) = 0xFFBFEFFF
mww 0x03ff4008 0xffbfefff
#======================================================================
#################### MOST IMPORTANT TO BURN IMAGE #####################
#======================================================================
# *** Set up rom/flash ***
#======================================================================
#Bank 0
#B31:22 = 2FF (end address = 0x2FFFFFF)
#B21:12 = 200 (start address = 0x2000000)
#dword(0x03FF4010) = 0xBFE00070
# mww 0x03ff4010 0xbfe00070
#Bank 1
#B31:22 = 3FB (end address = 0x3FBFFFF)
#B21:12 = 300 (start address = 0x3000000)
#dword(0x03FF4014) = 0xFEF00070
# mww 0x03ff4014 0xfef00070
#External I/O and ROM/SRAM/FLASH General Register
# Enable CAN RD, CAN WR and CAN ALE
#dword(0x03FF4020) = 0x30FF000F
#mww 0x03ff4020 0x30ff000f
mww 0x03ff4020 0x30ff000a
#======================================================================
#======================================================================
# *** Set up SDRAM ***
#======================================================================
#SDRAM Control Register 0 (0x4030)
#B31:22 = 0FF (end address = 0xFFFFFF)
#B21:12 = 000 (start address = 0x0)
#dword(0x03FF4030) = 0x3FC0000E
mww 0x03ff4030 0x3fc0000e
#SDRAM Control Register 1 (0x4034)
#B31:22 = 1FF (end address = 0x1FFFFFF)
#B21:12 = 100 (start address = 0x1000000)
#dword(0x03FF4034) = 0x7FD0000E
mww 0x03ff4034 0x7fd0000e
# Set global RAS/CAS timing
#dword(0x03FF4038) = 0x0000000A
mww 0x03ff4038 0x0000000a
#======================================================================
#comment send NOP command
#dword(0x03FF403C) = 0x00030000
mww 0x03ff403c 0x00030000
#comment wait for command to complete
#comment send precharge command
#dword(0x03FF403C) = 0x00010000
mww 0x03ff403c 0x00010000
#comment wait for command to complete
#dword(0x03FF4040) = 0x00000014
mww 0x03ff4040 0x00000014
#comment wait for command to complete
#comment set the refresh timer back
#dword(0x03FF4040) = 0x00000168
mww 0x03ff4040 0x00000168
#comment wait for command to complete
#comment send Mode command
#dword(0x03FF403C) = 0x00020033 #0x00020003
mww 0x03ff403c 0x00020033
#comment set clock to be the fastest one
#dword(0x03FF0004) = 0x00
mww 0x03ff4004 0x00000000
flash info 0
flash write_image erase u-boot.bin 0x02000000
exit
}
내가 인터넷에서 찾은 정보와 각양각색의 시도가 틀렸다.아래와 같이 집행한다.
bash-3.2$ ../openocd -f ../ft232h.cfg -f ks.cfg -c flash_ks
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 15000 kHz
adapter speed: 6000 kHz
Info : auto-selecting first available session transport "jtag". To override use
'transport select <transport>'.
fast memory access is enabled
dcc downloads are enabled
Info : clock speed 6000 kHz
Info : JTAG tap: ks869x.cpu tap/device found: 0x00922f0f (mfg: 0x787 (<unknown>)
, part: 0x0922, ver: 0x0)
Info : Embedded ICE version 2
Info : ks869x.cpu: hardware has 2 breakpoint/watchpoint units
flash_ks
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x400000d3 pc: 0x00700a6c
MMU: disabled, D-Cache: disabled, I-Cache: enabled
... init routine ...
Info : Flash Manufacturer/Device: 0x00ad 0x2249
#0 : cfi at 0x02000000, size 0x00200000, buswidth 2, chipwidth 2
# 0: 0x00000000 (0x4000 16kB) not protected
# 1: 0x00004000 (0x2000 8kB) not protected
# 2: 0x00006000 (0x2000 8kB) not protected
# 3: 0x00008000 (0x8000 32kB) not protected
# 4: 0x00010000 (0x10000 64kB) not protected
# 5: 0x00020000 (0x10000 64kB) not protected
# 6: 0x00030000 (0x10000 64kB) not protected
# 7: 0x00040000 (0x10000 64kB) not protected
# 8: 0x00050000 (0x10000 64kB) not protected
# 9: 0x00060000 (0x10000 64kB) not protected
# 10: 0x00070000 (0x10000 64kB) not protected
# 11: 0x00080000 (0x10000 64kB) not protected
# 12: 0x00090000 (0x10000 64kB) not protected
# 13: 0x000a0000 (0x10000 64kB) not protected
# 14: 0x000b0000 (0x10000 64kB) not protected
# 15: 0x000c0000 (0x10000 64kB) not protected
# 16: 0x000d0000 (0x10000 64kB) not protected
# 17: 0x000e0000 (0x10000 64kB) not protected
# 18: 0x000f0000 (0x10000 64kB) not protected
# 19: 0x00100000 (0x10000 64kB) not protected
# 20: 0x00110000 (0x10000 64kB) not protected
# 21: 0x00120000 (0x10000 64kB) not protected
# 22: 0x00130000 (0x10000 64kB) not protected
# 23: 0x00140000 (0x10000 64kB) not protected
# 24: 0x00150000 (0x10000 64kB) not protected
# 25: 0x00160000 (0x10000 64kB) not protected
# 26: 0x00170000 (0x10000 64kB) not protected
# 27: 0x00180000 (0x10000 64kB) not protected
# 28: 0x00190000 (0x10000 64kB) not protected
# 29: 0x001a0000 (0x10000 64kB) not protected
# 30: 0x001b0000 (0x10000 64kB) not protected
# 31: 0x001c0000 (0x10000 64kB) not protected
# 32: 0x001d0000 (0x10000 64kB) not protected
# 33: 0x001e0000 (0x10000 64kB) not protected
# 34: 0x001f0000 (0x10000 64kB) not protected
CFI flash: mfr: 0x00ad, id:0x2249
qry: 'QRY', pri_id: 0x0002, pri_addr: 0x0040, alt_id: 0x0000, alt_addr: 0x0000
Vcc min: 2.7, Vcc max: 3.6, Vpp min: 0.0, Vpp max: 0.0
typ. word write timeout: 32 us, typ. buf write timeout: 1 us, typ. block erase t
imeout: 256 ms, typ. chip erase timeout: 8192 ms
max. word write timeout: 512 us, max. buf write timeout: 1 us, max. block erase
timeout: 8192 ms, max. chip erase timeout: 8192 ms
size: 0x200000, interface desc: 2, max buffer write size: 0x1
Spansion primary algorithm extend information:
pri: 'PRI', version: 1.0
Silicon Rev.: 0x0, Address Sensitive unlock: 0x0
Erase Suspend: 0x2, Sector Protect: 0x1
VppMin: 0.2, VppMax: 0.0
auto erase enabled
wrote 131072 bytes from file u-boot.bin in 2.937661s (43.572 KiB/s)
상기 설정은 완전히 접시 상태에서 구워지는 설정이다.만약 정확한 boot가 움직이고 있다면 초기화할 수 있다면 플래시ks의 초기화 mww 0x3ffe608 0xa0
mww 0x3ff4010 0x8fe00040
그냥 괜찮아요.OpenOCD의 설정 파일은 복잡해 지금까지 별로 사용하지 않았지만, 빨리 써서 잘 타지 않을까 걱정된다.
그나저나 위에서 작업하는 u-boot이 이거예요.
FreeBSD pkg의arm gcc4에서 ks8695lconfig로 구축할 수 있습니다.
urjtag과 오픈ocd에서는 공급업체와 제품 코드를 볼 수 있지만 CFI 정보가 보이지 않으면 어떤 주문이 필요합니까?
jtag> detectflash 0xffe00000
dev ID=22da man ID=00c2
urj_flash_amd_detect: mid 1000, did 1000
error: flash: mid != 0x01
OpenOCD는arm을 위주로 하지만 쓰기 속도가 매우 빠르다.UrJTAG는 다양한 구조가 대응하고 mps도 충실하지만 쓰기가 느리다.모든 목표가 사용할 수 있는 방법을 사용했다.별말씀을요. ARM의 20핀 JTAG를 MIPS의 14핀으로 바꾸는 치료구를 만들었는데 부품과 박스에 못 쓰는 경우가 있어 아쉬운 결과...
Reference
이 문제에 관하여(JTAG로 Flash 태우기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/yamori813/items/858fbd96fdd022373587텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)