How to build and change the latest core sources?

Sorry not sure of the best way to ask this, that will make sense.

But wondering what process the Arduino developers do, to make changes, to the core code associated with the UNO R4 boards.

A lot of the sources are up in the github project:
arduino/ArduinoCore-renesas (github.com)

Obviously I can simply edit the source files that are installed by the boards manager at:
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores
And then in theory copy files to and from the github project... But this is easy to miss things.

When I am doing stuff on a Teensy, what I often will do instead is to rename the cores directory that the board manager installed to something like cores_orig and then create a junction link to my github project. Again something like:
mklink /J cores d:\github\cores

And then I am building with the latest sources and all of my edits are done to the github project code.

I am trying to see how feasible that is with the ArduinoCore-renesas. So I first tried simple git clone (github desktop clone)... failed, so instead did command line clone with the --recursive option.

But it could not find the api directory. There was a simple file, that maybe on some systems is a link file, to the directory: ......\ArduinoCore-API\api
So I cloned that directory and made junction... and got a little farther.

But then received lots of compiler errors like:

"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -Wall -Wextra -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino\\usb\\SerialUSB.cpp" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\core\\usb\\SerialUSB.cpp.o"
In file included from C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\api\CanMsgRingbuffer.h:17:0,
                 from C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\api\CanMsgRingbuffer.cpp:12:
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\api\CanMsg.h: In member function 'virtual size_t arduino::CanMsg::printTo(arduino::Print&) const':
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\api\CanMsg.h:71:71: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
     len = snprintf(buf, sizeof(buf), "[%08X] (%d) : ", id, data_length);
                                                        ~~             ^
In file included from C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\usb\SerialUSB.cpp:3:0:
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1/cores/arduino/tinyusb/tusb.h:1:1: error: expected unqualified-id before '.' token
 ../../../extras/tinyusb/src/tusb.h
 ^
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\usb\SerialUSB.cpp: In member function 'bool _SerialUSB::connected()':
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\usb\SerialUSB.cpp:28:13: error: 'tud_cdc_connected' was not declared in this scope
     return (tud_cdc_connected() || ignore_dtr);
             ^~~~~~~~~~~~~~~~~
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\usb\SerialUSB.cpp:28:13: note: suggested alternative: 'connected'
     return (tud_cdc_connected() || ignore_dtr);
             ^~~~~~~~~~~~~~~~~
             connected
...

I know I am probably missing something obvious, and will try a few other things before I simply punt back to the other way.

But was wondering what others do?
Thanks
Kurt

I don't have it fully building a sketch yet with the github code... But getting closer.
Note I am running windows 11.

What I have done so far:
I found you need to clone the project recursively:git clone --recursive GitHub - arduino/ArduinoCore-renesas

That was not unexpected. But then found there were some form of Sybolic links built into the project. That were showing up as a file that only contained a relative pathname to a another file or directory... Several internet searches later found, I probably needed to reinstall git and enable one of the advanced options for symbolic links... So installed 2.41....

One of the places I saw mentioned maybe telling the clone to enable symbolic links.
So I recloned again:
git clone --recursive -c core.symlinks=true GitHub - arduino/ArduinoCore-renesas

This failed:

remote: Total 12483 (delta 1206), reused 1215 (delta 1197), pack-reused 11224
Resolving deltas: 100% (7519/7519), done.
error: unable to create symlink cores/arduino/api: Permission denied
error: unable to create symlink cores/arduino/tinyusb/class: Permission denied
error: unable to create symlink cores/arduino/tinyusb/common: Permission denied
error: unable to create symlink cores/arduino/tinyusb/device: Permission denied
error: unable to create symlink cores/arduino/tinyusb/host: Permission denied
error: unable to create symlink cores/arduino/tinyusb/osal: Permission denied
error: unable to create symlink cores/arduino/tinyusb/rusb2: Permission denied
error: unable to create symlink cores/arduino/tinyusb/tusb.c: Permission denied
error: unable to create symlink cores/arduino/tinyusb/tusb.h: Permission denied
error: unable to create symlink cores/arduino/tinyusb/tusb_option.h: Permission denied
error: unable to create symlink libraries/ESPhost/src/protobuf-c/protobuf-c.h: Permission denied
error: unable to create symlink libraries/FATFilesystem/diskio.h: Permission denied
error: unable to create symlink libraries/FATFilesystem/ff.c: Permission denied
error: unable to create symlink libraries/FATFilesystem/ff.h: Permission denied
error: unable to create symlink libraries/FATFilesystem/ffconf.h: Permission denied
error: unable to create symlink libraries/FATFilesystem/ffunicode.c: Permission denied
error: unable to create symlink libraries/LittleFilesystem/lfs.c: Permission denied
error: unable to create symlink libraries/LittleFilesystem/lfs.h: Permission denied
error: unable to create symlink libraries/LittleFilesystem/lfs_util.c: Permission denied
error: unable to create symlink libraries/LittleFilesystem/lfs_util.h: Permission denied
error: unable to create symlink libraries/WiFiS3/src/WiFiCommands.h: Permission denied
Updating files: 100% (1565/1565), done.

More search found, I need to change my user settings to enable developer mode.

I redid the same clone and this time that worked.
Note: I found I had to redo the core\arduino\api link as to how and where I cloned things to.

Now build gets farther, but failing with:

FQBN: arduino:renesas_uno:unor4wifi
Using board 'unor4wifi' from platform in folder: C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1
Using core 'arduino' from platform in folder: C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1

Detecting libraries used...
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\sketch\\RTC_Alarm.ino.cpp" -o nul
Alternatives for RTC.h: [RTC@1.0]
ResolveLibrary(RTC.h)
  -> candidates: [RTC@1.0]
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\libraries\\RTC\\src" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\sketch\\RTC_Alarm.ino.cpp" -o nul
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\libraries\\RTC\\src" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\libraries\\RTC\\src\\RTC.cpp" -o nul
Generating function prototypes...
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -w -x c++ -E -CC -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\libraries\\RTC\\src" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\sketch\\RTC_Alarm.ino.cpp" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\preproc\\sketch_merged.cpp"
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\preproc\\sketch_merged.cpp"
Compiling sketch...
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -Wall -Wextra -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\libraries\\RTC\\src" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\sketch\\RTC_Alarm.ino.cpp" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\sketch\\RTC_Alarm.ino.cpp.o"
Compiling libraries...
Compiling library "RTC"
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -Wall -Wextra -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\libraries\\RTC\\src" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\libraries\\RTC\\src\\RTC.cpp" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\libraries\\RTC\\RTC.cpp.o"
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\libraries\RTC\src\RTC.cpp:463:1: warning: missing initializer for member 'st_rtc_cfg::p_extend' [-Wmissing-field-initializers]
 };
 ^
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\libraries\RTC\src\RTC.cpp: In member function 'bool RTClock::begin()':
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\libraries\RTC\src\RTC.cpp:613:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
Compiling core...
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -Wall -Wextra -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 "-DPROJECT_NAME=\"C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4/RTC_Alarm.ino\"" -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4\\variant.cpp" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\core\\variant.cpp.o"
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-gcc" -c -Wall -Wextra -Os -g3 -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu11 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\core\\tmp_gen_c_files\\common_data.c.o" "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4\\tmp_gen_c_files\\common_data.c"
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-gcc" -c -Wall -Wextra -Os -g3 -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu11 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\core\\tmp_gen_c_files\\main.c.o" "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4\\tmp_gen_c_files\\main.c"
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-gcc" -c -Wall -Wextra -Os -g3 -nostdlib -DF_CPU=48000000 -DNO_USB -DBACKTRACE_SUPPORT -DARDUINO_UNOR4_WIFI -MMD -std=gnu11 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10607 -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1/cores/arduino/tinyusb" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\cores\\arduino" "-IC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4" "-iprefixC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1" "@C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4/includes.txt" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\C8949554AF061B60944BB4FEB4425AF4\\core\\tmp_gen_c_files\\pin_data.c.o" "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\renesas_uno\\1.0.1\\variants\\UNOWIFIR4\\tmp_gen_c_files\\pin_data.c"

Using library RTC at version 1.0 in folder: D:\github\ArduinoCore-renesas\libraries\RTC 
CreateFile C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\tinyusb\class: Access is denied.

Compilation error: CreateFile C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\tinyusb\class: Access is denied.

Now to figure out what this problem is...

Hi @KurtE.

Overview

The technique used by Arduino's boards platform developers is to install the development version of the platform under a uniquely named vendor folder (e.g., arduino-dev) under the hardware subfolder of their sketchbook folder, and then install the latest release version as usual via Boards Manager.

Install Development Version of Platform

Since you mention mklink, I'll assume you are using PowerShell:

  1. Click the Windows "Start" button.
  2. Type powershell in the search field.
  3. Right click on the "Windows PowerShell ISE" entry from the search results.
    A context menu will open.
  4. Select the "Run as administrator" from the context menu.
    A "Windows PowerShell ISE" window will open.
  5. Type the following command at the PowerShell command prompt:
    cd "<sketchbook path>"
    
  6. Replace <sketchbook path> in the command with the path to your sketchbook folder (as set in the "Sketchbook location" field in the Arduino IDE preferences).
  7. Press the Enter key.
  8. Type the following command at the PowerShell command prompt and press Enter:
    mkdir hardware/arduino-dev
    
  9. Type the following command and press Enter:
    cd hardware/arduino-dev
    
  10. Type the following command and press Enter:
    git clone --recurse-submodules https://github.com/arduino/ArduinoCore-renesas renesas
    

Fix Symlinks

For some reason Windows is not recognizing the paths of some of the symlinks in the core. I haven't been able to find any good fix for that so we will have to resort to recreating them:

  1. Type the following command and press Enter:
    cd renesas/cores/arduino/tinyusb
    
  2. Type the following command and press Enter:
    rm class
    
  3. Type the following command and press Enter:
    New-Item -ItemType SymbolicLink -Path "class" -Target "../../../extras/tinyusb/src/class/"
    
  4. Type the following command and press Enter:
    rm common
    
  5. Type the following command and press Enter:
    New-Item -ItemType SymbolicLink -Path "common" -Target "../../../extras/tinyusb/src/common/"
    
  6. Type the following command and press Enter:
    rm device
    
  7. Type the following command and press Enter:
    New-Item -ItemType SymbolicLink -Path "device" -Target "../../../extras/tinyusb/src/device/"
    
  8. Type the following command and press Enter:
    rm host
    
  9. Type the following command and press Enter:
    New-Item -ItemType SymbolicLink -Path "host" -Target "../../../extras/tinyusb/src/host"
    
  10. Type the following command and press Enter:
    rm osal
    
  11. Type the following command and press Enter:
    New-Item -ItemType SymbolicLink -Path "osal" -Target "../../../extras/tinyusb/src/osal/"
    
  12. Type the following command and press Enter:
    rm rusb2
    
  13. Type the following command and press Enter:
    New-Item -ItemType SymbolicLink -Path "rusb2" -Target "../../../extras/tinyusb/src/portable/renesas/rusb2/"
    

Install ArduinoCore-API

Although much of the implementation of a core is architecture-specific, the standardized core API and the hardware independent components should be the same for every Arduino platform. In order to free platform authors from the burden of individually maintaining duplicates of this common code, Arduino has published it in a dedicated repository from which it may easily be shared by all platforms.

The arduino/ArduinoCore-renesas project leverages this arduino/ArduinoCore-API repository so you must install it as well. Since you might want to use it in multiple manually installed platforms, it is convenient to clone the repository to a centralized location and then make symlinks of it in each of the platform installations.

  1. Type the following command at the PowerShell command prompt:
    $Env:REPOSITORIES_PATH = "<repositories path>"
    
  2. Replace <repositories path> in the command with a convenient path to store the shared clone of the arduino/ArduinoCore-API repository.
  3. Press the Enter key.
  4. Type the following command and press Enter:
    git clone https://github.com/arduino/ArduinoCore-API "$Env:REPOSITORIES_PATH\ArduinoCore-API"
    
  5. Type the following command and press Enter:
    rm renesas/cores/arduino/api
    
    This is done to remove a symlink the Arduino developers created that targets an poorly chosen location for the arduino/ArduinoCore-API repository.
  6. Type the following command and press Enter:
    New-Item -ItemType SymbolicLink -Path "renesas/cores/arduino/api" -Target "$Env:REPOSITORIES_PATH\ArduinoCore-API\api"
    

Install Toolchain

You now have a complete installation of the platform, but the toolchain (GCC, BOSSA, etc.) is not part of the platform.

The convenient way to install the toolchain is Boards Manager. Usually the toolchain that is installed with the latest release version of the platform will be suitable for use with the development version of the platform as well.

If you already have the "Arduino UNO R4 Boards" platform installed, then you already have the toolchain. If not, just install the platform as usual:

  1. Select Tools > Board > Boards Manager from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  2. Scroll down through the list of boards platforms until you see the "Arduino UNO R4 Boards" entry.
  3. Click the "INSTALL" button at the bottom of the entry.
  4. Wait for the installation to finish.

In the rare case where different tools/tool versions are needed, the platform developers will typically produce a special staging package index that contains a pre-release version of the platform with the necessary toolchain, which allows you to still use Boards Manager to install the toolchain after adding the URL of that package index to the "Additional Boards Manager URLs" field of your preferences.

Usage

After you have installed the development version of the platform, restart Arduino IDE to cause it to rescan the installed platforms.

You will now find that there is an entry for the installation of the release version of the platform as usual under the Tools > Board menu in Arduino IDE (e.g., Tools > Board > Arduino UNO R4 Boards), as well as another menu entry for the manual installation of the development version of the platform at Tools > Board > Arduino Renesas fsp Boards (in Sketchbook). This allows you to easily switch back and forth between using the release version of the platform and the development version as needed.

1 Like

Thanks! I believe I have it building now.
One key thing I found was you really do need to run as adminstrator the powershell for the
new-item stuff to work poroperly in making the links...

Side note: I mainly use command prompt... but luckily your instructions were clear!

Thanks again

Thanks for the nice writeup @ptillisch. I followed it and was able to start a rebuild of the core but got a couple of compile errors from the tusb_option.h included in 4 files. One of the error outputs is:

In file included from C:\Users\Ulf\Documents\Arduino\hardware\arduino-dev\renesas\cores\arduino\tinyusb\class\cdc\cdc_host.c:27:0:
C:\Users\Ulf\Documents\Arduino\hardware\arduino-dev\renesas/cores/arduino/tinyusb/tusb_option.h:1:1: error: expected identifier or '(' before '.' token
 ../../../extras/tinyusb/src/tusb_option.h

Any help is appreciated since I am new to the Arduino environment.^

I am guessing here, but you may not have followed some of the comments of stuff that I did before this... Again just a guess.

But it looks like maybe the tusb.h in the src directory file was not replaced with a symbolic link.

That if you do a dir in the cores\arduino\tinyussb directory it probably won't look like:


C:\Users\kurte\Documents\Arduino\hardware\arduino-dev\renesas\cores\arduino\tinyusb>dir
 Volume in drive C is OS
 Volume Serial Number is 7E8D-E873

 Directory of C:\Users\kurte\Documents\Arduino\hardware\arduino-dev\renesas\cores\arduino\tinyusb

07/07/2023  07:36 AM    <DIR>          .
07/07/2023  07:27 AM    <DIR>          ..
07/07/2023  07:34 AM    <SYMLINKD>     class [C:\users\kurte\documents\arduino\hardware\arduino-dev\renesas\extras\tinyusb\src\class\]
07/07/2023  07:35 AM    <SYMLINKD>     common [C:\users\kurte\documents\arduino\hardware\arduino-dev\renesas\extras\tinyusb\src\common\]
07/07/2023  07:35 AM    <SYMLINKD>     device [C:\users\kurte\documents\arduino\hardware\arduino-dev\renesas\extras\tinyusb\src\device\]
07/07/2023  07:36 AM    <SYMLINKD>     host [C:\users\kurte\documents\arduino\hardware\arduino-dev\renesas\extras\tinyusb\src\host]
07/07/2023  07:36 AM    <SYMLINKD>     osal [C:\users\kurte\documents\arduino\hardware\arduino-dev\renesas\extras\tinyusb\src\osal\]
07/07/2023  07:36 AM    <SYMLINKD>     rusb2 [C:\users\kurte\documents\arduino\hardware\arduino-dev\renesas\extras\tinyusb\src\portable\renesas\rusb2\]
07/07/2023  07:15 AM    <SYMLINK>      tusb.c [..\..\..\extras\tinyusb\src\tusb.c]
07/07/2023  07:15 AM    <SYMLINK>      tusb.h [..\..\..\extras\tinyusb\src\tusb.h]
07/07/2023  07:15 AM    <SYMLINK>      tusb_option.h [..\..\..\extras\tinyusb\src\tusb_option.h]
               3 File(s)              0 bytes
               8 Dir(s)  119,774,220,288 bytes free

C:\Users\kurte\Documents\Arduino\hardware\arduino-dev\renesas\cores\arduino\tinyusb>

Notice everything is SYMLINK or SYMLINKD - I believe his instructions took care of the SYLINKD files as I guess having git do it for you failed... But it did work for the SYMLINK files like the one you showed.

To get this to work, I believe you have to have a version of GIT installed, which enables SYMLINKS.

And you may need to enable your self to have permissions, by turning on DEV mode, but maybe not as his instructions has you doing the install using a command window running in Administrator mode.

Good luck

Hi @thurban52. I apologize for the confusion. When you clone a repository that contains symlinks on Windows Git has a fallback behavior when it can't or shouldn't create the symlink. This fallback behavior is to just create a normal file with the path that is the target of the symlink. That is the cause of the strange error you got. The tusb_option.h file just contains the text:

../../../extras/tinyusb/src/tusb_option.h

Which of course doesn't compile as C++.

In order for Git to be able to create symlinks, it needs two things:

My instructions provided the operating system level permissions by running the PowerShell process as administrator, but did not ensure that symlinks were enabled in your Git configuration. I actually had done that in an earlier draft of my instructions, but then removed it while I was struggling to find the cause of that annoying problem with the symlinks in cores/arduino/tinyusb and I forgot to add it back because I happened to have symlinks enabled in my global Git configuration so no additional configuration efforts are needed on my own system.

The problem should be solved by adding the --config core.symlinks=true flag to the command at step (10) of the "Install Development Version of Platform" procedure in my previous reply:

git clone --config core.symlinks=true --recurse-submodules https://github.com/arduino/ArduinoCore-renesas renesas
1 Like

Nice and thanks @KurtE. It works and everything is fine.

Now the writeup is even better, Thanks again @ptillisch .

@ptillisch - Thanks again.

Quick update notes:

This morning I decided to update my fork to the upstream fork...
In this case I used the menu command in github desktop for windows...

And after this, the links were all killed again :wink:
So I need to update them again... May end up needing a batch file...

Thought I would try fixing it with cmd commands as I never really learned the powershell.

Some interesting things I ran into:

D:\github\ArduinoCore-renesas\cores\arduino>cat api
../../../ArduinoCore-API/api/

I thought I would try the mklink command with the exact contents of the file:

D:\github\ArduinoCore-renesas\cores\arduino>mklink /D api ../../../ArduinoCore-API/api/
Invalid switch - "..".

Thought maybe if I switch the /s to \s it might work:

D:\github\ArduinoCore-renesas\cores\arduino>mklink /D api ..\..\..\ArduinoCore-API\api
symbolic link created for api <<===>> ..\..\..\ArduinoCore-API\api

looked like it would work, but build still failed to find files under api...
I also tried to cd to api and do a dir, which was empty.

So I instead tried the mlink again with the actual path:

D:\github\ArduinoCore-renesas\cores\arduino>mklink /D api D:\github\ArduinoCore-API\api
symbolic link created for api <<===>> D:\github\ArduinoCore-API\api

And the build gets farther but as I expeced failed with the others:

 Directory of D:\github\ArduinoCore-renesas\cores\arduino\tinyusb

07/11/2023  04:46 AM    <DIR>          .
07/11/2023  09:53 AM    <DIR>          ..
07/11/2023  04:46 AM                34 class
07/11/2023  04:46 AM                35 common
07/11/2023  04:46 AM                35 device
07/11/2023  04:46 AM                32 host
07/11/2023  04:46 AM                33 osal
07/11/2023  04:46 AM                51 rusb2
07/07/2023  07:15 AM    <SYMLINK>      tusb.c [..\..\..\extras\tinyusb\src\tusb.c]
07/07/2023  07:15 AM    <SYMLINK>      tusb.h [..\..\..\extras\tinyusb\src\tusb.h]
07/07/2023  07:15 AM    <SYMLINK>      tusb_option.h 

Now to fix up those 5 others

I set up a quick and dirty batch file fixlinks.bat that I have in the root of the project...
I also have enabled developers mode...

rm cores\arduino\api
mklink /D cores\arduino\api D:\github\ArduinoCore-API\api

rm cores\arduino\tinyusb\class
mklink /D cores\arduino\tinyusb\class  D:\github\ArduinoCore-renesas\extras\tinyusb\src\class

rm cores\arduino\tinyusb\common
mklink /D cores\arduino\tinyusb\common  D:\github\ArduinoCore-renesas\extras\tinyusb\src\common

rm cores\arduino\tinyusb\device
mklink /D cores\arduino\tinyusb\device  D:\github\ArduinoCore-renesas\extras\tinyusb\src\device

rm cores\arduino\tinyusb\host
mklink /D cores\arduino\tinyusb\host  D:\github\ArduinoCore-renesas\extras\tinyusb\src\host

rm cores\arduino\tinyusb\osal
mklink /D cores\arduino\tinyusb\osal  D:\github\ArduinoCore-renesas\extras\tinyusb\src\osal

rm cores\arduino\tinyusb\rusb2
mklink /D cores\arduino\tinyusb\rusb2  D:\github\ArduinoCore-renesas\extras\tinyusb\src\portable\renesas\rusb2

I'm sorry to hear that. Make sure to start GitHub Desktop by right clicking on the icon and selecting "Run as administrator" from the menu whenever you are planning to do some operation in the ArduinoCore-renesas repository. If you do that, the problem of the fallback behavior of adding normal text files in place of the symlinks should not occur.

I also never use PowerShell. I actually found it quite painful to write the PowerShell-based instructions I shared earlier in this thread. If you are looking for something more capable than cmd, I highly recommend Git Bash. You already have it installed on your computer as part of the Git For Windows installation.

I keep forgetting to try using it. I normaly have Terminal installed on my taskbar, where I can launch several different types of command prompts:
Which is pretty nice.

Maybe should add new profile

It has been a while since I played much with this, but I wanted to do some of the requests to the my Hardware Serial PR request, so I tried to resync everything and then rebase my branch to the current sources and rebuild.

The build failed with some tusb define not being defined... Tried several things, still failed, so then used big hammer. That is I moved my project clone to a different location, and then followed @ptillisch instructions again to create a clean clone.

Note when I completed the steps (although used CMD and not powershell). It sucessfully built the new clone. So I then wanted to point to my top level fork.

So logically rename origin to upstream, and add in my fork as origin.
Ran into an issue, as I did the git clone in a terminal window run as Administrator, git did not allow me to do git commands... So after a little (net search) I was able to set myself as the owner of the directory structure, and use git :smiley: I was able to switch to my branch and it is building again.

Just wondering when you are making changes to these projects, do you normally try to resync everything including sub-modules. If so any hints for syncing the sub-modules? Or do you start off clean and then apply your new stuff?

Thanks
Kurt