Go Down

Topic: target pattern contains no `%'. Makefile problem (Read 19660 times) previous topic - next topic

Robomaniac

Quote
So it works with one ../ in the path, but not with two (../../)?  What errors do you get in the latter case?  What warnings do you get in the former?


Oops  :o  seems I get the same warnings in both but now no errors. I suspect I must have modified the file so many times that I must have messed up one of them.

The warnings are :

cc1plus.exe: warning: command line option "-Wstrict-prototypes" is valid for C/O
bjC but not for C++
cc1plus.exe: warning: command line option "-std=gnu99" is valid for C/ObjC but n
ot for C++
In file included from ../arduino-0008/lib/targets/arduino/WProgram.h:5,
                from text.cpp:1:
c:/winavr/bin/../avr/include/avr/signal.h:36:2: warning: #warning "This header f
ile is obsolete.  Use <avr/interrupt.h>."
In file included from ../arduino-0008/lib/targets/arduino/WProgram.h:7,
                from text.cpp:1:
../arduino-0008/lib/targets/arduino/wiring.h:60:1: warning: "abs" redefined
In file included from ../arduino-0008/lib/targets/arduino/WProgram.h:1,
                from text.cpp:1:
c:/winavr/bin/../avr/include/stdlib.h:116:1: warning: this is the location of th
e previous definition
avr-objcopy -O ihex -R .eeprom text.elf text.hex


Now the problem is the program doesn't upload. I changed the port to COM2 and 9600 and tried "make upload" but I keep getting this error:

avrdude -F -p atmega8 -P COM2 -c stk500 -b 9600 -U flash:w:text.hex
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: ser_open(): can't open device "COM2": Access is denied.

make: *** [upload] Error 1

mellis

Cool... we're making progress.  :)

The warnings shouldn't be a problem.  I should clean-up the Makefile so they don't occur, but they shouldn't break anything.

Have you burned the bootloader onto the chip?  Are you trying to upload the hex file over a serial cable?  Are you running as an administrator?  Are you logged on to the machine locally (or with network/domain credentials)?  Also, is there anything else that could be using or blocking the port?  Firewalls?  PDA sync applications?  

Also, you'll probably need to use a baud rate of 19200, not 9600, but neither will work until we fix the "Access is denied" error.

Robomaniac

Quote

Have you burned the bootloader onto the chip?


No - I'm using the makefile as I cannot get the bootloader to work. I programmed the chip directly by using a parallel programmer using PonyProg. However during reset the LED (pin 13) doesn't blink or light at all .
The board works with some files I used from other sites using the parallel programmer with a 6 to 10 pin homebrew ICSP adapter, so I know both the board and AVR are OK, but I'd like to get Arduino up and running.

Quote

Are you trying to upload the hex file over a serial cable?  


Yes using "make upload" both on the Arduino serial board and on a prototype using the MAX232 chip; but I get the same errors in both. Unfortunately I remember getting problems occasionally with the serial port and a restart on the PC usually solved the problem but not in this case.

Quote

Are you running as an administrator?  Are you logged on to the machine locally (or with network/domain credentials)?  Also, is there anything else that could be using or blocking the port?  Firewalls?  PDA sync applications?  


Yes. Locally. Not that I know of, no firewalls or PDA synch apps.

What I found frustrating was that I can load the .hex file directly into flash using Ponyprog with parallel but the LED (pin 13) doesn't blink.  I'm sure I'm doing something wrong but I cannot find out what.  :'(

mellis

I'm confused.  

Using PonyProg and a parallel programmer, you can burn .hex files you've downloaded from the internet onto the board and they run successfully?  What happens when you do the same thing with a .hex file you generated from Arduino code with the Makefile?  You can get it onto the chip with PonyProg and the parallel programmer, but it doesn't run?  In that case, it's not likely to help if you use PonyProg and a parallel programmer to get the bootloader onto the board and then upload a program with avrdude and a serial cable - if the LED blink program doesn't run, I doubt the bootloader will.

What happens when you use PonyProg and a parallel programmer to put the .hex file onto the board?  What's the source code of the program you're trying to run?  

Robomaniac

Quote
I'm confused.  
Using PonyProg and a parallel programmer, you can burn .hex files you've downloaded from the internet onto the board and they run successfully?


Yes, I use this program as a test program, actually 2 programs which blink or turn on an LED. I make a hex file from the .c using a simple makefile and AVR studio. Then I upload the .hex with ponyprog using LPT1 Avr ISP i/o setting.

Quote

What happens when you do the same thing with a .hex file you generated from Arduino code with the Makefile?  You can get it onto the chip with PonyProg and the parallel programmer, but it doesn't run?  In that case, it's not likely to help if you use PonyProg and a parallel programmer to get the bootloader onto the board and then upload a program with avrdude and a serial cable - if the LED blink program doesn't run, I doubt the bootloader will.


Yes that is the problem now.  I'd like to get the bootloader working so I can simply program from the serial - I need the Arduino to control a number of servos and the code can simply be changed from serial.

Quote

What happens when you use PonyProg and a parallel programmer to put the .hex file onto the board?  What's the source code of the program you're trying to run?  


The .hex files files are programmed using the "write all" command. These are uploaded in about 5s and then verified and almost always (to date) I get a write successful message - even if the program doesn't work! The program was a modification from a file downloaded from societyofrobots.com and was the source code for the $50 robot. I am excluding some intro lines, the code for the servos and some comments at the end to shorten the code:

//SoR Include
#include "SoR_Utils.h" //includes all the technical stuff


int main(void)
     {
     //declare variables here
     //int i=250;//a 'whatever' variable
     int sensor_left=0;//left photoresistor
     int sensor_right=0;//right photoresistor
     int threshold=8;//the larger this number, the more likely your robot will drive straight
     

     /****************INITIALIZATIONS*******************/
     //other stuff Im experimenting with for SoR
     //uartInit();  // initialize the UART (serial port)
     //uartSetBaudRate(9600);// set the baud rate of the UART for our debug/reporting output
     //rprintfInit(uartSendByte);// initialize rprintf system

     //timerInit(); // initialize the timer system
     
     configure_ports(); // configure which ports are analog, digital, etc.
     a2dInit(); // initialize analog to digital converter (ADC)
     a2dSetPrescaler(ADC_PRESCALE_DIV32); // configure ADC scaling
     a2dSetReference(ADC_REFERENCE_AVCC); // configure ADC reference voltage

     //rprintf("Initialization Complete\r\n");
     /**************************************************/

     
     /*********ADD YOUR CODE BELOW THIS LINE **********/
     LED_on();//turn LED on


     while(1)
           ------------several lines for servo control------

             LED_off();
             delay_cycles(1000);
           }
     /*********ADD YOUR CODE ABOVE THIS LINE **********/

     return 0;
     }

mellis

It sounds like you're trying to get two things working at once: uploading via the serial cable and the bootloader, and running the society of robots program.  You should try to do one at a time, so it's easier to tell where the problem is.

The society of robots program doesn't use any Arduino commands, which means you don't want to build it with the Arduino Makefile.  Instead you should use AVR Studio with a Makefile like the one you used for the sample programs, and upload it with PonyProg and the parallel programmer (i.e. avoiding the bootloader for now).  If that doesn't work, then it's likely a problem with the code, and you might be able to get better help from the society of robots people.

On the other hand, to get the bootloader working, we need to figure out the permission denied errors you're getting on your com port.  Can you open it with other programs (like HyperTerminal)?  If so, try putting a program that sends Serial data on the board with PonyProg and the parallel programmer, and then open the port in HyperTerminal and see if you can see the data.  If you can't open the port with any program, we'll have to investigate further.

Robomaniac

Quote
The society of robots program doesn't use any Arduino commands, which means you don't want to build it with the Arduino Makefile.  Instead you should use AVR Studio with a Makefile like the one you used for the sample programs, and upload it with PonyProg and the parallel programmer (i.e. avoiding the bootloader for now).  If that doesn't work, then it's likely a problem with the code, and you might be able to get better help from the society of robots people.


There is a misunderstanding. I used the SoR program just to test that the AVR hasn't burnt up and that the soldering is ok. I'm confident that the Arduino board is working.

Quote
On the other hand, to get the bootloader working, we need to figure out the permission denied errors you're getting on your com port.  Can you open it with other programs (like HyperTerminal)?  If so, try putting a program that sends Serial data on the board with PonyProg and the parallel programmer, and then open the port in HyperTerminal and see if you can see the data.  If you can't open the port with any program, we'll have to investigate further.


It seems I have some issues with the COM ports. In my hardware profile COM1 and COM3 are "in use" but I have nothing connected to them. COM2 is the next available port and is the one I am using; changing this to COM1 did not help. Ponyprog is not seeing any COM port! Running hyperterminal is giving an error "windows has reported a TAPI error (80000048). Use the phone and modem options icon in the control panel to ensure that the modem is installed properly" - however I have no phone/modem connected, my internet is through a router (ADSL).
Unfortunately at the moment I do not have much time to try to discover what is wrong. Let me try to google to get some info (I feel like I'm wasting your precious time) and I'll get back when I can get the serial port working. Thanks David for now, I'll be back with some feedback later.

Go Up