I need to replace system uothgs handler with my own.
I cannot find WHERE is the Arduino's uotghs.c file.
This error message is not helpful.
But I did find one elsewhere else, but that is not part of the compilation.
/home/jim/.arduino15/packages/arduino/hardware/sam/1.6.9/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a(uotghs.o): In function `UOTGHS_Handler':
uotghs.c:(.text.UOTGHS_Handler+0x0): multiple definition of `UOTGHS_Handler'
sketch/PAL_37-2-9-16-WEB_CAM_V3_UOTHS.ino.cpp.o:sketch/WEB_CAM_HCD.h:243: first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Due (Programming Port).
Using linux "find" did not find it either.
Any help would be appreciated.
If I recompile just the libsam I do not need to recompile the whole IDE.
I should than rename / replace the original .a file
Still little scary.
Thanks for all your help.
[
OK, I admit it, I need more assistance .
I have identified the file i need to modify, found the "makes", but now I am stuck.
Obviously I have no clue HOW to use "make".
From doc just "Makefile" in the directory folder should work , but I "command not found".
When i do "make Makefile" i get something about nothing to do for Makefille.
When I do "make Makefile clean ":it does something but obviously not building the file I am after.
For short- what is the correct syntax for "make" to recompile the code I am after.
Thanks.
Jim
I had to delete most of the code , too big to post.
-
-rw-rw-r-- 1 jim jim 1011 Sep 2 08:16 debug.mk
-rw-rw-r-- 1 jim jim 2331 Sep 2 08:16 gcc.mk
-rw-rw-r-- 1 jim jim 5610 Sep 2 08:16 Makefile
-rw-rw-r-- 1 jim jim 1000 Sep 2 08:16 release.mk
-rw-rw-r-- 1 jim jim 6210 Sep 2 08:16 sam3.mk
jim@jim-desktop:~/Downloads/Arduino/hardware/arduino/sam/system/libsam/build_gcc$ gcc.mk
gcc.mk: command not found
jim@jim-desktop:~/Downloads/Arduino/hardware/arduino/sam/system/libsam/build_gcc$ ls -l
total 28
-rw-rw-r-- 1 jim jim 1011 Sep 2 08:16 debug.mk
-rw-rw-r-- 1 jim jim 2331 Sep 2 08:16 gcc.mk
-rw-rw-r-- 1 jim jim 5610 Sep 2 08:16 Makefile
-rw-rw-r-- 1 jim jim 1000 Sep 2 08:16 release.mk
-rw-rw-r-- 1 jim jim 6210 Sep 2 08:16 sam3.mk
jim@jim-desktop:~/Downloads/Arduino/hardware/arduino/sam/system/libsam/build_gcc$ make Makefile
make: Nothing to be done for 'Makefile'.
jim@jim-desktop:~/Downloads/Arduino/hardware/arduino/sam/system/libsam/build_gcc$ make clean Makefile
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
--- Cleaning __SAM3X8E__ files release_sam3x8e ../../../cores/arduino/libsam_sam3x8e_gcc_rel.a
------------------------------------------------------------------------------------
----------------------------------
target 'debug_sam3x8h/uotghs' doesn't match the target pattern
------------------------------------------------------------------------------------
--- Cleaning __SAM3X8H__ files debug_sam3x8h ../../../cores/arduino/libsam_sam3x8h_gcc_dbg.a
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
jim@jim-desktop:~/Downloads/Arduino/hardware/arduino/sam/system/libsam/build_gcc$
What does make clean and make all do? You might need to set some environment variables (do that on the side - in a directory with a copy of the code from the link above - not within the IDE libraries files system)
So you need to define the gpf_isr function pointer. The default one points to null, have it point to your function and that is what will be called. No need to change the library.
J-M-L:
BTW - I should have asked before - why do you need to replace it? Seems weird
This is the code in the library
void (*gpf_isr)(void) = (0UL);
void UOTGHS_Handler( void )
{
if (gpf_isr)
gpf_isr();
}
So you need to define the `gpf_isr` function pointer. The default one points to null, have it point to your function and that is what will be called. No need to change the library.
I am using part of code build in ATmel Studio and the UOTGHS_Handler( was redefined by the author.
I like what you suggesting and will try it next.
Could you give me a hint how ? Not that handy with pointers.
But i'll take another look at "make" so I can learn something about it.