Author Topic: Re-building the variant (variant.cpp) from libsam to enable hardware watchdog...  (Read 4553 times)

N3rdle

  • Newbie
  • *
  • Posts: 4
Hi all.

I've been trying (quite unsuccessfully i might add) to re-bulid the DigiX libsam due to a modified variant.cpp that enables the hardware watchdog on the Atmel CPU (that is disabled by default in the init() routine for the Due which the DigiX just copied).  I'm trying to do this on 1.5 beta SDK, btw.

here's what i'm doing:

cd to digitump\sam\variants\digix\build_gcc
set environment variable ARM_GCC_TOOLCHAIN=<path_to>g++_arm_non_eabi\bin
run cs_make

It fails with "variant.h:36 fatal error: Arduino.h: No such file or directory"
ok, so for reasons that don't make sense to me after looking at all the makefiles, it doesn't have the proper path to the Arduino.h for the DigiX in its include path.  so, i look at the makefiles and notice that the makefile will use whatever i pass in for INCLUDES, so i do the following:

cs_make INCLUDES=..\..\..\cores\digix

now, it fails as such:

arm-none-eabi-gcc: cannot specific -o with -c or -S with multiple files

that error message makes great sense, of course this isn't legal, but WHY is the makefile deciding to pass multiple arguments?
when i do cs_make --debug <args_above>, i see only that it determined that variant.o is out of date, and the pattern rule for variant.o depends only on variant.cpp...

any clues? what's the *right* way to do this?  i must say the documentation for how to do this is particularly weak in the Arduino world...

believe it or not, the best reference i could find is barely relevant:

https://android.googlesource.com/platform/external/arduino-ide/+/f876b2abdebd02acfa4ba21e607327be4f9668d4/hardware/arduino/sam/cores/arduino/HOWTO%20-%20compiling%20a%20project.txt

Cheers

Peter

N3rdle

  • Newbie
  • *
  • Posts: 4
so strangely enough, when i copied libsam out to a backup location, did a make clean (which worked fine), moved the backup copies of libsam ba k into plave, then rebuilt my sketch, although i couldn't see evidence of a new libsam being built,  the watchdog just started working... I'm utterly perplexed how...

dougal

  • Sr. Member
  • ****
  • Posts: 289
Magic!  ;)