Installing STK500.exe without AVRStudio

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo together,
I hope I have selected the right forum and I'm not off topic. Sorry for my english - I'm german.

 

Since a few days, I try to "install" STK500.exe to run without an installed "AVR Studio". I need
this to run STK500.exe as a production-programmer in our fabrication. (run 4 instances as "gang programmer")

 

What did I do until yet?
- I copyed the directory "STK500" from my PC (where AVR Studio 4.18 is installed) to a PC at the fabrication
- I registerd "AvrCommon.dll" and "Stk500Common.dll"" (regsvr32.exe AVRCommon.dll and regsvr32.exe Stk500Common.de)
- I found out that i have to copy "SComm.dll" to the Production-PC
- I registerd "SComm.dll" since that, there i a USB-Communication between ASTK500.exe an my "AVR ISP mk II(clone)"

 

So far so good:
- I start my Batch-File

 

+--------------------------------------------------------------------+
|                                                                    |
| C:\TestProject>ISPProgrammer 1                                     |
|                                                                    |
| ~ STK500 command line programme, v 2.3 Atmel Corp                  |
| ~ Connected to AVRISP mkII on port USB:000200090638                |
| ~ Setting ISP frequency to 125.0 Khz                               |
| ~ Could not load device parameters for ATMEGA328                   |
|                                                                    |
| C:\TestProject>                                                    |
|                                                                    |
+--------------------------------------------------------------------+

 

AND NOW THE PROBLEM:
!!! Could not load device parameters for ATMEGA328 !!!

 

I'm searching for a soulution to make STK500.exe to find the "Partdescriptionfiles"

 

I already tryed:
- copy all .xml-Files to the "C:\SKT500"-Directory
- copy all .xml-Files to a folder called "Partdescriptionfiles" in "C:\"

- copy all .xml-Files to a folder called "Partdescriptionfiles" in the SKT500-Directory
- add the Partdescriptionfiles-Directory to the searchpath

 

When I'm installing ACVRStudio to the ProductionPC - then it works fine, but i don't like to install
"programms" never used to all the PCs in our Electronic-Production.

 

I reed this article too:
http://www.avrfreaks.net/forum/s...
but it stops at the Partdescriptionfiles-Problem

 

Thanks a lot
regards
Robert

 

----------------------------------------------------------------------------------------------------
:StartOfBatch
@echo off
MODE CON:cols=40 lines=25
COLOR F0
TITLE STK500/MKII GANGPROGRAMMER/Instanz "%1"
cls

:STK500
set PrgPath="C:\STK500"

:Programmer
REM USBPortIDs für Aufruf von 4 Instansen setzen
if %1==4 set USBPortID=000200090639
if %1==3 set USBPortID=000200090638
if %1==2 set USBPortID=000200090637
if %1==1 set USBPortID=000200090636

set Port=USB
set PrgMode=s
set ISPFrq=125kHz
:Projekt
set Device=ATMEGA328
set ProjektPath=%~dp0
set HexFile=S12A_HWT_BL.%1.hex
set EEPFile=S12A_HWT.eep

set lfuse=E2
set hfuse=CC
set efuse=FC
set lock=EC
set Fuses=%hfuse%%lfuse%

del %0.%1.err
goto start1
goto EndeBatch

:start1
%PrgPath%\stk500.exe -c%Port% -m%PrgMode% -I%ISPFrq% -d%Device% -e -f%Fuses% -E%efuse% -f%Fuses% -G%efuse%
if %errorlevel%==1 goto ErrorFuses
echo fertig Fuses

%PrgPath%\stk500.exe -c%Port% -m%PrgMode% -I%ISPFrq% -d%Device%    -pb -if%ProjektPath%\%HexFile% -ie%ProjektPath%\%EEPFile%
if %errorlevel%==1 goto ErrorHexFile
%PrgPath%\stk500.exe -c%Port% -m%PrgMode% -I%ISPFrq% -d%Device%    -vb -if%ProjektPath%\%HexFile% -ie%ProjektPath%\%EEPFile%
if %errorlevel%==1 goto ErrorHexFile
echo fertig Hex/EEP-File

%PrgPath%\stk500.exe -c%Port% -m%PrgMode% -I%ISPFrq% -d%Device%    -l%lock%  -L%lock%
if %errorlevel%==1 goto ErrorLockbits
echo fertig LockBit

goto EndeBatch

:ErrorFuses
echo Fehler beim "Fuses" programmieren : Errorlevel=%errorlevel%
goto ErrorEnd

:ErrorHexFile
echo Fehler beim "Hex/EEP-File" programmieren : Errorlevel=%errorlevel%
goto ErrorEnd

:ErrorEEPFile
echo Fehler beim "EEP-File" programmieren : Errorlevel=%errorlevel%
goto ErrorEnd

:ErrorLockbits
echo Fehler beim "Lockbits" programmieren : Errorlevel=%errorlevel%
goto ErrorEnd

:ErrorEnd
pause

:EndeBatch
echo %errorlevel% >%0.%1.err
pause
----------------------------------------------------------------------------------------------------

Regards
Robert
(AumuellerKEE4)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Silly question but wouldn't it just be easier to replace stk500.exe with avrdude.exe ? They both achieve the same thing but avrdude is much easier to install!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't "copy in". That is a hit'n'miss wild goose hunt.

 

Suggested approach: Do a complete install of Atmel Studio. Make a backup copy of the installation folder tree.

 

Remove stuff that you think is not needed. Test. If things you need have stopped functioning then revert to the backup. If things are still working then take a new backup.

 

Repeat until satisfied.

 

Also:

 

- Study environment variables on the system with a complete install, to see if there is something e.g. pointing to specific directories involved.

 

- Ditto contents in registry.

 

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo and thanks to both clawson and JohanEkdahl

 

a) clawson

I have already running avrdude on some other systems. They are running well with some limtitation:

 

In my batchkob i call "avrdude" three times one after another but when i do the second call avrdude hangs

   it seems that the first avrdude-job returns but the programmer ist't ready

 

Batchjob1.bat

   c:\avrdude\avrdude.exe ...-p fuses

   c:\avrdude\avrdude.exe ...-p flash

   c:\avrdude\avrdude.exe ...-p eeprom

doesn't work

 

Batchjob2.bat

   c:\avrdude\avrdude.exe ...-p fuses

   DosDelay(500msec)

   c:\avrdude\avrdude.exe ...-p flash

   DosDelay(500msec)

   c:\avrdude\avrdude.exe ...-p eeprom

works

 

This is on Windows 7 Professional machines with 32 Bit Windows installed. "DosDelay" is a programm writen by me

that only delays the batchjob ...

 

The programming PCs now I'm working on are Windows 7 Professional machines with 64 Bit Windows installed

and have not found any working solution to make the "libusb" driver run under Windows x64

 

b) JohanEkdahl

I will try it tomorow when I'm back in the office. I hav alreday a quick look to the path variable and seach the

registry for "Partdescriptionfiles".

But installing avrstudio and deleteing it step by step seems to be a good idea.

I have found in the mikrocontrollerforum that some other dll must copyed, this dlls are already in the stk500

directory, but i can't register themn at the moment. regsvr32: The dll is found but ther ist no vaild entrypoint to

the dll found.

I think there are dependeces.

 

Regards

thanks a lot

RObert

 

 

 

 

Regards
Robert
(AumuellerKEE4)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AumuellerKEE4 wrote:
I have found in the mikrocontrollerforum that some other dll must copyed, this dlls are already in the stk500 directory, but i can't register themn at the moment. regsvr32: The dll is found but ther ist no vaild entrypoint to the dll found.

 

Just because a file is a DLL it is not necessary it is intended to be registered as a COM server. DLLs where present before the COM/OLE/COM+/DCOM... technology surfaced, with (more basic) linking mechanisms than what the COM model offers.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo community,

I have found a solution that works on serveral (virtual Machines) Systems  but it dosen't work on our two produktion machines(*). :-(

(I wrote this to finish the thread and give my knowledge to anyone who is interessted in)

 

Here my soulution:

- Install the JungoDriver (AVRJungoUSB.exe)

- Copy the Folder "...\STK500" from AVRStudio to your "programmfolder" e.g. C:\STK500

- Copy the Folder "...\STK500\Partdecriptionfiles" from AVRStudio to your "programmfolder" e.g. C:\STK500\\Partdecriptionfiles

- Copy the DLLs "AvrCommon.dll", "STK500Commenon" (from AVRStudio) and "SComm.dll" (from USBJungo) to C:\STK500

- Register the three dll's from above: "regsvr32.exe dllname.dll"

- Export the key "HKLM\Software\Wow6432\Atmel\AVRTools\ from an existing AVR-Studio installation

- Reimport the registrykey to your destiantion pc

- Modify the path in the new registry entry

* HKLM\Software\Wow6432\Atmel
  AVRToolsPath   Reg_SZ C:\ST500\
  AVRToolsPlugin Reg_SZ C:\ST500\
  StudioPath     Reg_SZ C:\ST500\
* HKLM\Software\Wow6432\Atmel\STK500 angepasst:
  IniPath        Reg_SZ C:\ST500\
  STK500Path     Reg_SZ C:\ST500\
  UpgradePath    Reg_SZ C:\ST500\

You can get my registry-export here: https://www.mikrocontroller.net/...

 

Now STK500 should run on a system without installing AVRStudio. My be it is easier to install "AVRStudio" and use only "STK500" ;-)

 

(*) On this machines I can't register SComm.dll. May be this depends on the windows installtion that have some strange effects

 

Regards

Robert

 

Regards
Robert
(AumuellerKEE4)

Last Edited: Mon. Mar 7, 2016 - 09:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't need to guess regarding dependencies between .exe's and .dll's. Use DependencyWalker.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo Johan,

thanks for the answer.

I already used  DependencyWalker but it seems that all dependencies are exisiting. But i only looked for the first two "dependencies levels".

Deep dependencies I dont check at the moment. When i have some time left I have anohter look.

 

Regards Robert

 

Regards
Robert
(AumuellerKEE4)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

NOTE by me:

I found a solution for the problem with registering "scomm.dll"

 

If "scomm.dll" can't be registerd in my case "WDAPI1011.dll" in "C:\Windows\SysWOW64" was missing!

I only copied this dll to the specified folder and after that scomm.dll could be registerd.

 

Strange: WDAPI1011.dll ist installed on my virtual machines "Win 7 x64 pro SP1" and it was missing

on my productive maschines. "Win 7 x64 pro SP1". I thin the updates on both machines should me made!

 

And a little bit unknowable for me: Dependency Walker show on both systems (the workin one - and the

none working one) that "WDAPI1011.dll"ist missing.

 

 

Regards Robert

Regards
Robert
(AumuellerKEE4)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Still puzzled to know what it is that stk500.exe is going to offer that avrdude.exe does not?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Clawson,

thank for your remark.

I have running AVRDUDE on some other systems - (Problem Delay: Look Back to Entry #4 of this thread).

 

I havn't found the time to modify my batchjob to make AVRDUDE to flash -fuses -flash and -eep by starting AVRDUDE at once!

 

Regards ROBERT

 

cls
rem @echo off
:AVRDUDE
set PrgPath=\\wfs01\Projekte\Q_Kontrolle\Pruefstaende\PRE\ICT\_AVRDUDE
:Programmer
set Programmer=avrispmkII
set Port=usb
:Projekt
set Device=m16
set ProjektPath=T:\Projekte\2-MZ\RM6_Relaismodul\2_Software
set HexFile=RM6Kernal.hex
set EEPFile=IOMKern.eep
set lfuse=0x3F
set hfuse=0xD9
set efuse=0xFF
set lock=0x2C

goto start1
goto EndeBatch

:start1
%PrgPath%\avrdude -c %Programmer% -P %Port% -B 100 -p %Device% -e -U lfuse:w:%lfuse%:m -U hfuse:w:%hfuse%:m
if %errorlevel%==1 goto ErrorFuses
%PrgPath%\DosDelay 500

%PrgPath%\avrdude -c %Programmer% -P %Port% -B 20  -p %Device% -D -U flash:w:%ProjektPath%\%HexFile%:i
if %errorlevel%==1 goto ErrorHexFile
%PrgPath%\DosDelay 500

%PrgPath%\avrdude -c %Programmer% -P %Port% -B 150 -p %Device%    -U eeprom:w:%ProjektPath%\%EEPFile%:i
if %errorlevel%==1 goto ErrorEEPFile
%PrgPath%\DosDelay 500

%PrgPath%\avrdude -c %Programmer% -P %Port% -B 100 -p %Device%    -U lock:w:%lock%:m
if %errorlevel%==1 goto ErrorLockbits

 

Regards
Robert
(AumuellerKEE4)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo community,

I have investet some time to finish the work on this problem. (I was interested why it dont'n work so I declared it as advanced training.)

The problem was that SComm.dll could not be registrated. Doning some research work I found out that on my productiv system

Microsoft Visual C++ 2008 Redistributable was not installed - after installing my dll could registerd and STK500 with a MKII-Clone runs

without problems.

 

So far the final information for all interested people.

Here you can find the problem descripted in german: https://www.mikrocontroller.net/... => https://www.mikrocontroller.net/...

 

Regards Robert

 

 

 

 

 

Regards
Robert
(AumuellerKEE4)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo

Here some words of explanation. The question always repeats:

WHY I DO NOT USE AVRDUDE.

 

I'm am using AVRDUDE on our automatich testsystem and I'm happy with it.

The testsystems runs under Win7 x86.

 

In addition to the testsystem we have "chip-programming" workstations. SInnce the PCs there

are changes this systems runs under Win7x64

 

And that my problem: On this systems AVRDUDE doesn't run. I havn't found a simple

soultion to get AVRDUDE to work here.

 

- The problem is the LIBUSB-Driver don't run under x64.

 

I habe already tryed to use "DriverSignatureEnhancer" to sign the driver

but ist want'sfruitful.

 

In future i doesn't what zu support two differnt "programming systems" they should be the

the in the complete production department

 

Regards


 

Regards
Robert
(AumuellerKEE4)