Coder Social home page Coder Social logo

Comments (5)

khimaros avatar khimaros commented on August 29, 2024

i'm also running into this with the 170418 release.

from lufa.

khimaros avatar khimaros commented on August 29, 2024

i've been able to work around this with the following steps:

$ cd <my project dir>
$ make teensy-ee
[...]
make[1]: *** No rule to make target 'obj/InputEEData.o', needed by 'HID_EEPROM_Loader.elf'.  Stop.
make: *** [../../../../lufa/LUFA/Build/DMBS/DMBS/hid.mk:55: teensy-ee] Error 2
$ cd ${LUFA_PATH}/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/
$ avr-objcopy -I binary -O elf32-avr -B avr5 --rename-section .data=.progmem.data,contents,alloc,readonly,data InputEEData.bin obj/InputEEData.o
$ make teensy

it seems that there is some sort of conflict between the implicit %.o targets defined in gcc.mk and the InputEEData.o target defined in HID_EEPROM_Loader/makefiles

from lufa.

khimaros avatar khimaros commented on August 29, 2024

for context, this is with GNU Make 4.2.1.

after a bit more poking around, the following patch works for my case:

diff --git a/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile b/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile
index 879eda8cf..12879eac8 100644
--- a/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile
+++ b/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile
@@ -22,12 +22,12 @@ OBJECT_FILES = InputEEData.o
 all:
 
 # Determine the AVR sub-architecture of the build main application object file
-FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1)
+FIND_AVR_SUBARCH = avr$(shell avr-objdump -f obj/$(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1)
 
 # Create a linkable object file with the input binary EEPROM data stored in the FLASH section
-InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST)
+obj/InputEEData.o: obj/HID_EEPROM_Loader.o
        @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\"
-       avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@
+       avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data InputEEData.bin $@
 
 # Include LUFA build script makefiles
 include ../core.mk

the build steps i tested:

$ cd <my project dir>
$ make teensy-ee
<press bootloader button>
$ make teensy

digging further; renaming the InputEEData.o target to obj/InputEEData.o isn't sufficient, as the dependency on InputEEData.bin seems to cause a transitive cyclical dependency via the %.bin target in gcc.mk:

[...]
        Considering target file 'InputEEData.bin'.
         Looking for an implicit rule for 'InputEEData.bin'.
         Trying pattern rule with stem 'InputEEData'.
         Trying implicit prerequisite 'InputEEData.elf'.
         Trying pattern rule with stem 'InputEEData'.
         Trying implicit prerequisite 'InputEEData.elf'.
         Looking for a rule with intermediate file 'InputEEData.elf'.
          Avoiding implicit rule recursion.
          Trying pattern rule with stem 'InputEEData'.
          Trying rule prerequisite 'obj/InputEEData.o'.
          Trying rule prerequisite 'obj/HID_EEPROM_Loader.o'.
         Found an implicit rule for 'InputEEData.bin'.
make[1]: Circular InputEEData.elf <- obj/InputEEData.o dependency dropped.
 [GCC]     : Compiling C file "HID_EEPROM_Loader.c"
 [LNK]     : Linking object files into "InputEEData.elf"
obj/HID_EEPROM_Loader.o: In function `main':
HID_EEPROM_Loader.c:(.text.startup.main+0x4): undefined reference to `_binary_InputEEData_bin_size'
HID_EEPROM_Loader.c:(.text.startup.main+0x6): undefined reference to `_binary_InputEEData_bin_size'
HID_EEPROM_Loader.c:(.text.startup.main+0xe): undefined reference to `_binary_InputEEData_bin_start'
HID_EEPROM_Loader.c:(.text.startup.main+0x10): undefined reference to `_binary_InputEEData_bin_start'
collect2: error: ld returned 1 exit status
make[1]: *** [../gcc.mk:250: InputEEData.elf] Error 1
make: *** [../../../../lufa/LUFA/Build/DMBS/DMBS/hid.mk:55: teensy-ee] Error 2

from lufa.

abcminiuser avatar abcminiuser commented on August 29, 2024

Thanks for looking at this. It's actually an issue in the upstream DMBS project, which I import into LUFA here. It's also trying to embed the application binary rather than the EEPROM data for the Teensy target, which is doubly embarrassing.

I've fixed both in abcminiuser/dmbs@3f76496 and imported it here in 305ca46 .

The CI build failure was a dumb mistake, corrected in ca40bc7 .

Please-reopen if it's still failing for you, but I see it generating and attempting to program the EEPROM loader application when testing the updated code locally.

from lufa.

khimaros avatar khimaros commented on August 29, 2024

This worked for me. Thank you, Dean!

from lufa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.