Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Ability to modify avr-g++ command line parameters (Read 9701 times)
Niki_77
Junior Member
**
Offline


Posts: 12
Joined: Nov 1st, 2011
Ability to modify avr-g++ command line parameters
Nov 19th, 2011 at 10:32pm
Print Post  
In order to support some strange processor (i.e. atmega328 ) may be a good idea have ability to modify the avr-g++ command line parameters.
I think the best way may be can specify a specific command line pattern for each boards entry.

P.S. this ability is not available with original arduino environment too.


P.S. 1 - more interesting idea may be ability to delegate build process to an external script.

« Last Edit: Nov 19th, 2011 at 10:33pm by Niki_77 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Ability to modify avr-g++ command line parameters
Reply #1 - Nov 19th, 2011 at 11:07pm
Print Post  
Yes it would be easy to delegate. I've been thinking about a structure for plug ins in various places and that is a good one.

Current dev is working towards supporting arduino, maple arm, teensy, wiring, chipMax etc. and a more flexible platform based compile would need to be part of that.

With arduino 1.0 around the corner and arduino arm on the way I am waiting to see the final workings and requirements for the build process.

Having said all that your requirement is slightly different and a relatively minor addition to the existing system. How about adding something to the arduino boards.txt? Can you take a look at what chipKit and wiring are doing? Arduino 1.0?

Thanks
  
Back to top
WWW  
IP Logged
 
Niki_77
Junior Member
**
Offline


Posts: 12
Joined: Nov 1st, 2011
Re: Ability to modify avr-g++ command line parameters
Reply #2 - Nov 21st, 2011 at 10:34am
Print Post  
Quote:


How about adding something to the arduino boards.txt? Can you take a look at what chipKit and wiring are doing? Arduino 1.0?

Thanks


In some case i have added new entry on boards.txt to support some strange processor like atmega328 (attention, original chip on arduino uno board is atmega328P).
This processor is similar to atmega328p but this haven't picopower tecnology , and it doesen't support it's relative functionality.
This is only minor problem, just will not use those features.
But there is an other problem, atmega328 NOT support assembler instruction JMP and CALL, it support only RJUMP and RCALL.
To let avr-g++ successfully compile this chip, it's necessary to add an option to command line . (-mshort-calls)
Arduino ide  that does not allow this option too.

This is only an example, more MCU need same tricks, or similar one for a correct compile.

The idea of an editable command line pattern (or better, compile process delegate or customizable plug-in) is for more flexible environment for custom board too (not only for arduino)
I hope to be clear.
Regards.



  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Ability to modify avr-g++ command line parameters
Reply #3 - Nov 21st, 2011 at 11:06am
Print Post  
thanks for the info. so what have you called the new entry in boards.txt?
  
Back to top
WWW  
IP Logged
 
Niki_77
Junior Member
**
Offline


Posts: 12
Joined: Nov 1st, 2011
Re: Ability to modify avr-g++ command line parameters
Reply #4 - Nov 21st, 2011 at 11:27am
Print Post  
I add a little extract from my board.txt file:

Code
Select All
##############################################################

uno.name=Arduino Uno
uno.upload.protocol=stk500
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino

##############################################################

uno328NOP.name=Arduino Uno With ATMega328 NON P
uno328NOP.upload.protocol=stk500
uno328NOP.upload.maximum_size=32256
uno328NOP.upload.speed=115200
uno328NOP.bootloader.low_fuses=0xff
uno328NOP.bootloader.high_fuses=0xde
uno328NOP.bootloader.extended_fuses=0x05
uno328NOP.bootloader.path=optiboot
uno328NOP.bootloader.file=optiboot_atmega328.hex
uno328NOP.bootloader.unlock_bits=0x3F
uno328NOP.bootloader.lock_bits=0x0F
uno328NOP.build.mcu=[b]atmega328[/b]
uno328NOP.build.f_cpu=16000000L
uno328NOP.build.core=arduino

 




note: the atmega328 upper mcu definition in bold isn't recognized by arduino bundled AVRDUDE at programming time.
You must insert appropriate entry in avrdude.conf file too, but this is another story  Grin .
No matter of add-in !


  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Ability to modify avr-g++ command line parameters
Reply #5 - Nov 21st, 2011 at 11:39am
Print Post  
try the avrdude from the arduino 1.0 beta. it is a new one Smiley maybe it works. you can just copy the avrdude files over your 0022 or 0023 install.
« Last Edit: Nov 21st, 2011 at 11:39am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Niki_77
Junior Member
**
Offline


Posts: 12
Joined: Nov 1st, 2011
Re: Ability to modify avr-g++ command line parameters
Reply #6 - Nov 21st, 2011 at 11:45am
Print Post  
Tim@Visual Micro wrote on Nov 21st, 2011 at 11:39am:
try the avrdude from the arduino 1.0 beta. it is a new one Smiley maybe it works. you can just copy the avrdude files over your 0022 or 0023 install.


I've added manually an entry with appropriate parameters to avrdude.conf too and let it working perfectly.

If you want i can post the avrdude entry too, but I've thinked not really interesting for  all.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Ability to modify avr-g++ command line parameters
Reply #7 - Nov 21st, 2011 at 12:08pm
Print Post  
you are probably right at the moment. in the future we have to decide if we install our own set of avr and arduino files with the addin. Then allow users to optionally use them instead of the ones supplied with arduino.

i like the arduino compatibility but there are so many other things we could do if we extend the arduino system files.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint