How to flash an ATMEGA3209 with ATMEL ICE and STK600

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

Hi folks, I am working on a project where I am moving beyond the phase of using the evaluation board. 

I want to flash/upload my firmware to my ATMEGA3209 MCU.

 

I have the .HEX file, I installed MPLAB IDE, I have purchased an STK600 with socket, and I have an Atmel ICE debugger. Please see the photo below:

 

 

a) In MPLAB X, I opened my HEX file as a project, and I tried to select debug to flash it.

b) on STK600, I tried to connect the two 6-pin PDI headers using the in-package cable as instructed in the guide

c) my MCU is set up in the socket, which is set up on the stk600

and I am stuck here. 

 

Which port from ICE should I use? SAM or AVR and should I connect my ice debugger to the STK600? If so where should I make the connection? One post online was saying that I may need a 2x3 header to JTAG converter and connect my ICE to the JTAG input on the STK600, is that true?

Anyone who had done this before or can point to some instructions would be much thanked! I am no expert in embedded programming, especially moving away from the evaluation board.

 

Thanks in advance,

Regards.

This topic has a solution.

after all, I am still pretty bad at it

Last Edited: Fri. Sep 16, 2022 - 10:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can use the stk600 directly and eliminate the ICE if all.younwant to do is program the Flash.

 

To do this simply use the proper jumper cable for the interface you will use.

 

I am not sure if the 3209 issue SPI or PDI though. If PDI, then yeah you will need the ICE. 

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Ninjatuna123 wrote:
Which port from ICE should I use?
AVR

Ninjatuna123 wrote:
should I connect my ice debugger to the STK600?
No as STK600 has UPDI.

Ninjatuna123 wrote:
is that true?
No

 


UPDI Programming | STK600 AVR® Flash MCU Starter Kit User's Guide

 

edit :

Connect the Atmel-ICE.

Reason : mega3209 lacks STK600 in MPLAB X.

https://packs.download.microchip.com/#collapse-Microchip-ATmega-DFP-pdsc

unzip

open pdsc

search for mega3209 then 'at:tool'

 

UPDI Physical Interface | Atmel-ICE

 

edit2 :

Device Support | STK600 AVR® Flash MCU Starter Kit User's Guide

STK600 EOL 1-Sep'22 | AVR Freaks

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Fri. Sep 9, 2022 - 01:19 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you jgmdesign,

 

Yes, I do want to debug flash as I need the MCUs to be placed into my costumed board after programming. However my MPLAB wasn't able to find a valid debug tool when I tried to debug (only simulators are available), it finds my ICE when I plugged ICE into my PC. 

after all, I am still pretty bad at it

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

Thanks for the comment #gchapman, I am still not sure what to do with the pdsc files you were referring to:

Connect the Atmel-ICE.

Reason : mega3209 lacks STK600 in MPLAB X.

https://packs.download.microchip.com/#collapse-Microchip-ATmega-DFP-pdsc

unzip

open pdsc

search for mega3209 then 'at:tool

I installed microchip studio and tried to flash the device using device programming. I tried two ways:

 

First I use STK600 alone, photo below:

microchip studio did detect my tool, however, ATMEGA3209 isn't supported, I am stuck here(even after I installed updates in tools --> device pack manager)

 

 

I then tried to use Atmel ICE, connection shown as the photo below :

 

 

Microchip studio then complains that my device voltage is below 1.8V:

 

Am I still doing something wrong here or is my ICE malfunctioning? I did grab the ICE debugger from a garage. And does STK600 just not support ATMEGA3209? why did it list 3209 as a supported device in the datasheet then?

 

Thanks!

after all, I am still pretty bad at it

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

You're welcome.

Ninjatuna123 wrote:
I am still not sure what to do with the pdsc files you were referring to:
No action; reason - pdsc is simply where the data came from for my answer.

Ninjatuna123 wrote:
or is my ICE malfunctioning?
Maybe; try another AVRxt.

Ninjatuna123 wrote:
And does STK600 just not support ATMEGA3209?
mega3209 lacks STK600 in Microchip Studio.

 

P.S.

Transparency - I don't have a STK600.

Hope Jim can further aid.

 


Buying tinyAVR 1-Series and 2-Series Breakout Boards | GitHub - SpenceKonde/megaTinyCore: Arduino core for the tinyAVR 0/1/2-series - ...

mega4809 is in PDIP-40 :

ATMEGA4809-PF | Microchip Technology Inc. | World's Largest Inventory of Microchip Products

 

http://packs.download.atmel.com/#collapse-Atmel-ATmega-DFP-pdsc

         <device Dname="ATmega3209">
...
                  <at:tool id="com.atmel.avrdbg.tool.atmelice"/>
                  <at:tool id="com.atmel.avrdbg.tool.edbg"/>
                  <at:tool id="com.atmel.avrdbg.tool.edbgc"/>
                  <at:tool id="com.atmel.avrdbg.tool.ice4"/>
                  <at:tool id="com.atmel.avrdbg.tool.jtagice3plus"/>
                  <at:tool id="com.atmel.avrdbg.tool.jtagicemk3"/>
                  <at:tool id="com.atmel.avrdbg.tool.medbg"/>
                  <at:tool id="com.atmel.avrdbg.tool.nedbg"/>
                  <at:tool id="com.atmel.avrdbg.tool.pickit4"/>
                  <at:tool id="com.atmel.avrdbg.tool.powerdebugger"/>
                  <at:tool id="com.atmel.avrdbg.tool.snap"/>
                  <at:tool id="com.atmel.avrdbg.tool.simulator"/>

 

"Dare to be naïve." - Buckminster Fuller

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

gchapman wrote:
Hope Jim can further aid.

 

I am gonna try....

 

OK, the STK 600 supports the Mega3209.  You need the following items...

 

routing card:

STK600-RC048M-107

 

Socket Card:

STK600-QFN48

 

I may have a routing card if you need one.

 

Ninjatuna123 wrote:
Microchip studio then complains that my device voltage is below 1.8V:

 

You have the ICE connected wrong.  OR!  You have the STK 600 set fro the wrong supply voltage to the part.

 

LETS MAKE LIFE EASY.  Remove the ICE.  Go on.  Unplug it from the STK600 AND the PC.   Now put the ICE in a desk drawer and forget about it.....for now.

 

The STK600 comes with a little ribbon cable with an IDC connector on each end.  These connectors have 6 little holes in 2 rows of three.  Use this cable to connect the ISP/PDI header to the target header  that is also 6 pins.

 

Launch Studio, but DO NOT open your project.

 

Click on TOOLS>DEVICE PROGRAMMING

 

For TOOL, select STK600, DEVICE= Mega3209.  Click APPLY.

 

Click on BOARD SETTINGS.  There will be 4 sliders, make sure the VTarget slider is set for something between 4 and 5 volts. Then click WRITE.

Then click READ to get the boards CLOCK and Vref values, and check that VTarget is what you set it for.  Click WRITE again(just for teh hell of it really)

 

Now up in the TARGET VOLTAGE WINDOW area, click on the READ button to the right of the window.  You should get the value that you set in the Board Settings page. 

 

Next click the RED button next to the DEVICE SIGNATURE window.  You should get a series of letters and numbers. 

 

If you do, CONGRATS!  the STK600 and your device are talking!

 

Once you have the above steps working, click the FUSES menu item, the Mega will report back its settings.  Make changes as you see fit.

 

 

Once this i all done, click CLOSE.

 

NOW, load your project, BUILD it, if it builds without errors, then go back to TOOLS>DEVICE PROGRAMMING and set up the TOOL, DEVICE, and hit apply.

 

Then click on MEMORIES.  In teh FLASH section browse to your directory where your .HEX, or .ELF file are located and click PROGRAM.

 

If all the starts lign, you should see a SUCCESS! and your application will start executing in teh AVR.

 

 

Hope this helps,

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Ninjatuna123 wrote:
I have the .HEX file,
Ninjatuna123 wrote:
I do want to debug flash
Ninjatuna123 wrote:
wasn't able to find a valid debug tool when I tried to debug (only simulators are available)
If you really want to "DEBUG" and not just "PROGRAM" then it's not a HEX file you need it is an ELF file. (only the latter may(!) have debug symbols).

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

Keep in mind my instructions are only to get the STK600 working.  Once that is confirmed , I was going to move on to using the ICE.

 

jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Thanks, Jim,

 

I do have my routing card, and my socket card installed. Both sides of my ribbon cable are connected to the 6-pin header on the board. My problem lies here :

 

 after I launch the studio:

For TOOL, select STK600, DEVICE= Mega3209.  Click APPLY.

I selected STK600, but there is no option for MEGA3209. When I manually type it in, the studio tells me it is not supported. Photo below shows my setup and my problem:

 

 

 

Here is where I thought STK600 does not support mega3209.

after all, I am still pretty bad at it

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

Dont type in the part number.  Click teh little down arrow and scroll through the parts until you find your device

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Hi Jim,

 

There isn't 3209 in the device list when I use the latest microchip studio. I then installed an earlier version of Atmel studio and apparently it is too early that it only supports STK500.

 

I wonder which version of the studio you are using?

after all, I am still pretty bad at it

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

No.  I have it in my studio.

 

Make sure you download the device pack.  It should be there.

 

Not in Front of my PC at the moment.  I'll post a screenshot in an hour or so.

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Thanks Jim.

 

I checked my device pack and it is installed. It seems like STK600 does not find devices that use AVR8x core, or any device that uses UPDI programming (4809 isn't there, and neither does 809...)

after all, I am still pretty bad at it

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

Some AVRxt have STK600.

http://packs.download.atmel.com/#collapse-Atmel-ATtiny-DFP-pdsc

         <device Dname="ATtiny817">
            <processor Dcore="AVR8X"
...
                  <at:interface type="updi" name="UPDI"/>
                  <at:tool id="com.atmel.avrdbg.tool.atmelice"/>
                  <at:tool id="com.atmel.avrdbg.tool.edbg"/>
                  <at:tool id="com.atmel.avrdbg.tool.edbgc"/>
                  <at:tool id="com.atmel.avrdbg.tool.ice4"/>
                  <at:tool id="com.atmel.avrdbg.tool.jtagice3plus"/>
                  <at:tool id="com.atmel.avrdbg.tool.jtagicemk3"/>
                  <at:tool id="com.atmel.avrdbg.tool.medbg"/>
                  <at:tool id="com.atmel.avrdbg.tool.nedbg"/>
                  <at:tool id="com.atmel.avrdbg.tool.pickit4"/>
                  <at:tool id="com.atmel.avrdbg.tool.powerdebugger"/>
                  <at:tool id="com.atmel.avrdbg.tool.snap"/>
                  <at:tool id="com.atmel.avrdbg.tool.stk600"/>
                  <at:tool id="com.atmel.avrdbg.tool.simulator"/>

 

"Dare to be naïve." - Buckminster Fuller

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

Yes. ATiny817 is found in stk600 devices support in the studio, I double-checked STK600's data sheet, and ATMEGA3209 is on the supported device list, not sure why I couldn't find it

after all, I am still pretty bad at it

Last Edited: Fri. Sep 16, 2022 - 08:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guesses :

  • STK600 firmware lacks
  • STK600 testing lacks
  • STK600 EOL (no further effort)
  • pdsc typo

Recommend creating an issue.

Microchip/Atmel support page | AVR Freaks

 

"Dare to be naïve." - Buckminster Fuller

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Probably one of them. So I got it to read my ICE with the correct voltage, this is what happened:

 

1) (i think) stk600 does not support 3209. So in order to program, I do indeed need the ICE

2) My ICE connection isn't wrong. STK600 VTG start-up with 1.1V, and since it does not support 3209, the option in the studio for me to adjust the voltage isn't available. Correct me if I am wrong Jim.

3) So to make it work, I would need an external power for VTG (i used an arduino), and remove the VTARGET header. power on the stk600, and connect my ICE. And it is now reading the correct voltage.

 

I have to step aside for a few hours but will return to try to finish the rest of the steps before closing this thread. My 300 dollar sstk600 board is now a fancy socket laugh

 

Verifying flash ok.... so I think writing the firmware into my MCU part is working OK now. Thanks for all the help folks. I may write to Microchip and have them double-check and correct the supported device. 

 

 

 

after all, I am still pretty bad at it

Last Edited: Fri. Sep 16, 2022 - 10:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I dunno.  I have it in my drop down for my stk600.  But whatever.

 

I think there is something else going on.  Make sure you have the latest device packs installed for example.

 

The 3209 shows up in the device support table for the STK600 so I don't understand why your having the issue. 

 

I would.love to see a screenshot of what you get when you scroll through the devices.  If you get a list, then I am.pretty sure the 3209 is in there.

 

Also, I am pretty sure you. An set the voltage regardless of the processor being there or not.  Have not had to check this.

 

Lastly, you might want to try and force an firmware upgrade for the STK600

 

Jim

 

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Please post AS7.0 version number from Help About menu e.g. 7.0.2594

STK600 firmware version from Available Tools

AS7.0 Pack version from mega3209 project Properties

 

I don't have STK600 nor m3209 but I  am pretty sure it is a question of updating software.

 

Your photos look like the cards are securely fitted i.e. plastic tabs rotated to lock.

Make sure that there is no fluff or grime on the connections.

 

David.

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

Hi Jim and David,

 

My AT studio version is 7.0.2389. For stk600 firmware version I am not sure if this is what you are referring to but following the STK600 text in the tool tab is 0051E8EA00D2. I think you guys are correct that probably some package isn't updated.

 

 

after all, I am still pretty bad at it

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

Ninjatuna123 wrote:
0051E8EA00D2
serial number?

STK600 is in Tool Information | Microchip Studio

"Dare to be naïve." - Buckminster Fuller