LUFA library error

Go To Last Post
53 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everybody Im Biomedical Engineer working on programming project  using Atmega 32U4 with LUFA library I copied the file to my project and Im just using some led to check the sending 
but I get this error and I couldn't solve it, however, I try if there any help, please 

 error: conflicting types for 'CALLBACK_USB_GetDescriptor'
 error: previous declaration of 'CALLBACK_USB_GetDescriptor' was here
error: 'FIXED_CONTROL_ENDPOINT_SIZE' undeclared here (not in a function)
 'FIXED_NUM_CONFIGURATIONS' undeclared here (not in a function)

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

Use the makefile provided.
Don't forget to set the correct MCU and Freq in it.

I don't know why I'm still doing this hobby

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

thank you for the helping Im a beginner in Microcontroller how to use the provided makefile  in my program? as Im using AVR Studio 4 

Last Edited: Wed. Jun 14, 2017 - 07:59 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Suggest you upgrade to Studio 7 where LUFA can be added as an "extension" so that you can simply "Create LUFA project..."

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

I tried with Studio 7 and add it as extention but I get the error recipe for target 'debug.o' failed

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

That suggests there was a reference to a source file called debug.c that was not visible to the C compiler.

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

yes there is a file but how to solve this issue ?  is there a way to make it visible to the compiler? Im already included it in the source files 

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

Sou77 wrote:

Hi everybody Im Biomedical Engineer working on programming project  using Atmega 32U4 with LUFA library I copied the file to my project and Im just using some led to check the sending 
but I get this error and I couldn't solve it, however, I try if there any help, please 

 error: conflicting types for 'CALLBACK_USB_GetDescriptor'
 error: previous declaration of 'CALLBACK_USB_GetDescriptor' was here
error: 'FIXED_CONTROL_ENDPOINT_SIZE' undeclared here (not in a function)
 'FIXED_NUM_CONFIGURATIONS' undeclared here (not in a function)

 

AVR Studio 4:

 

Before you use your own source, setup the sample project you want to use as the original source, don't alter anything

 

- Select menu: Project -> Configuration Options (or gear icon)

- Check option 'Use external makefile'

- Browse the path of the makefile of the library ('...' button), it is in the sample project you are using if you haven't copied it

- Leave other settings, click 'Ok'

- Compile it, the makefile should shows in the file list tree in folder 'Other'

- Open that makefile and change the MCU and Freq.

- Compile it again and see what you get

 

If you succeded then you can alter the main.c for your needs

If not, then some files not copied or included correctly

 

 

 

MG

I don't know why I'm still doing this hobby

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

Thanks I did the same and still have the error recipe for target 'debug.o' failed even that this file is already included and is from the orginal files

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

What version of LUFA and may I know what project or demo you are compiling?

I don't know why I'm still doing this hobby

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

Im depending on http://www.waitingforfriday.com/... USB Generic HID Open Source Framework for Atmel AVR and Windows so im not sure from the version of the LUFA

and use their APP Demo after modification  to set my owen leds

//-----------------------------------------------------------------------------
//
//  WFF GenericHID Demo Application 4_0.c
//
//  WFF UDB GenericHID Demonstration Firmware (4_0)
//  A demonstration firmware for the WFF GenericHID Communication Library
//
//  Copyright (c) 2011 Simon Inns
//
//  Permission is hereby granted, free of charge, to any person obtaining a
//  copy of this software and associated documentation files (the "Software"),
//  to deal in the Software without restriction, including without limitation
//  the rights to use, copy, modify, merge, publish, distribute, sublicense,
//  and/or sell copies of the Software, and to permit persons to whom the
//  Software is furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
//  DEALINGS IN THE SOFTWARE.
//
//  Web:    http://www.waitingforfriday.com
//  Email:  simon.inns@gmail.com
//
//-----------------------------------------------------------------------------

#include "WFF GenericHID Demo Application 4_0.h"

// Global for forming debug output strings using sprintf
char debugString[24];

// Main program entry point
int main(void)
{
    setupHardware();

    sei();

    // Output the firmware version
    sprintf(debugString, "USB Generic HID Demonstration Firmware 4_0 (ATmega32U4)");
    debugOut(debugString);

    // Output the copyright information
    sprintf(debugString, "(C)2011 Simon Inns - http://www.waitingforfriday.com");
    debugOut(debugString);

    // Mention Dean's USB library because it's cool and open-source
    sprintf(debugString, "LUFA library by Dean Camera - http://fourwalledcubicle.com");
    debugOut(debugString);

    for (;;)
    {
        // Poll the USB tasks
         USB_USBTask();
    }
}

// Setup the hardware
void setupHardware(void)
{
    // Disable watchdog if enabled by boot-loader/fuses
    MCUSR &= ~(1 << WDRF);
    wdt_disable();

    
    debugInitialise();
    
    USB_Init(1);
}

// USB Device connected event handler
void EVENT_USB_Device_Connect(void)
{
    // Indicate USB enumerating
    sprintf(debugString, "USB Device enumerating");
    debugOut(debugString);
}

// USB Device disconnected event handler
void EVENT_USB_Device_Disconnect(void)
{
    // Indicate USB not ready
    sprintf(debugString, "USB Device disconnected");
    debugOut(debugString);
}

// Event handler for the USB_ConfigurationChanged event
void EVENT_USB_Device_ConfigurationChanged(void)
{
    bool ConfigSuccess = true;

    // Setup HID Report Endpoints
    ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
                                                GENERIC_EPSIZE, ENDPOINT_BANK_SINGLE);
    ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT,
                                                GENERIC_EPSIZE, ENDPOINT_BANK_SINGLE);

    // Indicate endpoint configuration success or failure
    if (ConfigSuccess)
    {
        sprintf(debugString, "USB endpoint configuration successful");
        debugOut(debugString);
    }        
    else
    {
        sprintf(debugString, "USB endpoint configuration failed");
        debugOut(debugString);
    }        
}

// Event handler for the USB_ControlRequest event
void EVENT_USB_Device_ControlRequest(void)
{
    // Handle HID Class specific requests

    // This is called if the host is waiting for a report from the device.  This functionality is not used
    // in the generic HID framework but is kept for compatibility with LUFA (bulk sending and receiving is
    // an atomic operation dealt with when the initial command packet is received below).
    if (USB_ControlRequest.bRequest == HID_REQ_GetReport)
    {
        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
        {
            //uint8_t GenericData[GENERIC_REPORT_SIZE];
            //CreateGenericHIDReport(GenericData);

            Endpoint_ClearSETUP();
            
            sprintf(debugString, "Error: USB_ControlRequest.bRequest == HID_REQ_GetReport?");
            debugOut(debugString);

            /* Write the report data to the control endpoint */
            //Endpoint_Write_Control_Stream_LE(&GenericData, sizeof(GenericData));
            Endpoint_ClearOUT();
        }
    }
    
    // Do we have a command request from the host?
    if (USB_ControlRequest.bRequest == HID_REQ_SetReport)
    {        
        // Ensure this is the type of report we are interested in
        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
        {
            // Note: the endpoints are from the perspective of the host: OUT is 'out from host' and IN is 'in to host'
            
            // Declare our send and receive buffers
            char hidReceiveBuffer[GENERIC_REPORT_SIZE];
            char hidSendBuffer[GENERIC_REPORT_SIZE];

            // Clear the SETUP endpoint
            Endpoint_ClearSETUP();

            // Read the report data from the control endpoint
            Endpoint_Read_Control_Stream_LE(&hidReceiveBuffer, sizeof(hidReceiveBuffer));
            Endpoint_ClearIN();

            // Process GenericHID command packet
            switch(hidReceiveBuffer[0])
            {
                case 0x10:    // Debug information request from host
                    // Select the IN end-point
                    Endpoint_SelectEndpoint(GENERIC_IN_EPNUM);

                    // Send a response to the host
                    if (Endpoint_IsINReady())
                    {
                        // Copy any waiting debug text to the send data buffer
                        copyDebugToSendBuffer((char*)&hidSendBuffer[0]);
                    
                        // Write the return packet data into the report
                        Endpoint_Write_Stream_LE(&hidSendBuffer, sizeof(hidSendBuffer), NULL);

                        // Finalize the stream transfer to send the last packet
                        Endpoint_ClearOUT();
                    }
                    break;
                    
                // Place application specific commands here:
                
                case 0x80:    // Command 0x80 - Get device status
                    // This command is polled so enabling debug causes a lot of chatter...
                    //sprintf(debugString, "** Received command 0x80 (get device status) from host");
                    //debugOut(debugString);
                    
                    // We expect no input data for this command
                    
                    // Assemble the response packet
                    
                    // Get the LED status
                    ; // Note: seems to be a compiler bug that you can't have a label as the first part
                    // of a case statement... the ';' gets around this...
                    if ((LEDPORT & LED_ROT) == 0) hidSendBuffer[0] = 0; // LED1 status
                    else hidSendBuffer[0] = 1;
                    if ((LEDPORT & LED_GELB) == 0) hidSendBuffer[1] = 0; // LED2 status
                    else hidSendBuffer[1] = 1;
                    if ((LEDPORT & LED_GRUEN) == 0) hidSendBuffer[2] = 0; // LED3 status
                    else hidSendBuffer[2] = 1;
                    
                    // Send the response packet ->
                        
                    // Select the IN end-point
                    Endpoint_SelectEndpoint(GENERIC_IN_EPNUM);

                    // Send a response to the host
                    if (Endpoint_IsINReady())
                    {

                        // Write the return packet data into the report
                        Endpoint_Write_Stream_LE(&hidSendBuffer, sizeof(hidSendBuffer), NULL);

                        // Finalize the stream transfer to send the last packet
                        Endpoint_ClearOUT();
                    }
                    break;
                
                case 0x81:    // Command 0x81 - Set LED status
                    sprintf(debugString, "** Received command 0x81 (set LED status) from host");
                    debugOut(debugString);
                    
                    // Set the LED status
                        if (hidReceiveBuffer[1] == 1) LEDPORT |= (1<<LED_ROT); else LEDPORT &= ~(1<<LED_ROT);
                    if (hidReceiveBuffer[2] == 1) LEDPORT |= (1<<LED_GELB); else LEDPORT &= ~(1<<LED_GELB);
                    if (hidReceiveBuffer[3] == 1) LEDPORT |= (1<<LED_GRUEN); else LEDPORT &= ~(1<<LED_GRUEN);
                    
                    // We do not send a response to this command
                    
                    break;
                
                default:
                    // Unknown command received
                    sprintf(debugString, "Unknown command received (%x)", hidReceiveBuffer[0]);
                    debugOut(debugString);
                    break;
            } // switch(hidReceiveBuffer[0])
        }
    }
}

 

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

Well that's not purely LUFA library, you should ask the WFF author for the altering of the original LUFA library code.

He knows better why he did that.

 

 

 

MG

 

I don't know why I'm still doing this hobby

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

Hi Sou77, do you still needs the solution or you had solved your problem?

I managed to do the compile, but I don't have the hardware so I haven't test it.

 

 

 

 

MG

I don't know why I'm still doing this hobby

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

not yet, if you get a solution or a suggestion for what to do I will be thankful 

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

Ok

First you have to download LUFA version 111009 if you don't have it.

Put LUFA-111009 folder in your Local Disk Root, don't place it under subfolder(s).

We need the original LUFA library because the "LUFA" at the WFF project has something's not right.

Ignore your previous project and make new one.

 

Here is the steps:

 

1. Make new project name 'HIDgenericWFF' in the LUFA-111009 'Projects' folder. Use AVRStudio new project wizard (easier).

    Use the same folder name and project name 'HIDgenericWFF' (the makefile I'll provide use that name, you can alter it later after you have succeeded)

 

2. Save the project, then inside HIDgenericWFF folder make new folder name 'Board' 

 

3. Look at WFF project for 'LUFA' folder, goto Drivers>Board>AVR8>WFFUDB (the author custom board)

    Copy 'Buttons.h and LEDs.h to folder 'Board' in your project. (you can setup your buttons and leds inside those 2 files later)

 

4. Open WFF project 'WFF GenericHID Demo Application 4_0 AVR.c' (using AVRStudio) and copy the content to your blank project 'HIDgenericWFF.c', save it.

 

5. Copy the others c and h files to your project folder (HIDgenericWFF), then add it in the files list tree.

 

    Before add it, there's h file named: WFF GenericHID Demo Application 4_0.h, rename it to shorter name like: WFF GenericHID.h

    It refused to be add to files tree, maybe because the name is too long i don't know.

    If you renamed it, you also have to rename it at the #include inside 'HIDgenericWFF.c' (above lines). I prefer to rename it so it shows in the tree.

 

6. Copy 'makefile' at WFF project to your project folder (HIDgenericWFF). 

 

7. Open menu: Project>Configuration Options (gear icon) and check 'Use external makefile' and fill it with the makefile step 6. (leave other settings)

 

8. Manually add the makefile at step 6 to files tree at folder 'Other files' then open it.

 

9. Copy below makefile text to that makefile (discard all previous text inside it) then save it.

# Hey Emacs, this is a -*- makefile -*-
#----------------------------------------------------------------------------
# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
#  >> Modified for use with the LUFA project. <<
#
# Released to the Public Domain
#
# Additional material for this makefile was written by:
# Peter Fleury
# Tim Henigan
# Colin O'Flynn
# Reiner Patommel
# Markus Pfaff
# Sander Pool
# Frederik Rouleau
# Carlos Lamas
# Dean Camera
# Opendous Inc.
# Denver Gingerich
#
#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device, using avrdude.
#                Please customize the avrdude settings below first!
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
#            have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
#             have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
#               (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
#                (must have Atmel FLIP installed).
#
# make doxygen = Generate DoxyGen documentation for the project (must have
#                DoxyGen installed)
#
# make debug = Start either simulavr or avarice as specified for debugging,
#              with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
#                   bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------

# MCU name
MCU = atmega32u4 

# Target architecture (see library "Board Types" documentation).
ARCH = AVR8

# Target board (see library "Board Types" documentation, NONE for projects not requiring
# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
# "Board" inside the application directory.
BOARD = USER 

# Processor frequency.
#     This will define a symbol, F_CPU, in all source code files equal to the
#     processor frequency in Hz. You can then use this symbol in your source code to
#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
#     automatically to create a 32-bit value in your source code.
#
#     This will be an integer division of F_USB below, as it is sourced by
#     F_USB after it has run through any CPU prescalers. Note that this value
#     does not *change* the processor frequency - it should merely be updated to
#     reflect the processor speed set externally so that the code can use accurate
#     software delays.
F_CPU = 16000000

# Input clock frequency.
#     This will define a symbol, F_USB, in all source code files equal to the
#     input clock frequency (before any prescaling is performed) in Hz. This value may
#     differ from F_CPU if prescaling is used on the latter, and is required as the
#     raw input clock is fed directly to the PLL sections of the AVR for high speed
#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
#     at the end, this will be done automatically to create a 32-bit value in your
#     source code.
#
#     If no clock division is performed on the input clock inside the AVR (via the
#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)

# Output format. (can be srec, ihex, binary)
FORMAT = ihex

# Target file name (without extension).
TARGET = HIDgenericWFF

# Object files directory
#     To put object files in current directory, use a dot (.), do NOT make
#     this an empty or blank macro!
OBJDIR = .

# Path to the LUFA library
LUFA_PATH = ../..

# LUFA library compile-time options and predefined tokens
LUFA_OPTS  = -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

# Create the LUFA source path variables by including the LUFA root makefile
include $(LUFA_PATH)/LUFA/makefile

# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c                                                      \
      Descriptors.c                                                    \
      debug.c                                                          \
      potentiometer.c                                                  \
      $(LUFA_SRC_USB)

# List C++ source files here. (C dependencies are automatically generated.)
CPPSRC =

# List Assembler source files here.
#     Make them always end in a capital .S.  Files ending in a lowercase .s
#     will not be considered source files but generated files (assembler
#     output from the compiler), and will be deleted upon "make clean"!
#     Even though the DOS/Win* filesystem matches both .s and .S the same,
#     it will preserve the spelling of the filenames, and gcc itself does
#     care about how the name is spelled on its command-line.
ASRC =

# Optimization level, can be [0, 1, 2, 3, s].
#     0 = turn off optimization. s = optimize for size.
#     (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s

# Debugging format.
#     Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
#     AVR Studio 4.10 requires dwarf-2.
#     AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
DEBUG = dwarf-2

# List any extra directories to look for include files here.
#     Each directory must be seperated by a space.
#     Use forward slashes for directory separators.
#     For a directory that has spaces, enclose it in quotes.
EXTRAINCDIRS = $(LUFA_PATH)/ 

# Compiler flag to set the C Standard level.
#     c89   = "ANSI" C
#     gnu89 = c89 plus GCC extensions
#     c99   = ISO C99 standard (not yet fully implemented)
#     gnu99 = c99 plus GCC extensions
CSTANDARD = -std=c99

# Place -D or -U options here for C sources
CDEFS  = -DF_CPU=$(F_CPU)UL
CDEFS += -DF_USB=$(F_USB)UL
CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH)
CDEFS += $(LUFA_OPTS)

# Place -D or -U options here for ASM sources
ADEFS  = -DF_CPU=$(F_CPU)
ADEFS += -DF_USB=$(F_USB)UL
ADEFS += -DBOARD=BOARD_$(BOARD)
ADEFS += $(LUFA_OPTS)

# Place -D or -U options here for C++ sources
CPPDEFS  = -DF_CPU=$(F_CPU)UL
CPPDEFS += -DF_USB=$(F_USB)UL
CPPDEFS += -DBOARD=BOARD_$(BOARD)
CPPDEFS += $(LUFA_OPTS)
#CPPDEFS += -D__STDC_LIMIT_MACROS
#CPPDEFS += -D__STDC_CONSTANT_MACROS

#---------------- Compiler Options C ----------------
#  -g*:          generate debugging information
#  -O*:          optimization level
#  -f...:        tuning, see GCC manual and avr-libc documentation
#  -Wall...:     warning level
#  -Wa,...:      tell GCC to pass this to the assembler.
#    -adhlns...: create assembler listing
CFLAGS = -g$(DEBUG)
CFLAGS += $(CDEFS)
CFLAGS += -O$(OPT)
CFLAGS += -funsigned-char
CFLAGS += -funsigned-bitfields
CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct
CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes
#CFLAGS += -mshort-calls
#CFLAGS += -fno-unit-at-a-time
#CFLAGS += -Wundef
#CFLAGS += -Wunreachable-code
#CFLAGS += -Wsign-compare
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)

#---------------- Compiler Options C++ ----------------
#  -g*:          generate debugging information
#  -O*:          optimization level
#  -f...:        tuning, see GCC manual and avr-libc documentation
#  -Wall...:     warning level
#  -Wa,...:      tell GCC to pass this to the assembler.
#    -adhlns...: create assembler listing
CPPFLAGS = -g$(DEBUG)
CPPFLAGS += $(CPPDEFS)
CPPFLAGS += -O$(OPT)
CPPFLAGS += -funsigned-char
CPPFLAGS += -funsigned-bitfields
CPPFLAGS += -fpack-struct
CPPFLAGS += -fshort-enums
CPPFLAGS += -fno-exceptions
CPPFLAGS += -Wall
CPPFLAGS += -Wundef
#CPPFLAGS += -mshort-calls
#CPPFLAGS += -fno-unit-at-a-time
#CPPFLAGS += -Wstrict-prototypes
#CPPFLAGS += -Wunreachable-code
#CPPFLAGS += -Wsign-compare
CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
#CPPFLAGS += $(CSTANDARD)

#---------------- Assembler Options ----------------
#  -Wa,...:   tell GCC to pass this to the assembler.
#  -adhlns:   create listing
#  -gstabs:   have the assembler create line number information; note that
#             for use in COFF files, additional information about filenames
#             and function names needs to be present in the assembler source
#             files -- see avr-libc docs [FIXME: not yet described there]
#  -listing-cont-lines: Sets the maximum number of continuation lines of hex
#       dump that will be displayed for a given single line of source input.
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100

#---------------- Library Options ----------------
# Minimalistic printf version
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min

# Floating point printf version (requires MATH_LIB = -lm below)
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt

# If this is left blank, then it will use the Standard printf version.
PRINTF_LIB =
#PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)

# Minimalistic scanf version
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min

# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt

# If this is left blank, then it will use the Standard scanf version.
SCANF_LIB =
#SCANF_LIB = $(SCANF_LIB_MIN)
#SCANF_LIB = $(SCANF_LIB_FLOAT)

MATH_LIB = -lm

# List any extra directories to look for libraries here.
#     Each directory must be seperated by a space.
#     Use forward slashes for directory separators.
#     For a directory that has spaces, enclose it in quotes.
EXTRALIBDIRS =

#---------------- External Memory Options ----------------

# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# used for variables (.data/.bss) and heap (malloc()).
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff

# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# only used for heap (malloc()).
#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff

EXTMEMOPTS =

#---------------- Linker Options ----------------
#  -Wl,...:     tell GCC to pass this to linker.
#    -Map:      create map file
#    --cref:    add cross reference to  map file
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
#LDFLAGS += -T linker_script.x

#---------------- Programming Options (avrdude) ----------------

# Programming hardware
# Type: avrdude -c ?
# to get a full listing.
#
AVRDUDE_PROGRAMMER = jtagmkII

# com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = usb

AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep

# Uncomment the following if you want avrdude's erase cycle counter.
# Note that this counter needs to be initialized first using -Yn,
# see avrdude manual.
#AVRDUDE_ERASE_COUNTER = -y

# Uncomment the following if you do /not/ wish a verification to be
# performed after programming the device.
#AVRDUDE_NO_VERIFY = -V

# Increase verbosity level.  Please use this when submitting bug
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_VERBOSE = -v -v

AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)

#---------------- Debugging Options ----------------

# For simulavr only - target MCU frequency.
DEBUG_MFREQ = $(F_CPU)

# Set the DEBUG_UI to either gdb or insight.
# DEBUG_UI = gdb
DEBUG_UI = insight

# Set the debugging back-end to either avarice, simulavr.
DEBUG_BACKEND = avarice
#DEBUG_BACKEND = simulavr

# GDB Init Filename.
GDBINIT_FILE = __avr_gdbinit

# When using avarice settings for the JTAG
JTAG_DEV = /dev/com1

# Debugging port used to communicate between GDB / avarice / simulavr.
DEBUG_PORT = 4242

# Debugging host used to communicate between GDB / avarice / simulavr, normally
#     just set to localhost unless doing some sort of crazy debugging when
#     avarice is running on a different computer.
DEBUG_HOST = localhost

#============================================================================

# Define programs and commands.
SHELL = sh
CC = avr-gcc
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
AR = avr-ar rcs
NM = avr-nm
AVRDUDE = avrdude
REMOVE = rm -f
REMOVEDIR = rm -rf
COPY = cp
WINSHELL = cmd

# Define Messages
# English
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = --------  end  --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking:
MSG_COMPILING = Compiling C:
MSG_COMPILING_CPP = Compiling C++:
MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:
MSG_CREATING_LIBRARY = Creating library:

# Define all object files.
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)

# Define all listing files.
LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)

# Compiler flags to generate dependency files.
GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d

# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)

# Default target.
all: begin gccversion sizebefore build sizeafter end

# Change the build target to build a HEX file or a library.
build: elf hex eep lss sym
#build: lib

elf: $(TARGET).elf
hex: $(TARGET).hex
eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym
LIBNAME=lib$(TARGET).a
lib: $(LIBNAME)

# Eye candy.
# AVR Studio 3.x does not check make's exit code but relies on
# the following magic strings to be generated by the compile job.
begin:
	@echo
	@echo $(MSG_BEGIN)

end:
	@echo $(MSG_END)
	@echo

# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )

sizebefore:
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
	2>/dev/null; echo; fi

sizeafter:
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
	2>/dev/null; echo; fi

# Display compiler version information.
gccversion :
	@$(CC) --version

# Program the device.
program: $(TARGET).hex $(TARGET).eep
	$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)

flip: $(TARGET).hex
	batchisp -hardware usb -device $(MCU) -operation erase f
	batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
	batchisp -hardware usb -device $(MCU) -operation start reset 0

dfu: $(TARGET).hex
	dfu-programmer $(MCU) erase
	dfu-programmer $(MCU) flash $(TARGET).hex
	dfu-programmer $(MCU) reset

flip-ee: $(TARGET).hex $(TARGET).eep
	$(COPY) $(TARGET).eep $(TARGET)eep.hex
	batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
	batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
	batchisp -hardware usb -device $(MCU) -operation start reset 0
	$(REMOVE) $(TARGET)eep.hex

dfu-ee: $(TARGET).hex $(TARGET).eep
	dfu-programmer $(MCU) eeprom-flash $(TARGET).eep
	dfu-programmer $(MCU) reset

# Generate avr-gdb config/init file which does the following:
#     define the reset signal, load the target file, connect to target, and set
#     a breakpoint at main().
gdb-config:
	@$(REMOVE) $(GDBINIT_FILE)
	@echo define reset >> $(GDBINIT_FILE)
	@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
	@echo end >> $(GDBINIT_FILE)
	@echo file $(TARGET).elf >> $(GDBINIT_FILE)
	@echo target remote $(DEBUG_HOST):$(DEBUG_PORT)  >> $(GDBINIT_FILE)
ifeq ($(DEBUG_BACKEND),simulavr)
	@echo load  >> $(GDBINIT_FILE)
endif
	@echo break main >> $(GDBINIT_FILE)

debug: gdb-config $(TARGET).elf
ifeq ($(DEBUG_BACKEND), avarice)
	@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
	@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
	$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
	@$(WINSHELL) /c pause

else
	@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
	$(DEBUG_MFREQ) --port $(DEBUG_PORT)
endif
	@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)

# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
COFFCONVERT = $(OBJCOPY) --debugging
COFFCONVERT += --change-section-address .data-0x800000
COFFCONVERT += --change-section-address .bss-0x800000
COFFCONVERT += --change-section-address .noinit-0x800000
COFFCONVERT += --change-section-address .eeprom-0x810000

coff: $(TARGET).elf
	@echo
	@echo $(MSG_COFF) $(TARGET).cof
	$(COFFCONVERT) -O coff-avr $< $(TARGET).cof

extcoff: $(TARGET).elf
	@echo
	@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
	$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof

# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
	@echo
	@echo $(MSG_FLASH) $@
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@

%.eep: %.elf
	@echo
	@echo $(MSG_EEPROM) $@
	-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
	--change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0

# Create extended listing file from ELF output file.
%.lss: %.elf
	@echo
	@echo $(MSG_EXTENDED_LISTING) $@
	$(OBJDUMP) -h -S -z $< > $@

# Create a symbol table from ELF output file.
%.sym: %.elf
	@echo
	@echo $(MSG_SYMBOL_TABLE) $@
	$(NM) -n $< > $@

# Create library from object files.
.SECONDARY : $(TARGET).a
.PRECIOUS : $(OBJ)
%.a: $(OBJ)
	@echo
	@echo $(MSG_CREATING_LIBRARY) $@
	$(AR) $@ $(OBJ)

# Link: create ELF output file from object files.
.SECONDARY : $(TARGET).elf
.PRECIOUS : $(OBJ)
%.elf: $(OBJ)
	@echo
	@echo $(MSG_LINKING) $@
	$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)

# Compile: create object files from C source files.
$(OBJDIR)/%.o : %.c
	@echo
	@echo $(MSG_COMPILING) $<
	$(CC) -c $(ALL_CFLAGS) $< -o $@

# Compile: create object files from C++ source files.
$(OBJDIR)/%.o : %.cpp
	@echo
	@echo $(MSG_COMPILING_CPP) $<
	$(CC) -c $(ALL_CPPFLAGS) $< -o $@

# Compile: create assembler files from C source files.
%.s : %.c
	$(CC) -S $(ALL_CFLAGS) $< -o $@

# Compile: create assembler files from C++ source files.
%.s : %.cpp
	$(CC) -S $(ALL_CPPFLAGS) $< -o $@

# Assemble: create object files from assembler source files.
$(OBJDIR)/%.o : %.S
	@echo
	@echo $(MSG_ASSEMBLING) $<
	$(CC) -c $(ALL_ASFLAGS) $< -o $@

# Create preprocessed source for use in sending a bug report.
%.i : %.c
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@

# Target: clean project.
clean: begin clean_list end

clean_list :
	@echo
	@echo $(MSG_CLEANING)
	$(REMOVE) $(TARGET).hex
	$(REMOVE) $(TARGET).eep
	$(REMOVE) $(TARGET).cof
	$(REMOVE) $(TARGET).elf
	$(REMOVE) $(TARGET).map
	$(REMOVE) $(TARGET).sym
	$(REMOVE) $(TARGET).lss
	$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
	$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
	$(REMOVE) $(SRC:.c=.s)
	$(REMOVE) $(SRC:.c=.d)
	$(REMOVE) $(SRC:.c=.i)
	$(REMOVEDIR) .dep

doxygen:
	@echo Generating Project Documentation \($(TARGET)\)...
	@doxygen Doxygen.conf
	@echo Documentation Generation Complete.

clean_doxygen:
	rm -rf Documentation

checksource:
	@for f in $(SRC) $(CPPSRC) $(ASRC); do \
		if [ -f $$f ]; then \
			echo "Found Source File: $$f" ; \
		else \
			echo "Source File Not Found: $$f" ; \
		fi; done 

# Create object files directory
$(shell mkdir $(OBJDIR) 2>/dev/null)

# Include the dependency files.
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)

# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion \
build elf hex eep lss sym coff extcoff doxygen clean          \
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
debug gdb-config checksource

10. Save the project then compile it.

 

 

Here's my compile result :

Size after:
AVR Memory Usage
----------------
Device: atmega32u4

Program:    5530 bytes (16.9% Full)
(.text + .data + .bootloader)

Data:        463 bytes (18.1% Full)
(.data + .bss + .noinit)

-------- end --------

Build succeeded with 0 Warnings...

 

 

 

 MG

 

   

 

I don't know why I'm still doing this hobby

Last Edited: Thu. Jun 15, 2017 - 08:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you very much, I will check it 

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

there is still an error :/ 

------ Build started: Project: HIDgenericWFF, Configuration: Debug AVR ------
Build started.
Project "HIDgenericWFF.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\lufa-LUFA-111009\Projects\HIDgenericWFF\HIDgenericWFF\HIDgenericWFF.cproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe -C "D:\lufa-LUFA-111009\Projects\HIDgenericWFF" -f "Makefile" all 
        make: Entering directory 'D:/lufa-LUFA-111009/Projects/HIDgenericWFF'
        make: *** No rule to make target '.././debug.c', needed by 'debug.o'.  Stop.
        make: Leaving directory 'D:/lufa-LUFA-111009/Projects/HIDgenericWFF'
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "HIDgenericWFF.cproj" -- FAILED.
Done building project "HIDgenericWFF.cproj" -- FAILED.

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

So where on your drive is debug.c located if it's not in the D:/lufa-LUFA-111009/Projects/HIDgenericWFF where this appears to be looking for it?

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

the problem that the file is already there! I don't know why the compiler couldn't recognize it 

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

Well there has to be something different between what MicroGuy (works) and you (doesn't work) have?

 

For example if you really can "see" the file there could it be that the file is Debug.c or dEbUG.c or something instead of debug.c ? (case may matter depending on the build environment)

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

Here is my explorer looks like after compiled:

 

 

And here's my AVRStudio:

 

You should got into this if you follow my steps above.

 

Try to change your folder name lufa-LUFA-111009 to LUFA-111009.

 

It can't find debug.c because it can't find the path given at the makefile

 

 

edit: recheck your makefile has the same content with above post

 

 

MG

 

I don't know why I'm still doing this hobby

Last Edited: Thu. Jun 15, 2017 - 03:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sou77 wrote:
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\lufa-LUFA-111009\Projects\HIDgenericWFF\HIDgenericWFF\HIDgenericWFF.cproj" (target "Build" depends on it):

 

I don't understand why is the project inside subfolder then inside subfolder again ?

That could lead to miss path find.

I don't know why I'm still doing this hobby

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

MicroGyro wrote:
I don't understand why is the project inside subfolder then inside subfolder again ?
Well two of the levels are to do with AS7 which creates a solution level directory and then a project level directory. If that was then occuring in a "parent" directory I could then maybe see why there'd be three.

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

Severity    Code    Description    Project    Project Rank    File    Line    Source
Error        ../../LUFA/makefile: No such file or directory    WFFgenericHID    1    C:\LUFA-111009\Projects\WFFgenericHID\WFFgenericHID\Makefile    120    Build

:/

 

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

MicroGyro wrote:

Sou77 wrote:
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\lufa-LUFA-111009\Projects\HIDgenericWFF\HIDgenericWFF\HIDgenericWFF.cproj" (target "Build" depends on it):

 

I don't understand why is the project inside subfolder then inside subfolder again ?

That could lead to miss path find.

clawson wrote:

MicroGyro wrote:
I don't understand why is the project inside subfolder then inside subfolder again ?
Well two of the levels are to do with AS7 which creates a solution level directory and then a project level directory. If that was then occuring in a "parent" directory I could then maybe see why there'd be three.

yes because I work on AS7 at home :/  I tried to change it to one file doesn't work 

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

Don't mess with how Atmel Studio organizes solutions and projects. Accept the structure. Fighting it will only bring grief, with no obvious advantages.

As Cliff says, the first is the solution name and the second is the project name. They often happen to be the same but not necessarily always.

Just because you don't need and want a feature this does not mean that you can pull the rug under Studios feet. Especially so when the reason for it, in this case the two identical names, is poorly understood.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Sou77 wrote:

thank you for the helping Im a beginner in Microcontroller how to use the provided makefile  in my program? as Im using AVR Studio 4 

 

Sou77 wrote:
yes because I work on AS7 at home :/  I tried to change it to one file doesn't work 

 

Clearly you don't needs answer for your problem. Looks like you are an expert to me. I can't follow it. I'm just an ordinary guy who do this hobby at spare time.

 

That was project in 2011 so use tools at that day, big chance it will works fine. Except you know how to cross projects.

 

That WFF project was in Studio 5 and the author also provide the Studio 5 project file, you can easily open it in Studio 5 and no problem will occurs.

 

BUT you wrote Im using AVR Studio 4 so I tried to figure it out.

 

The makefile I provide is for Studio 4 (it was created by experts so I stick to their rule how to use it), even it should works in Studio 5 or 7 there's should be differences in them how they works inside, even a little.

Compare the makefile I provided with the WFF makefile and the AS7 makefile, you should find your answer there.

 

Maybe I had the answer, but it will be waste time for me to explain it to you.

 

 

Good luck

 

MG

 

 

I don't know why I'm still doing this hobby

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

Sorry if it looks like I'm expert or anything  :( , Im relly a beginner...  Im really was stuck in this  problem for around a month and Im using the AVR 4 in the lab where I have to finish the project but I download the new version at home to try the library on it because as Im getting  error related to the library not to my changes in the code, so  I thought that it might be because of the old version 

I will still try your way on Monday in the lab and hope it will work on it , even though I will get problems like that maybe I will cant put the library in the general desk "c" for example 

but the point as Im was really happy with the help I just want to see if it will work so I start trying it on the AVR7 because its the only version I had at home (I look to download the old version but i couldnt find download file) but any other way Im not any expert 

I really thank you for your helping because I know that it took time to try it and fix it and I know that the time is the most valuable thing that the human own 

so I dont want you to think that you are wasting your time I really thank you and whatever happened if it work with me or not on Monday at least you give me some hints and some hope that it  may  work  beacause after month of trying I somehow lost any hope 

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

The original LUFA was designed to be used with Makefiles at the command line, not IDE projects (because it is very complex in the use of make). So I would just build it that way.

 

Only if you make the transition to AS7 where you can add the LUFA extension from the gallery would I be tempted to use an IDE project rather than just command line building with make because Dean has already ironed out the build hierarchy and dependencies i nthe AS7 auto-generated projects.

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

Sou77 wrote:
in the lab and hope it will work on it

 

Sou77 wrote:
whatever happened if it work with me or not

 

It will work !

 

I managed to lend an ATmega32U4 module from my friend's lab and I did test the Hardware in there and it DID WORK ! (I'm the guy who had a big curiosity wink)

But this Simon guy is unpredictable. You'll understand after you try his project.

 

If your's doesn't work then there must be something wrong with your setup or Studio.

 

 

Sou77 wrote:
after month of trying I somehow lost any hope 

Well you have your hope back.angel

 

 

 

MG

I don't know why I'm still doing this hobby

Last Edited: Sun. Jun 18, 2017 - 04:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It doesnt work because of the directory of the file :/ 
I couldnt put it in the main disk and even try with the original library without the application of the Wff it either give the directory error or the old three error when I change in the header file from include<LUFA/Driver/USB/USB.h> to "LUFA/Driver/USB/USB.h" 
another question is there  another  link to download AVR studio because here I get lost which one there is several copies http://www.atmel.com/tools/studi...

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

Sou77 wrote:
there is several copies
Suggest you read the TOP of that page:

 

 

that is an archive of all the old, out of date, (probably bug ridden) versions. As it says there if you want the "latest" you follow the link near the top. That should take you to:

 

http://www.microchip.com/develop...

 

On that page you only get a choice of two:

 

 

Either you download the small "stub" and then it will pull in the bits you select from the internet during installation. Or you download the big version which does not need to be connected to the internet while you are installing.

 

In this day and age I think most would pick the "web installer".

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

JohanEkdahl wrote:
Don't mess with how Atmel Studio organizes solutions and projects. Accept the structure. Fighting it will only bring grief, with no obvious advantages.

Why does that make me think of

Never try to teach a pig to sing. It wastes your time, and it annoys the pig --
-- Robert Heinlein

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Why does that make me think of the proverb that Eric WinAVR Weddington posted here eons ago: Arguing with an engineer is like wrestling with a pig in mud. After a while you realize the pig enjoys it..

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Sou77 wrote:
I couldnt put it in the main disk
 

 

You don't have to put it in the main disk C. If you had partition D or E or F or whatever... you still can put the LUFA-111009 in there.

The result would be the same.

Or you can put it in the 1 subfolder like this: C > Myfolder > LUFA-111009 or D > Myfolder > LUFA-111009 or ...

 

 

I had tried it in 4 different PC / laptop (including my friend's) and I don't get any trouble. That's so wierd you can't achive that. 

 

I can give you my Studio installer that I used, but I don't think that's the problem. And I don't think Windows version matter here either.

 

 

Sou77 wrote:
and even try with the original library without the application of the Wff it either give the directory error or the old three error when I change in the header file from <LUFA/Driver/USB/USB.h> to include to "LUFA/Driver/USB/USB.h" 
 

 

And DO NOT MESS WITH THE ORIGINAL LUFA UNLESS YOU KNOW WHAT YOU ARE DOING ! THERE IS NO PROBLEM IN IT !

 

 

So let me know if you still want to fight or give it up.

 

 

 

 

MG

I don't know why I'm still doing this hobby

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

MicroGyro wrote:

 

So let me know if you still want to fight or give it up.

 

thank you for your patient I cant even give up  ^^

I will try again with a different computer if I could find another one with AVR 4 .

I tried it in a different disk and I get the error of the path again  

clawson wrote:

 

On that page you only get a choice of two:

 

 

Either you download the small "stub" and then it will pull in the bits you select from the internet during installation. Or you download the big version which does not need to be connected to the internet while you are installing.

 

 

thank you, I was looking for AVR Studio 4,  sorry I forget to mention that :/  for my laptop so I could try the code on it without the complications of the AVR 7 and without the need of the lab computer 

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

Sou77 wrote:
if I could find another one with AVR 4 .

 

https://www.4shared.com/zip/YxhA1hzZei/Studio4.html

 

 

edit: I don't have any other answer if it still don't work.

PS    And re-check again that your makefile has the same content as above post!

I don't know why I'm still doing this hobby

Last Edited: Tue. Jun 20, 2017 - 08:45 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And are you sure the compiler that comes with AVR Studio 4 is new enough to handle the LUFA code?
The csnonical site for old Studio versiond is here, btw: http://www.atmel.com/tools/studioarchive.aspx

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Tue. Jun 20, 2017 - 11:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you cut and paste a makefile (as it sometimes uses invisible tabs, which are converted into spaces, and as these tabs have a meaning , spaces being meaningless.... It occured once for me with dillo -a PC boat ladder : never will do it again...maybe... )

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

JohanEkdahl wrote:
And are you sure the compiler that comes with AVR Studio 4 is new enough to handle the LUFA code?

 

Works for me      d_(^^')

I don't know why I'm still doing this hobby

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

dbrion0606 wrote:

Did you cut and paste a makefile (as it sometimes uses invisible tabs, which are converted into spaces, and as these tabs have a meaning , spaces being meaningless.... It occured once for me with dillo -a PC boat ladder : never will do it again...maybe... )

 

Never experienced that

I don't know why I'm still doing this hobby

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

MicroGyro wrote:

 

 

6. Copy 'makefile' at WFF project to your project folder (HIDgenericWFF). 

 

 

to the projct folder or to the LUFA as the include 

include $(LUFA_PATH)/LUFA/makefile

when I put it in the project file it dosent work it keep give me that couldnt find the path or the file :/

Last Edited: Fri. Jun 23, 2017 - 09:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sou77 wrote:
to the projct folder or to the LUFA as the include 

Project folder.

 

And do not alter LUFA for any reason. I told you many times. You'll make thing worse if you do "anything" with LUFA.

 

And this is inside the makefile that shouldn't be change. That's point to the core makefile of LUFA. Not the one you just added ! So please stop messing around with LUFA library.

include $(LUFA_PATH)/LUFA/makefile

 

 

Please send me your complete project file in Studio 4 so I can see what's going wrong. Explained it to you didn't make any progress.

 

What studio you used? The one I uploaded here? Or else?

As I already noted: make new project... that means don't stick to your error project. Make a fresh start.

 

 

 

MG

 

I don't know why I'm still doing this hobby

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

this the path I put the project in 
U:\LUFA-111009\Projects

and the file in the attachment it still give me that it doesnt find the file 

Attachment(s): 

Last Edited: Fri. Jun 23, 2017 - 11:48 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sou77 wrote:
this the path U:\LUFA-111009\Projects

Drive U? 

 

 

 

 

MG

I don't know why I'm still doing this hobby

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

yes its the only drive I can work on it in the lab 

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

Ok.

Please try this. Hope all working fine.

 

 

 

 

MG

 

Attachment(s): 

I don't know why I'm still doing this hobby

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

the same error 
Das System kann den angegebenen Pfad nicht finden.

 

the system can not find the path specified. :/ 

 

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

Do your Studio work in the same U: drive?

 

 

Anyway, how about this?

 

 

MG

 

Attachment(s): 

I don't know why I'm still doing this hobby

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

yes I use it for other programs 

nothing new doesnt work :/ 

the same error

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

I hope you haven't give up trying.

 

We don't use external makefile anymore. Don't "check" that option.

Instead you must set "Include Directories" path manually in the Configuration Options (Gear Icon).

Point it to LUFA folder "inside" HIDGenericWFF project folder not the original LUFA folder. It's different inside.

This way Studio will search for the file. I hope I'm right.

 

With that strange behaviour it's difficult to find why it can't find the directory which is already in the same folder with the project file. Still can't figure it out.

 

Try this one.  

 

 

 

MG

Attachment(s): 

I don't know why I'm still doing this hobby

Pages