Native Linux Support for AVRProg2

General discussion on mikroElektronika development boards.
Post Reply
Author
Message
koe
Posts: 1
Joined: 17 May 2011 09:36

Native Linux Support for AVRProg2

#1 Post by koe » 05 Jun 2011 10:54

Dear Linux-Mikroe-Devboard Users,

and the ones who want to be such. We are happy to announce that we wrote a command line tool supporting the Mikroe AVRProg2 programmer natively on Linux.
It is available as SourceForge project at https://sourceforge.net/projects/avrprog2/
We have already tested it and it work great on Ubuntu, but now we need your help to test it as well.
Please note that all credits for the Programmer go to one of my students who did the actual work, so we can use Mikroe AVR development boards in our lab-course at university.
Thanks to Mikroe for their support and their permission to publish it. We are sure that the acceptance of their development boards in the Linux community will get a significant boost, as such a programmer is exactly what we needed (according to the entries in this board - since 2003 :wink: ).

The programmer already has some nice features like the automatic detection of the used MCU package and we are planning to add some other cool features to it in the future.

But now we need your help to test it and report your experiences for further improvements.

Have a lot of fun with the Linux programmer!

Yours,
Alex

gbl
Posts: 7
Joined: 02 Dec 2010 07:49

Re: Native Linux Support for AVRProg2

#2 Post by gbl » 10 Jun 2011 16:50

Hi,

Do you have working examples for a ATMEGA32 Device.
I mean, a XML File and the CLI Sequence for bruning the Device?

I just tired this:

Code: Select all

<device>
	<name>ATmega 32</name>
	<signature>0x1e9502</signature>
	<flashSize>32768</flashSize>
	<eepromSize>2048</eepromSize>
	<numOfFuses>2</numOfFuses>
<!--<socket>TQFP64</socket>	use autodetection-->
</device>

Code: Select all

#!/bin/sh

CPU=atmega32
HEXFILE="../vfomain.hex"
FREQ=8000000

# - internal RC - 8MHz
avrprog2 -d -m ${CPU} -f ${FREQ} --erase --flash w:${HEXFILE}
avrprog2 -d -m ${CPU} -f ${FREQ} --flash v:${HEXFILE} 
The Result I get:

Code: Select all

avrprog2 1.0.0
System configuration directory: /usr/local/share/avrprog2/
User configuration directory: ~/.avrprog2/

Prepare buffer for flash operations.
Load hex file
	Add section: '.sec1' at 0x0.
	Extend buffer to: 8246 bytes.

Infos from device description file '/home/oe8str/.avrprog2/atmega32.xml':
	Device name: ATmega 32
	Size of flash memory: 32768 bytes
	Size of eeprom memory: 2048 bytes
	Number of fuse bytes: 2
	Device signature: 0x1e9502
	Socket: auto

Connect to usb device...

Programmer Name: AT FLASH prog - AVR
Programmer Version: 
02 06 02 1c 
Set programming speed to 4
Autodetect programming pins...
Device Signature: 0x1e9502
Connected to 'ATmega 32'.

Chip erase...

Write to flash memory...
0%                                                                          100%
################################################################################
8246 bytes written
Close usb connection...
avrprog2 1.0.0
System configuration directory: /usr/local/share/avrprog2/
User configuration directory: ~/.avrprog2/

Prepare buffer for flash operations.
Load hex file
	Add section: '.sec1' at 0x0.
	Extend buffer to: 8246 bytes.

Infos from device description file '/home/oe8str/.avrprog2/atmega32.xml':
	Device name: ATmega 32
	Size of flash memory: 32768 bytes
	Size of eeprom memory: 2048 bytes
	Number of fuse bytes: 2
	Device signature: 0x1e9502
	Socket: auto

Connect to usb device...

Programmer Name: AT FLASH prog - AVR
Programmer Version: 
02 06 02 1c 
Set programming speed to 4
Autodetect programming pins...
Device Signature: 0x1e9502
Connected to 'ATmega 32'.

Verify flash memory...
0%                                                                          100%
################################################################################
failed, 8246 bytes verified
Close usb connection...


sinclery
Guenter

An OM in Carinthia.

handy
Posts: 4
Joined: 19 Jun 2011 14:14

Re: Native Linux Support for AVRProg2

#3 Post by handy » 19 Jun 2011 14:25

Hi,

sorry we do not have a ATMEGA32, however your device description file looks good.

Have you ever tried this?

Code: Select all

avrprog2 -d -m ${CPU} -f ${FREQ} --flash w:${HEXFILE} -v
This does programming and verifying at once.

Further you can try to use a lower frequency setting for the programmer.

Regards Andreas

tvlooy
Posts: 7
Joined: 29 Sep 2010 20:04

Re: Native Linux Support for AVRProg2

#4 Post by tvlooy » 11 Jul 2011 18:55

Hi, I can't compile the software on Fedora 15, I posted a question on the project forum but I don't know if that's really active. Please have a look https://sourceforge.net/projects/avrpro ... ic/4603079

tvlooy
Posts: 7
Joined: 29 Sep 2010 20:04

Re: Native Linux Support for AVRProg2

#5 Post by tvlooy » 02 Aug 2011 22:52

just for the archives, the software now works on Fedora 15

handy
Posts: 4
Joined: 19 Jun 2011 14:14

Re: Native Linux Support for AVRProg2

#6 Post by handy » 26 Sep 2011 21:39

gbl wrote:Hi,

Do you have working examples for a ATMEGA32 Device.
I mean, a XML File and the CLI Sequence for bruning the Device?
Hi,

since version 1.2.0 avrprog2 supports smaller AVR devices too. The config files now have an entry for the flash page size.
I tested with an ATmega16.

Regards

knutauvor
Posts: 2
Joined: 29 Sep 2011 19:15

Re: Native Linux Support for AVRProg2

#7 Post by knutauvor » 29 Sep 2011 19:59

I have successfully programmed an avrplc16 (which has an atmega32) using this config file:

Code: Select all

<device>
    <name>ATmega32</name>
    <signature>0x1e9502</signature>
    <flashSize>32768</flashSize>
    <flashPageSize>128</flashPageSize>
    <eepromSize>2048</eepromSize>
    <numOfFuses>2</numOfFuses>
<!--<socket>auto</socket>   use autodetection -->
</device>
However, I had trouble when my hex files were very small. In those cases, a lot of FF bytes seemed to be written (I checked by reading back the program using the AVRFLASH utility under windows).

I tried three different hex files from the avrplc16 examples (http://www.mikroe.com/eng/downloads/get ... s_v100.zip):

These examples work:
  • AVRPLC16\ v6\ PLC\ System\ Examples/mikroC\ PRO\ for\ AVR/SPI\ Ethernet/HTTP_Demo.hex (14878 bytes)
  • AVRPLC16\ v6\ PLC\ System\ Examples/mikroC\ PRO\ for\ AVR/GSM/GSM\ Calling\ Demo/GSM_Calling_Demo.hex (2762 bytes)
However, this example does not work:
  • AVRPLC16\ v6\ PLC\ System\ Examples/mikroC\ PRO\ for\ AVR/Optocouplers\ to\ Relays/OC_Relays.hex (216 bytes)
If I write OC_Relays.hex using AVRFLASH under Windows, avrflash2 is able to successfully verify it.

handy
Posts: 4
Joined: 19 Jun 2011 14:14

Re: Native Linux Support for AVRProg2

#8 Post by handy » 03 Oct 2011 16:19

knutauvor wrote:However, I had trouble when my hex files were very small. In those cases, a lot of FF bytes seemed to be written (I checked by reading back the program using the AVRFLASH utility under windows).
Hi,

yes, there was a bug with small programs in version 1.2.0, which is already fixed in the trunk version in the repository.
Please try the newest trunk version directly from the repository.

Regards

knutauvor
Posts: 2
Joined: 29 Sep 2011 19:15

Re: Native Linux Support for AVRProg2

#9 Post by knutauvor » 04 Oct 2011 22:37

The trunk seems to work just fine. May I suggest you release it as version 1.2.1?

handy
Posts: 4
Joined: 19 Jun 2011 14:14

Re: Native Linux Support for AVRProg2

#10 Post by handy » 05 Oct 2011 21:08

knutauvor wrote:The trunk seems to work just fine. May I suggest you release it as version 1.2.1?
Thank you for your report. Version 1.2.1 is now available.

Regards

LindsayFrost
Posts: 1
Joined: 15 Mar 2012 11:59

Re: Native Linux Support for AVRProg2

#11 Post by LindsayFrost » 15 Mar 2012 12:21

hey good to know!)
i have Linux at work and was going to get it for my own PC too
:)

sheilaaellis44
Posts: 1
Joined: 24 Mar 2012 04:44

Re: Native Linux Support for AVRProg2

#12 Post by sheilaaellis44 » 24 Mar 2012 04:48

With ZIF socket, it becomes a standard programmer used for a large-scale production.

One of the possible ways of connecting AVRprog2 to a microcontroller is via an IDC10 connector. Refer to figure on the right. You just have to place a 2x5 connector between the microcontroller and other on-board modules. By embedding the AVRprog2 connector you will be able to perform In-System AVR. A flat cable with an IDC10 female connector on its end is used here. When creating a target device, it is necessary to provide the appropriate 10-pin male connector with 2.54 mm spacing between pins on it. The connector pins should be connected to the microcontroller pins. Their position varies depending on the microcontroller's type and package.

romes
Posts: 2
Joined: 26 Nov 2017 19:12

Re: Native Linux Support for AVRProg2

#13 Post by romes » 26 Nov 2017 19:22

This works for EasyAVR v7

Paul_Scott
Posts: 1
Joined: 16 Nov 2018 15:57

Re: Native Linux Support for AVRProg2

#14 Post by Paul_Scott » 16 Nov 2018 16:21

I wonder if it will work for later versions

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: Native Linux Support for AVRProg2

#15 Post by petar.suknjaja » 19 Nov 2018 12:45

Hi,
I don't know why it shouldn't, but you could ask the author of the post.
Kind regards,
Petar

Post Reply

Return to “Development Boards”