Go Down

Topic: AVRProjectIDE - Editor for AVR/Arduino Projects (Read 12977 times) previous topic - next topic

Nachtwind

Hm, i have the 'Autoreset Problem' on 2 Duemilanove, the Seeeduino Mega and Modified Pico, all show the same exact behavior. Using the original IDE there is no problem with the reset though.

The other thing is that it seems - here, that programs may be compiled and even uploaded but they dont 'show' up on the arduino... The Arduino keeps running the sketch that was uploaded before (or rather: With another IDE)..

Strange.. i wished this IDE did work the way it looks - that would be finally THE ide for me...
Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

frank26080115

#16
Sep 28, 2009, 06:07 pm Last Edit: Sep 28, 2009, 06:17 pm by frank26080115 Reason: 1
what the heck? that is a weird problem, you mean the hex code file is generated, and the programmer reports successful upload, but the chip still executes old code?

my build method should check for the hex file's existence when it finishes, if it reports succcessful, then the hex file does exist.

avrdude, when the burn button is pressed, is set to target that file regardless of whether that file exists or not, if it does not complain that the file is missing, then it is uploading the correct file.

it seems almost as if avrdude used another file on the system, it would be impossible for my program to know where that file is :-/

does avrdude actually say that it was successful?

does the arduino bootloader support verification? all the settings in boards.txt says they use stk500's protocol, am I wrong on this?

also added issue about auto-reset, i'll add a checkbox for auto-reset and hijack the specified port using code i found at http://www.hanselman.com/blog/content/binary/UnmanagedIRSerialPort.txt

might take a day or two to fix these things, i'll also need to burn the bootloader on a chip and test myself, good thing i actually have a freeduino board...
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Nachtwind

Here is 'my' build process:

Code: [Select]

Execute: avr-g++ -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT HardwareSerial.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/HardwareSerial.cpp"
Execute: avr-gcc -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT pins_arduino.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/pins_arduino.c"
Execute: avr-g++ -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT Print.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/Print.cpp"
Execute: avr-gcc -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT WInterrupts.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/WInterrupts.c"
Execute: avr-gcc -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT wiring.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/wiring.c"
Execute: avr-gcc -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT wiring_analog.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/wiring_analog.c"
Execute: avr-gcc -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT wiring_digital.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/wiring_digital.c"
Execute: avr-gcc -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT wiring_pulse.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/wiring_pulse.c"
Execute: avr-gcc -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT wiring_shift.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/wiring_shift.c"
Execute: avr-g++ -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT WMath.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/WMath.cpp"
Execute: avr-g++ -I"D:\Arduino" -I"C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18\arduino\core" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp" -I"C:\Users\Nachtwind\AppData\Roaming\AVRProjectIDE\temp"  -mmcu=atmega1280 -DF_CPU=16000000UL -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections  -Wall -gdwarf-2 -std=gnu99 -MD -MP -MT arduino_temp_main.o  -c  "C:/Users/Nachtwind/AppData/Roaming/AVRProjectIDE/temp/arduino_temp_main.cpp"
Execute: avr-ar rcs libtestmitneueride.a HardwareSerial.o pins_arduino.o Print.o WInterrupts.o wiring.o wiring_analog.o wiring_digital.o wiring_pulse.o wiring_shift.o WMath.o
Execute: avr-gcc -mmcu=atmega1280 -Wl,-Map=testmitneueride.map -Wl,--gc-sections -Os libtestmitneueride.a HardwareSerial.o pins_arduino.o Print.o WInterrupts.o wiring.o wiring_analog.o wiring_digital.o wiring_pulse.o wiring_shift.o WMath.o arduino_temp_main.o    -o testmitneueride.elf
Execute: rm -rf HardwareSerial.o pins_arduino.o Print.o WInterrupts.o wiring.o wiring_analog.o wiring_digital.o wiring_pulse.o wiring_shift.o WMath.o arduino_temp_main.o  libtestmitneueride.a HardwareSerial.d pins_arduino.d Print.d WInterrupts.d wiring.d wiring_analog.d wiring_digital.d wiring_pulse.d wiring_shift.d WMath.d arduino_temp_main.d  libtestmitneueride.a
Execute: avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature testmitneueride.elf testmitneueride.hex
Execute: avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings  -O ihex testmitneueride.elf testmitneueride.hex
####Error: EEP file not created at D:\Arduino\output\testmitneueride.eep
Execute: avr-size -C --mcu=atmega1280 testmitneueride.elf
AVR Memory Usage
----------------
Device: atmega1280
Program:    3408 bytes (2.6% Full)
(.text + .data + .bootloader)
Data:        639 bytes (7.8% Full)
(.data + .bss + .noinit)
Build Succeeded


Upload (after manual reset):
Code: [Select]

avrdude: successfully opened stk500v1 device -- please use -c stk500v1

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x1e9703
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

        To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "D:\Arduino\output\testmitneueride.hex"
avrdude: input file D:\Arduino\output\testmitneueride.hex auto detected as Intel
Hex
avrdude: writing flash (0 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 0 bytes of flash written
avrdude: verifying flash memory against D:\Arduino\output\testmitneueride.hex:
avrdude: load data flash data from input file D:\Arduino\output\testmitneueride.
hex:
avrdude: input file D:\Arduino\output\testmitneueride.hex auto detected as Intel
Hex
avrdude: input file D:\Arduino\output\testmitneueride.hex contains 0 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 38.55s

avrdude: verifying ...
avrdude: 0 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18>


So, compilation and upload are successful, yet it seems not to have worked though... Tried Mega and Duemilanove.
Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

frank26080115

#18
Sep 28, 2009, 07:09 pm Last Edit: Sep 28, 2009, 07:15 pm by frank26080115 Reason: 1
weird, 0 bytes written?

does anybody see anything wrong with the following:
Code: [Select]

avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature testmitneueride.elf testmitneueride.hex


maybe I got the ordering of the options wrong
try running
Code: [Select]

avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex testmitneueride.elf testmitneueride.hex

in your output folder, then check the file size of testmitneueride.hex

in Arduino's makefile, it reads:
Code: [Select]

.elf.hex:
       $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@


which should translate into something similar to what i did

the -R options will remove those sections, but actual program data should be in .text .data and .bootloader, which are not removed by -R, this is weird
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Nachtwind

After compilation: 13 Bytes
After calling the function you stated above: 9.611 Bytes

Upload:
Code: [Select]

avrdude: successfully opened stk500v1 device -- please use -c stk500v1

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.08s

avrdude: Device signature = 0x1e9703
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

        To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "D:\Arduino\output\testmitneueride.hex"
avrdude: input file D:\Arduino\output\testmitneueride.hex auto detected as Intel
Hex
avrdude: writing flash (3408 bytes):

Writing | ################################################## | 100% 1.09s

avrdude: 3408 bytes of flash written
avrdude: verifying flash memory against D:\Arduino\output\testmitneueride.hex:
avrdude: load data flash data from input file D:\Arduino\output\testmitneueride.
hex:
avrdude: input file D:\Arduino\output\testmitneueride.hex auto detected as Intel
Hex
avrdude: input file D:\Arduino\output\testmitneueride.hex contains 3408 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.02s

avrdude: verifying ...
avrdude: 3408 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


C:\Users\Nachtwind\Desktop\AVRProjectIDE_Alpha18>


Seems to work that way arround :0)
Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

frank26080115

#20
Sep 28, 2009, 10:37 pm Last Edit: Sep 29, 2009, 03:37 am by frank26080115 Reason: 1
when i get home i'll experiment with that command for a bit

problems found and fixed
if you have alpha 18, run it and close it to trigger the updater, if not, go download the latest package

see http://code.google.com/p/avr-project-ide/wiki/ChangeLog
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Nachtwind

Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

frank26080115

The latest featured alpha version has working intelligent autocomplete. it is variable scope aware, it also checks which files you've #included so it gets all the functions and keywords from there too. each keyword in the autocomplete has a icon with the color indicating where the keyword came from (C, CPP, Arduino, AVR Libc module, or user defined) and a shape indicating what it is (type, function, statement, variable, etc)

it's as close to intellisense as i can get to at the moment without basically writing a C compiler of my own.



please try it out for me :-) get it here
http://code.google.com/p/avr-project-ide/
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Nachtwind

:0)

I really love your IDE - please keep the great work up and dont fade away as so many others have already done...
Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

frank26080115

New update must be downloaded as a package, it includes a new feature i called "hardware explorer", it displays information about your chip, such as memory, available hardware IO registers (their name, description, bits, descriptions for the bits, R W or RW, etc), available interrupt vectors (name, with new and old vector spellings), pin discriptions for all available packages, and some other stuff.

fixed a few bugs regarding autocomplete
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Andrew

This looks great but I'm having trouble getting started trying it out. How do I tell it where avrdude and avr-gcc etc. are installed? I don't see any options in the config screen for that, and it can't find either of them (they are in "D:\arduino-0017\hardware\tools\avr\bin" in my case).

Andrew

frank26080115

it expects you to have an installation of WinAVR, you must be able to launch the avr binary utilities from the command line without a full path or being in their directories.
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

bohne

http://www.dorkbot.de
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236434254
http://www.luminet.cc

CrashingDutchman

Very nice you are working on this!

I am experiencing some problems though with code that compiles ok in the Arduino IDE, but not with yours. For example, I am using NewSoftSerial and SoftwareServo in my PDE. For both libraries I have an include. For example, I get messages: 'NewSoftSerial' does not name a type, 'Servo1' was not declared in this scope. Maybe it is a setting I am not aware of, but like I said, I don't get these messages in the Arduino IDE.

I also have a couple of suggestions:
- For example, Ctrl-G, to Go To a line (like in VS editor)
- Automatic save of (changed) files for backup every 5 minutes or so (I mention this because I let my computer on last night, for some reason the computer shut down and I lost my changes)

Looking forward to new version!

frank26080115

#29
Oct 25, 2009, 05:15 am Last Edit: Oct 25, 2009, 05:55 am by frank26080115 Reason: 1
i was able to compile the example sketch in newsoftserial just fine

the editor does do backups every 30 seconds by default, the backup disappears if the editor shuts down cleanly (not a crash or power outage)

i'll add the goto later

edit:

goto added
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Go Up