Calling atprogram from a C++ program

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

I have the Atmel ICE 7.0 studio installed and able to use the atprogram command line option to program my AVR board. I am now looking for a way to automate the process using C++ and not have to startup a StudioCommandPrompt and then call a batch file or enter each line to program my AVR device. Is there any URL to documentation to call the function directly or calling the atprogram within my C++ program.

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

Don't you just use std::system() or execve() or execl() or similar?

 

If you want to catch the stdout/stderr output then consider popen().

 

(while a dedicated C junkie if I want to write this kind of wrapper in this day and age I'd choose Python not C - it has all the popen() kind of stuff wrapped in the subprocess() class)

Last Edited: Mon. Oct 31, 2016 - 09:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My current platform is Windows 7 64bit, I would be using system() for the call.

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

Then you already know the answer? In which case I must be missing the subtlety of what it is you are actually asking here?

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

I'm trying to call the atprogram directly without having to start the Studio Command Prompt shell to execute the atprogram code. 

I'm sure I just missing some directory path to have my C++ program do the call.

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

${install dir}/atbackend/atprogram.exe ?

I have to agree with cliff, C++ seems like an odd choice...

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

Yes, the "${install dir}/atbackend/atprogram.exe ?" was the piece I needed to get everything working. thanks you for all the help. 

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

Has AS7 lost the ability to program the chip directly like AS4 did without all that messing around?surprise

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Yep looks like it's gone, so much for progress. (ie Write Flash Memory Using Current Settings)

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Are you looking for start without debugging? (Yes- it's not an intuitive name)