-
AtmelStudio์ AVRISP_2 ์๋ฌSoliloquy 2020. 4. 1. 14:59
๐
์ฝ 100๊ฐ์ JKIT๋ผ๋ ATmega128A๊ฐ ์ฅ์ฐฉ๋ ๊ต์ก์ฉ ํคํธ์ ํ๋์จ์ด ์ํ๋ฅผ ๊ฒ์๋ฅผ ํด์ผ ํ๋ ์ผ์ด ์์๋ค. ๋ถ์ ์ผ๋ก ๊ฒ์์ฉ ์ฝ๋๋ฅผ ์ง๊ณ ๊ทธ ์ฝ๋๋ฅผ ํ ๋๋ก ํคํธ์ ๋ฒ์ ๋ 7 ์ธ๊ทธ๋จผํธ, ๋ฒํผ ๋ฑ์ด ์ ์๋๋๋์ง ํ์ธํ๋ ์ผ์ ํ๋ค.
JKIT ๋ชจ์ต ์๋ 1๋ ์ ๊น์ง๋ง ํด๋ ์ ์ฐ๊ณ ์์๋ ํคํธ๋ค์ด์ด์, ์๋์ด ์ ์ ๋๋ ์ผ์ ์์ผ๋ฆฌ๋ผ ์๊ฐํ์์ง๋ง 100๊ฐ ์ค 2๊ฐ์ ํคํธ๊ฐ AtmelStudio์ Device Programming ๋๊ตฌ๊ฐ ์๋์ด ์ ์ ๋๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์๋ค. ๋ด๊ฐ ๊ฒช์ ์ค๋ฅ๋ 'Unable to connect to tool STK500'๋ผ๋ ์ค๋ฅ๋ฅผ ๋ด๋ฉด์ ์ฐ๊ฒฐ์ด ๋์ง ์๋ ๋ฌธ์ ์๋ค.
โ Unable to connect to tool STK500 (COM9)
Timestamp: 2020-04-01 13:36:11.740
Severity: ERROR
ComponentId: 20100
StatusCode: 1
ModuleName: TCF (TCF command: Tool:connect failed.)The signature of the attached tool is AVRISP_2, which is unexpected.
๋ด๊ฐ ๊ฒช์ ์ค๋ฅ ๋ฉ์์ง
ํน์๋ ํด์ USB ์ผ์ด๋ธ๋ ๊ต์ฒดํด ๋ณด์์ง๋ง, ์ค๋ฅ๊ฐ ๋ํ๋๋ ๊ฒ์ ๋์ผํ์๋ค. AtmelStudio์ Codevision์ ๋์์ ๋ฌด์จ ์ฐจ์ด๊ฐ ์๋?๋ผ๋ ์๊ฐ์ Codevision์ ์ค์นํ์ฌ Codevision์ผ๋ก ํ๋์ฑ์ ํด๋ณด์๋๋, Codevision์ ์ ๋์ํ๋ค. ์ด ๋ง์ ํ๋์ฑ ์์ฒด์๋ ํฐ ๋ฌธ์ ๊ฐ ์๋ค๋ ์๋ฏธ์๋ค.
๋ฌธ์ ํ์
์ด๋ฌํ ๋ฌธ์ ๊ฐ ๋ํ๋ ์์ธ์ ์ฐพ๊ธฐ ์ํด์ ์๋ฌ ๋ฉ์์ง๋ฅผ ์ดํด๋ณด์๋ค. ์๋ฌ ๋ฉ์์ง ์๋ฏธ๋ AVRISP_2์ ํด๋นํ๋ ๋๊ตฌ๋ฅผ ์ฐพ์ ์ ์๋ค๋ ๋ง์ด์๋ค. AVRISP_2๋ ๋์ฒด ๋ฌด์์ผ๊น? ํน์ ํคํธ์ ํ์จ์ด์ ๋ด๊ฐ ์ํ๋ ๋ต์ด ์์ง ์์๊น? ํ์ฌ Codevision์ Chip Programmer์ ์๋ Programmer's Firmware ํ์ธ ๊ธฐ๋ฅ์ ์คํ์์ผ๋ณด์๋ค. ๊ทธ๋ฆฌ๊ณ ๋ฌธ์ ํด๊ฒฐ์ ์ค๋ง๋ฆฌ๋ฅผ ์ฐพ์๋ผ ์ ์์๋ค.
AtmelStudio์์ ์๋์ด ์ ๋๋ ํ์จ์ด AtmelStudio์์ ์๋์ด ์ ๋์ง ์๋ ํ์จ์ด ๋ ํ์จ์ด์ ์ ๋ณด๊ฐ ๋ฌ๋๋ค. AtmlStudio์์ ์ ์๋์ด ๋๋ ํ์จ์ด๋ STK500 Firmware๋ฅผ ํ์ํ๊ณ ์์๊ณ , ๋ฐ๋๋ก ์๋์ด ์ ๋์ง ์๋ ํ์จ์ด๋ AVRISP Firmware๋ฅผ ํ์ํ๊ณ ์์๋ค. ํ์จ์ด ๋๋ฌธ์ ๋์ง ์๋ ๊ฒ์ด ๊ฑฐ์ ๋ถ๋ช ํด ๋ณด์๋ค. ๊ทธ๋ ๋ค๋ฉด ํ์จ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํ ๋ฐฉ๋ฒ์ ์ด๋ค ๊ฒ์ด ์์๊น? ํ์ฌ ์ธํฐ๋ท์ ์ด์ฌํ ์ฐพ์๋ค๋ ๋ค.
๊ทธ ๊ฒฐ๊ณผ ๋์ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๊ฐ์ง ์ฌ๋๋ค์ ์ฐพ์ ์ ์์๊ณ , ์ด๋ฌํ ๋ฌธ์ ๋ ํ์จ์ด์ ์ ํ Programmer Model ํ์จ์ด์ ์ด๋ฆ ๋๋ฌธ์ ๋ฐ์ํ๋ ๊ฒ์ด ํ์คํด ๋ณด์๋ค. ๋ํ Pololu๋ผ๋ ํคํธ ์ ์ ์ ์ฒด์์๋ AtmelStudio 5 ์ด์์ ๋ฒ์ ์์ ์๋์ ์ํํ ํ๊ธฐ ์ํด Chip Programmer Signature๋ฅผ ๋ด๊ฐ ์ฌ์ฉ ์ค์ธ ํคํธ์ ๋์ผํ 'AVRISP_2'์์ 'STK500_2'๋ก ๋ฐ๊ฟจ๋ค๋ ๊ธฐ๋ก๋ ์์๋๋ฐ, ์ด๋ฅผ ๋ฏธ๋ฃจ์ด ๋ณด์์ ๋, AVRISP_2๋ ๊ณต์์ ์ผ๋ก AtmelStudio ๋ฒ์ 4 ๊น์ง๋ง ์ง์ํ๋ ๊ฒ ๊ฐ๋ค.
๊ทธ๋ ๋ค๋ฉด JKIT ํ์จ์ด๋ฅผ ๋ฐ์์ ๋ด๊ฐ 'AVRISP_2'๋ฅผ 'STK500_2'๋ก ์์ ํ๋ฉด ๋์ง ์์๊น? ํด์ ํ์จ์ด๋ฅผ ๊ฒ์ํด ๋ณด์์ง๋ง, ์ฐพ์ ์ ์์๋ค.
ํน์ฌ๋ ๊ณต์ ๊ธฐ ํ์จ์ด ์์ ๋์ฒ๋ผ ํ์จ์ด๋ฅผ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ด ์์๊น?๋ผ๋ ์๊ฐ์ ์ถ์ถ ๋ฐฉ๋ฒ์ ์ฐพ์๋ณด์๊ณ , AVRProg๋ผ๋ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ํ์จ์ด ํ์ผ์ ํคํธ์ ์ฌ๋ฆด ์ ์๋ค๋ ๋ง๋ ์ฐพ์์ง๋ง, ํด๋น ํ๋ก๊ทธ๋จ์ด ํ์ฌ ์ง์์ด ์ค๋จ๋ ์ํ๋ผ ๊ทธ๋ฐ์ง ๊ด๋ จ ์ ๋ณด๊ฐ ๋ง์ด ๋ถ์กฑํ์๋ค.
๊ฒฐ๊ตญ, ํ์จ์ด ์์ ์ ๋ค๋ก ๋ฏธ๋ค์ผ๋ง ํ๋ค.
AtmelStudio ํ์ผ ์์
ํน์๋ AtmelStudio ํ์ผ ์ผ๋ถ๋ถ์ ์์ ํ๋ฉด ์ฌ์ฉํ ์ ์์ง ์์๊น?๋ผ๋ ์๊ฐ์ ํด๋น ์๋ฌ ๋ฉ์์ง๋ฅผ ํ ๋๋ก ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ฐพ์๊ฐ๊ธฐ๋ก ํ์๋ค. ๊ทธ๋ฆฌ๊ณ ๋ป ๋ฐ์๋ ํ ๋ธ๋ก๊ทธ์์ ํฅ์ค ์๋ํฐ๋ฅผ ์ด์ฉํ ๋ฐฉ๋ฒ์ ์ฐพ์ ์ ์์๋ค. 1
ํด๋น ๋ธ๋ก๊ทธ์์ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ ์ ๋ฆฌํ๋ฉด ์๋์ ๊ฐ์๋ค.
- STK ์ฐ๊ฒฐ์ ๋ด๋นํ๋ DLL ํ์ผ์ธ com_atmel_hil_stk.dll ํ์ผ์ ํฅ์ค ์๋ํฐ๋ก ์ฐ๋ค.
(7.0 ๊ธฐ์ค ์์น: %PROGRAMFILES(x86)%\Atmel\Studio\7.0\atbackend\codeCache) - com_atmel_hil_stk.dll ํ์ผ์ ๋ฐฑ์ ํ๋ค.
- dll ํ์ผ์ ํฅ์ค ์๋ํฐ๋ก ์ฐ ๋ค์ STK500_2 ๋ถ๋ถ์ ์ฐพ๊ณ ํด๋น ๋ถ๋ถ์ AVRISP_2๋ก ์์ ํ๋ค.
ํฅ์ค ์๋ํฐ์ธ HxD๋ก ์ฐ ๋ชจ์ต ํด๋น ๋ถ๋ถ์ ์์ ํ ๋ชจ์ต ์์ ์ ๋ง์น ํ, ์ ๋ง ์์ ํ ๋ฒ์ผ๋ก ๊ณจ๋จธ๋ฆฌ๋ฅผ ์ฉํ๋ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋ ๊น? ํด์ AtmelStudio๋ฅผ ์คํ์์ผ ๋ณด์๋๋ฐ, ๋๋๊ฒ๋ ์๋์ด ์ ๋๋ค. ๋ค๋ง, ๊ธฐ์กด์ AtmelStudio๊ฐ ์ ์๋๋๋ ์นฉ์ ์ฌ์ฉํ์ง ๋ชปํ๊ฒ ๋์๋ค๋ ๋จ์ ์ด ์์๋ค. STK500 ๋ณด๋๋ฅผ ์ฌ์ฉํ ๋์๋ ์ด์ ์ ๋ฐฑ์ ์ ํด๋์๋ ์๋ณธ DLL ํ์ผ๋ก ๊ต์ฒด๋ฅผ ํด์ผ๋ง ํ๋ค.
์ฐ๊ฒฐ์ด ์ ์์ ์ผ๋ก ๋ ๋ชจ์ต ํ์จ์ด๋ฅผ ์์ ํ๋ ๊ฒ์ด ๊ทผ๋ณธ์ ์ธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด๊ธด ํ๋, ๊ทธ๋ฌ์ง ๋ชปํ๋ ๊ฒ ์์ฝ๋ค.
ํน์ฌ๋ ํด๋น DLL ํ์ผ๋ค์ ํ์๋ก ํ๋ ์ฌ๋์ด ์์์ง ๋ชจ๋ฅด๊ฒ ์ง๋ง, ์๋์ ๊ฐ์ด DLL ํ์ผ๋ค์ ์ ๋ก๋ํ์๋ค. ์ฌ์ฉํ AtmelStudio์ ๋ฒ์ ์ 7.0.2397 ๋ฒ์ ์ด๋ค. ์ ๋ก๋๋ ํ์ผ ์ค .dll ํ์ผ์ ์์ ๋ ํ์ผ์ด๋ฉฐ, .bak ํ์ผ์ ์๋ณธ ํ์ผ์ด๋ค.
com_atmel_hil_stk.dll.bak1.80MB์ฌ๋ด
ํ์จ์ด๋ฅผ ํ์ธํ๋ ๋ฐฉ๋ฒ์ CodevisionAVR Chip Programmer ๋ง๊ณ ๋ avrdude๋ผ๋ ํ๋ก๊ทธ๋จ์ ํตํด์๋ ํ์ธํ ์ ์์๋ค. ์ฌ์ฉ ๋ฐฉ๋ฒ์ ์๋์ ๊ฐ์๋ค.
avrdude.exe -c {ํ๋ก๊ทธ๋๋จธ ์ข ๋ฅ} -p {MCU์ข ๋ฅ} -P {ํฌํธ๋ฒํธ} -v
avrdude๋ฅผ ํตํ ํ์จ์ด ์ ๋ณด ํ์ธ
๋์ ๊ฒฝ์ฐ์๋ avrdude.exe -c stk500 -p ATmega128 -P COM9 -v ๋ฅผ ํตํ์ฌ ํ์ธํ ์ ์์๋ค.
AVRISP_2 ํคํธ์ ๊ฒฝ์ฐ ๋ํ๋๋ ์ ๋ณด๋ ์๋์ ๊ฐ์๋ค.
๋๋ณด๊ธฐavrdude.exe: Version 6.0.1, compiled on Sep 18 2013 at 08:20:41
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg WunschSystem wide configuration file is "C:\Users\...\Desktop\avrdude.conf"
Using Port : COM9
Using Programmer : stk500
AVR Part : ATmega128
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 12 64 0 no 4096 8 0 9000 9000 0xff 0xff
flash 33 6 128 0 yes 131072 256 512 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00Programmer Type : STK500V2
Description : Atmel STK500
Programmer Model: AVRISP
Hardware Version: 2
Firmware Version Master : 2.18
Vtarget : 0.0 V
SCK period : 1.1 usavrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude.exe: Device signature = 0x1e9702
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as 99
avrdude.exe: safemode: efuse reads as FFavrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as 99
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: safemode: Fuses OK (H:FF, E:99, L:FF)avrdude.exe done. Thank you.
STK500_2 ํคํธ์ ๊ฒฝ์ฐ ๋ํ๋๋ ์ ๋ณด๋ ์๋์ ๊ฐ์๋ค.
๋๋ณด๊ธฐavrdude.exe: Version 6.0.1, compiled on Sep 18 2013 at 08:20:41
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg WunschSystem wide configuration file is "C:\Users\...\Desktop\avrdude.conf"
Using Port : COM9
Using Programmer : stk500
AVR Part : ATmega128
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 12 64 0 no 4096 8 0 9000 9000 0xff 0xff
flash 33 6 128 0 yes 131072 256 512 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00Programmer Type : STK500V2
Description : Atmel STK500
Programmer Model: STK500
Hardware Version: 2
Firmware Version Master : 2.18
Topcard : Unknown
Vtarget : 0.0 V
SCK period : 2.2 us
Varef : 0.0 V
Oscillator : Offavrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude.exe: Device signature = 0x1e9702
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as 91
avrdude.exe: safemode: efuse reads as FFavrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as 91
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: safemode: Fuses OK (H:FF, E:91, L:FF)avrdude.exe done. Thank you.
- ํ์ฌ ํด๋น ๋ธ๋ก๊ทธ๋ ์ ๊ฑฐ๋์ด์ ๋ด์ฉ์ ํ์ธํ ์๋ ์์ง๋ง, ๋คํํ ๊ตฌ๊ธ ์บ์ ์๋ฒ์ ์ ๋ณด๊ฐ ๋จ์ ์์ด์ ๋ด์ฉ์ ํ์ธํ ์ ์์๋ค. [๋ณธ๋ฌธ์ผ๋ก]
- STK ์ฐ๊ฒฐ์ ๋ด๋นํ๋ DLL ํ์ผ์ธ com_atmel_hil_stk.dll ํ์ผ์ ํฅ์ค ์๋ํฐ๋ก ์ฐ๋ค.