OSVR / OSVR-HDK-MCU-Firmware

Firmware source for the main Atmel microcontroller in HMDs related to the OSVR HDK
13 stars 6 forks source link

multiple definition of `HDMI_task' (breaks firmware building) #36

Closed isopix closed 3 years ago

isopix commented 3 years ago

I've tried to build '2.01' firmware without success. Ia'm on latest master, haven't bisected yet (not sure if it's really needed, because it's probably obvious bug for a porgrammer) 66bfb400e8e8e343ec447a4deca307be077ec0f2 (HEAD -> master, origin/master, origin/HEAD)

make hdk2.hex 
cat gitdefines.h.tmp | tr "+=" "\#\042" > gitdefines.h
[HDK_20][-O3] ../src/Revision.c : HDK_20/src/Revision.o
[HDK_20] Linking HDK_20/HMD_MCU.elf
/usr/bin/avr-ld: HDK_20/src/main.o: in function `main':
/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/main.c:93: multiple definition of `HDMI_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here
/usr/bin/avr-ld: disabling relaxation; it will not work with multiple definitions
/usr/bin/avr-ld: HDK_20/src/main.o: in function `main':
/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/main.c:93: multiple definition of `HDMISwitch_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here
/usr/bin/avr-ld: HDK_20/src/uart_xmega.o:(.bss.HDMISwitch_task+0x0): multiple definition of `HDMISwitch_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here
/usr/bin/avr-ld: HDK_20/src/uart_xmega.o:(.bss.HDMI_task+0x0): multiple definition of `HDMI_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here
/usr/bin/avr-ld: HDK_20/src/DeviceDrivers/VideoInput.o: in function `VideoInput_Get_Status':
/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/DeviceDrivers/VideoInput.c:94: multiple definition of `HDMI_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here
/usr/bin/avr-ld: HDK_20/src/DeviceDrivers/VideoInput.o: in function `VideoInput_Get_Status':
/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/DeviceDrivers/VideoInput.c:94: multiple definition of `HDMISwitch_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here
collect2: error: ld returned 1 exit status
make: *** [add_variant.mk:88: HDK_20/HMD_MCU.elf] Error 1
isopix commented 3 years ago

@rpavlik , Hi, Could you comment if it's broken only for me or share latest firmware in binary form?

rpavlik commented 3 years ago

Hmm, I built this recently and didn't see any issues. the make command you want is make hdk2_svr (leftover artifact from when Razer wanted the vendor ID in the EDID to be the panel manufacturer, which we at Sensics disagreed with, so there were two builds. The SVR one is the main one people use, I can't remember the last time I even tried the other.)

However, I did your command and it still worked. Not sure what the issue is here - maybe left over objects? Try make clean or similar.

isopix commented 3 years ago

git status On branch master Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean  badpixel \ … \ Source code \ Embedded \ makefile-build \ make hdk2_svr make: *** No rule to make target 'hdk2_svr'. Stop.

make all

cat gitdefines.h.tmp | tr "+=" "#\042" > gitdefines.h [HDK_20][-O3] ../src/Revision.c : HDK_20/src/Revision.o [HDK_20] Linking HDK_20/HMD_MCU.elf /usr/bin/avr-ld: HDK_20/src/main.o: in function main': /home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/main.c:93: multiple definition of HDMI_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here /usr/bin/avr-ld: disabling relaxation; it will not work with multiple definitions /usr/bin/avr-ld: HDK_20/src/main.o: in function main': /home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/main.c:93: multiple definition of HDMISwitch_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here /usr/bin/avr-ld: HDK_20/src/uart_xmega.o:(.bss.HDMISwitch_task+0x0): multiple definition of HDMISwitch_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here /usr/bin/avr-ld: HDK_20/src/uart_xmega.o:(.bss.HDMI_task+0x0): multiple definition ofHDMI_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here /usr/bin/avr-ld: HDK_20/src/DeviceDrivers/VideoInput.o: in function VideoInput_Get_Status': /home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/DeviceDrivers/VideoInput.c:94: multiple definition ofHDMI_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here /usr/bin/avr-ld: HDK_20/src/DeviceDrivers/VideoInput.o: in function VideoInput_Get_Status': /home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/DeviceDrivers/VideoInput.c:94: multiple definition ofHDMISwitch_task'; HDK_20/src/SerialStateMachine.o:/home/badpixel/Downloads/VR_HMD_VirtualRealityHeadset/Razer_Sensics_OSVR_HDK2/githubs/osvr_github/OSVR-HDK-MCU-Firmware/Source code/Embedded/makefile-build/../src/SerialStateMachine.c:516: first defined here collect2: error: ld returned 1 exit status make: *** [add_variant.mk:88: HDK_20/HMD_MCU.elf] Error 1

On 9/28/20, Ryan A. Pavlik notifications@github.com wrote:

Hmm, I built this recently and didn't see any issues. the make command you want is make hdk2_svr

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/OSVR/OSVR-HDK-MCU-Firmware/issues/36#issuecomment-700155028

isopix commented 3 years ago

Iv'e tried in clean(new) git clone and same result. I guess it's realted to new arm linker:  avr-ld -v GNU ld (GNU Binutils) 2.35

isopix commented 3 years ago

I found this explanation, but #pragma once doesn't help. https://stackoverflow.com/questions/29189045/multiple-definitions-of-gcc-bogus-error

 find ../ -type f -exec grep -Hi "bool HDMI_task" {} + ../src/main.c:bool HDMI_task = false; ../src/main.h:bool HDMI_task;

find ../ -type f -exec grep -Hi "bool HDMISwitch_task" {} + ../src/main.c:bool HDMISwitch_task = true; ../src/main.h:bool HDMISwitch_task;

Anyway I would be happy even with precompiled firmware if you got one around ;-)

isopix commented 3 years ago

@rpavlik It looks like many old software won't compile with my fresh GNU linker. But could you share binary release of firmware somewhere?

rpavlik commented 3 years ago

yeah I'll do that when I reboot. FYI there is CI that should have built things too. I think the main.h entries need extern in front of bool

isopix commented 3 years ago

Thx, now 'make all' completes.

BTW, I wonder now how many firmware are there for HDK. I know at leat 3:

  1. HDK MCU firmware
  2. IR Board firmware
  3. Camera firmware. (There's really no way to upgrade it from linux? v0.07 is still the latest version?)

Is there some other (like beltbox) firmware to upgrade too?

On 10/6/20, Ryan A. Pavlik notifications@github.com wrote:

yeah I'll do that when I reboot. FYI there is CI that should have built things too. I think the main.h entries need extern in front of bool

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/OSVR/OSVR-HDK-MCU-Firmware/issues/36#issuecomment-704334244

rpavlik commented 3 years ago

No beltbox firmware that I know of. I had/have no control over the camera firmware, I wasn't thrilled with the firmware period, much less the updater - that was done by the camera ODM. v7 is still the latest. It's on a little eeprom in there so I suppose in theory you could reprogram it outside of the device, but I've never taken the shielding tin off.

There's also bitcode for the FPGA on the HDK1.x - the source is public, I think (in this repo?), but uses Xilinx IP blocks. No upgrades have ever happened there.

Based on the BOM, there's some eeprom on the belt box but I have no idea what's in it and it's not upgraded anywhere. Can't remember if that's for the audio chip or the USB hub in it. never dumped it.

There's firmware in the IMU, you probably already upgraded it ("performance upgrade"). Think it's just for the 1.x? It's been a while since I thought about it.

I don't think there's anything else programmable anywhere in the system :)