How do you include downloaded library using particle workbench?

Hi guys, I’m making a clock for myself. I’m using DS3231 as the RTC module. So basically, I want to use this library http://www.rinkydinkelectronics.com/library.php?id=73.

I do not subscribe to their cloud as I won’t use their cloud. So now i use the terminal in the particle workbench to compile and flash. I use SYSTEM_MODE(MANUAL) for this as well and flash it using usb dfu.

I tried to make a new folder in my project folder. I put the .h and .cpp inside the bin folder. However, I cannot compile the code and give me this error.

I wish someone could help me, I already stuck here for awhile.

PS D:\Xenon\clock> particle compile xenon D:\Xenon\clock\src\clock.ino --saveTo firmware.bin

Compiling code for xenon

Including:
    D:\Xenon\clock\src\clock.ino
attempting to compile firmware

Processing  clock.ino
make -C ../modules/xenon/user-part all
make[1]: Entering directory '/firmware/modules/xenon/user-part'

mkdir -p target/
make -f ../../../modules/shared/nRF52840/build_linker_script.mk PREBUILD=1
make[2]: Entering directory '/firmware/modules/xenon/user-part'
Creating target/platform_user_ram.ld ...
make[2]: Leaving directory '/firmware/modules/xenon/user-part'

make -C ../../../user
make[2]: Entering directory '/firmware/user'
Building cpp file: clock.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-14-m
arm-none-eabi-gcc -DSTM32_DEVICE -DnRF52840 -DNRF52840_XXAA -DPLATFORM_THREADING=1 -DPLATFORM_ID=14 -DPLATFORM_NAME=xenon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00E -DUSBD_PID_CDC=0xC00E -DSPARK_PLATFORM -g3 -gdwarf-2 -Os
-mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DINCLUDE_PLATFORM=1 -DSOFTDEVICE_PRESENT=1 -DS140 -DPRODUCT_ID=14 -DPRODUCT_FIRMWARE_VERSION=65535 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-config-project.h\" -DENABLE_FEM=1 -DNRF_802154_PROJECT_CONFIG=\"openthread-platform-config.h\" -DRAAL_SOFTDEVICE=1 -D_WIZCHIP_=W5500 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DLFS_CONFIG=lfs_config.h -DSYSTEM_VERSION_STRING=1.4.0 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../third_party/miniz/miniz -I../services/inc -I../third_party/nanopb/nanopb -I../communication/inc -I../hal/inc -I../hal/shared -I../hal/src/xenon -I../hal/src/nRF52840 -I../hal/src/armv7 -I../hal/src/nRF52840 -I../hal/src/nRF52840/lwip -I../hal/src/nRF52840/freertos -I../hal/src/nRF52840/openthread -I../hal/src/nRF52840/mbedtls -I../hal/src/nRF52840/littlefs -I../hal/network/api -I../hal/network/lwip -I../hal/network/lwip/posix -I../hal/network/openthread -I../hal/network/lwip/wiznet -I../hal/network/ncp -I../hal/network/ncp/at_parser -I../third_party/lwip/lwip/src/include -I../third_party/freertos/freertos/FreeRTOS/Source/include -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/GCC/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/CMSIS/nrf52 -I../third_party/openthread/openthread/include -I../third_party/openthread/openthread/src/core -I../third_party/openthread/openthread/examples/platforms -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/hal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch/raal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice -I../third_party/wiznet_driver/wiznet_driver/Ethernet -I../gsm0710muxer/gsm0710muxer/include -I../platform/shared/inc -I../third_party/nrf5_sdk -I../third_party/nrf5_sdk/nrf5_sdk/components/toolchain/cmsis/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/mdk -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/src/prs -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/util -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/crc32 -I../third_party/nrf5_sdk/nrf5_sdk/integration/nrfx/legacy -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log/src -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/queue -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/mbr/nrf52840/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/strerror -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_flags -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc/acm -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/common -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/nrf_ble_gatt -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/ble_advertising -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/t2t_lib -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/platform -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/generic/message -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/generic/record -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/lauchapp -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/text -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/uri -I../third_party/nrf5_sdk/nrf5_sdk/external/nrf_cc310/include -I../third_party/nrf5_sdk/nrf5_sdk/external/utf_converter -I../third_party/littlefs/littlefs -I../platform/MCU/nRF52840/inc -I../dynalib/inc -I -I./libraries -I. -MD -MP -MF ../build/target/user/platform-14-mclock.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400
-DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=None -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0xD4000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=6 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,1,1401 -DMODULE_DEPENDENCY2=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++14 -c -o ../build/target/user/platform-14-mclock.o clock.cpp
clock.ino:43:20: fatal error: DS3231.h: No such file or directory
compilation terminated.
../build/module.mk:277: recipe for target '../build/target/user/platform-14-mclock.o' failed
make[2]: *** [../build/target/user/platform-14-mclock.o] Error 1
make[2]: Leaving directory '/firmware/user'
../../../build/recurse.mk:11: recipe for target 'user' failed
make[1]: *** [user] Error 2
make[1]: Leaving directory '/firmware/modules/xenon/user-part'
../build/recurse.mk:11: recipe for target 'modules/xenon/user-part' failed
make: *** [modules/xenon/user-part] Error 2
Compile failed: Compiler encountered an error

Welcome.
There is a particle library for this device here

If you must use yours

Then you will need to add both files to your project src sub folder and include the .h into your .ino src file

thanks for the reply! I prefer to use the library http://www.rinkydinkelectronics.com/library.php?id=73.
This is what i get after i put both files into my project src sub folder.

did i do anything wrong?

Okay - this library is not just .cpp and .h files there is a much bigger structure it calls in below in the hardware folder. This library is specifically customised for AVR/ARM/PIC32 architecture and is going to need some work for it to work with the Particle devices.

So, unless there are functions not in the community library - you will need to port it for particle. The DeviceOS on particle already has a vast number of time related functions built in - all you would need is a method to set the DS3231 and to retrieved data from it and update the system time keeping system.

Sorry, I don’t quite understand. Really a beginner here. So what do I need to do in order for me to use DS3231? Once again thanks!

I understand on how to use arduino. The Arduino IDE can just install the library. However, this is not the same as particle xenon

In workbench, open Command Palette -> install Library -> ADAFRUIT_RTCLIB_RK. It will now be properly installed in work bench

Navigate to the examples folder under the lib folder and copy the contents of the ds3231.ino file into the .ino file in your src folder and test

It may be much easier to do this in the WEBIDE if you are not used to Workbench? - see

https://build.particle.io/libs/Adafruit_RTClib_RK/1.2.1/tab/example/ds3231.ino

Select USE THIS EXAMPLE and flash it. More info here

https://docs.particle.io/tutorials/developer-tools/build/core/#flashing-your-first-app

1 Like

Hi @noobatparticle -

First, welcome to the Particle forum, there are some really clever guys in here, you should be sorted in no time :slight_smile:

Briefly looking at your case and the responses, I am inclined to advise using Workbench and CLI to install the library needed as I have had more success doing this. Having said this, especially if you are new to Particle, I will agree with @shanevanj, see if you can use thew WebIDE instead.

If the library is listed in the WebIDE, which it seems to be from the screen grab attached, it will be a quick and painless process to add it.

Let me know if you need more help using the WebIDE. Hope this helps!!
Regards

The reason why i do not use WebIDE is because we need to register our particle device in order to flash it. Hence, i using workbench and the CLI inside. I used particle compile … particle flash… to flash in my code using usb dfu. Anyway, this is what i get from following @shanevanj .

Just asking, idk why when i tried to find the library, it also shows this

PS E:\try> particle library search ADAFRUIT_RTCLIB_RK
! { Error: HTTP error 400 from https://api.particle.io/v1/libraries?filter=ADAFRUIT_RTCLIB_RK - The access token was not found
    at C:\Users\user\AppData\Local\particle\node_modules\particle-cli\node_modules\particle-api-js\lib\Agent.js:204:19
    at Request.callback (C:\Users\user\AppData\Local\particle\node_modules\particle-cli\node_modules\superagent\lib\node\index.js:728:3)
    at parser (C:\Users\user\AppData\Local\particle\node_modules\particle-cli\node_modules\superagent\lib\node\index.js:916:18)
    at IncomingMessage.res.on (C:\Users\user\AppData\Local\particle\node_modules\particle-cli\node_modules\superagent\lib\node\parsers\json.js:19:7)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)
  statusCode: 400,
  errorDescription: 'HTTP error 400 from https://api.particle.io/v1/libraries?filter=ADAFRUIT_RTCLIB_RK - The access token was not found',
  shortErrorDescription: 'The access token was not found',
  error:
   { Error: Bad Request
    at Request.callback (C:\Users\user\AppData\Local\particle\node_modules\particle-cli\node_modules\superagent\lib\node\index.js:706:15)
    at parser (C:\Users\user\AppData\Local\particle\node_modules\particle-cli\node_modules\superagent\lib\node\index.js:916:18)
    at IncomingMessage.res.on (C:\Users\user\AppData\Local\particle\node_modules\particle-cli\node_modules\superagent\lib\node\parsers\json.js:19:7)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)
     status: 400,
     response:
      Response {
        domain: null,
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        res: [Object],
        request: [Object],
        req: [Object],
        text: '{"error":"invalid_request","error_description":"The access token was not found"}',
        body: [Object],
        files: undefined,
        buffered: true,
        headers: [Object],
        header: [Object],
        statusCode: 400,
        status: 400,
        statusType: 4,
        info: false,
        ok: false,
        redirect: false,
        clientError: true,
        serverError: false,
        error: [Object],
        created: false,
        accepted: false,
        noContent: false,
        badRequest: true,
        unauthorized: false,
        notAcceptable: false,
        forbidden: false,
        notFound: false,
        unprocessableEntity: false,
        type: 'application/json',
        charset: 'utf-8',
        links: {},
        setEncoding: [Function: bound ],
        redirects: [] } },
  body:
   { error: 'invalid_request',
     error_description: 'The access token was not found' } }
HTTP error 400 from https://api.particle.io/v1/libraries?filter=ADAFRUIT_RTCLIB_RK - The access token was not found
PS E:\try>

Hi @noobatparticle -

hhmmm ok, this is something new to me as I always register my devices.

Based on this it seems it is not liking the fact that there is no access token involved accessing your device. Have you tried uploading simply sketch without any particular libraries to eliminate whether it is a library issue or maybe that you cannot upload without the access token?

Sorry off these questions are trivial, as I mentioned I always register my devices and am signed into my Particle account even when using Workbench.

While that would be the common way to do it, it's not absolutely required to register all devices you want to flash. You'd only need one Xenon registered in order to provide you with the option to select Xenon as target (although some of us have already proposed to provide the option to select the target independently of actually "owning" a device).

Once you have the target set, you can download the resulting binary and use CLI (independetly of Workbench) to flash it.

That's only true for libraries that are actually available for the platform.
Granted, there is a plethora of AVR targeted libraries for Arduino, but having a "ported" version is a prerequesite nonetheless.

Try particle logout and particle login and see if you can then find the library

C:\>particle library search adafruit_rtclib_rk
> Found 1 library matching adafruit_rtclib_rk
Adafruit_RTClib_RK 1.2.1 1687
1 Like

HI @noobatparticle -

I got the same result as @ScruffR

Quick question; what is the reasoning behind not wanting to claim the device? If all else fails, you can claim the device, use WebIDE and then remove the device when done?

Hi @friedl_1977 , I manage to install the library. When i include the library, it gives me this error.

Let’s say I follow the instruction to rename my folder into RTClib folder (inside the lib folder). When I’m compiling, it gives me this error.

PS D:\Xenon\clock> particle compile xenon D:\Xenon\clock\src\ds1307.ino --saveTo firmware.bin

Compiling code for xenon

Including:
    D:\Xenon\clock\src\ds1307.ino
attempting to compile firmware

Processing  ds1307.ino
make -C ../modules/xenon/user-part all
make[1]: Entering directory '/firmware/modules/xenon/user-part'

mkdir -p target/
make -f ../../../modules/shared/nRF52840/build_linker_script.mk PREBUILD=1
make[2]: Entering directory '/firmware/modules/xenon/user-part'
Creating target/platform_user_ram.ld ...
make[2]: Leaving directory '/firmware/modules/xenon/user-part'

make -C ../../../user
make[2]: Entering directory '/firmware/user'
Building cpp file: ds1307.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-14-m
arm-none-eabi-gcc -DSTM32_DEVICE -DnRF52840 -DNRF52840_XXAA -DPLATFORM_THREADING=1 -DPLATFORM_ID=14 -DPLATFORM_NAME=xenon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00E -DUSBD_PID_CDC=0xC00E -DSPARK_PLATFORM -g3 -gdwarf-2 -Os
-mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DINCLUDE_PLATFORM=1 -DSOFTDEVICE_PRESENT=1 -DS140 -DPRODUCT_ID=14 -DPRODUCT_FIRMWARE_VERSION=65535 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-config-project.h\" -DENABLE_FEM=1 -DNRF_802154_PROJECT_CONFIG=\"openthread-platform-config.h\" -DRAAL_SOFTDEVICE=1 -D_WIZCHIP_=W5500 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DLFS_CONFIG=lfs_config.h -DSYSTEM_VERSION_STRING=1.4.0 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../third_party/miniz/miniz -I../services/inc -I../third_party/nanopb/nanopb -I../communication/inc -I../hal/inc -I../hal/shared -I../hal/src/xenon -I../hal/src/nRF52840 -I../hal/src/armv7 -I../hal/src/nRF52840 -I../hal/src/nRF52840/lwip -I../hal/src/nRF52840/freertos -I../hal/src/nRF52840/openthread -I../hal/src/nRF52840/mbedtls -I../hal/src/nRF52840/littlefs -I../hal/network/api -I../hal/network/lwip -I../hal/network/lwip/posix -I../hal/network/openthread -I../hal/network/lwip/wiznet -I../hal/network/ncp -I../hal/network/ncp/at_parser -I../third_party/lwip/lwip/src/include -I../third_party/freertos/freertos/FreeRTOS/Source/include -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/GCC/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/CMSIS/nrf52 -I../third_party/openthread/openthread/include -I../third_party/openthread/openthread/src/core -I../third_party/openthread/openthread/examples/platforms -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/hal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch/raal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice -I../third_party/wiznet_driver/wiznet_driver/Ethernet -I../gsm0710muxer/gsm0710muxer/include -I../platform/shared/inc -I../third_party/nrf5_sdk -I../third_party/nrf5_sdk/nrf5_sdk/components/toolchain/cmsis/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/mdk -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/src/prs -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/util -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/crc32 -I../third_party/nrf5_sdk/nrf5_sdk/integration/nrfx/legacy -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log/src -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/queue -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/mbr/nrf52840/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/strerror -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_flags -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc/acm -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/common -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/nrf_ble_gatt -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/ble_advertising -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/t2t_lib -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/platform -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/generic/message -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/generic/record -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/lauchapp -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/text -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/uri -I../third_party/nrf5_sdk/nrf5_sdk/external/nrf_cc310/include -I../third_party/nrf5_sdk/nrf5_sdk/external/utf_converter -I../third_party/littlefs/littlefs -I../platform/MCU/nRF52840/inc -I../dynalib/inc -I -I./libraries -I. -MD -MP -MF ../build/target/user/platform-14-mds1307.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=None -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0xD4000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=6 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,1,1401 -DMODULE_DEPENDENCY2=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++14 -c -o ../build/target/user/platform-14-mds1307.o ds1307.cpp
ds1307.ino:3:20: fatal error: RTClib.h: No such file or directory
compilation terminated.
../build/module.mk:277: recipe for target '../build/target/user/platform-14-mds1307.o' failed
make[2]: *** [../build/target/user/platform-14-mds1307.o] Error 1
make[2]: Leaving directory '/firmware/user'
../../../build/recurse.mk:11: recipe for target 'user' failed
make[1]: *** [user] Error 2
make[1]: Leaving directory '/firmware/modules/xenon/user-part'
../build/recurse.mk:11: recipe for target 'modules/xenon/user-part' failed
make: *** [modules/xenon/user-part] Error 2
Compile failed: Compiler encountered an error
PS D:\Xenon\clock>

Okay - I have just tested my own instructions again.

Have you tried compiling before renaming anything? - it is also unclear why rename the folder? On my system it compiles without needing to rename anything ?

image

hi @shanevanj, thank you so much for coming back and trying to help me.

I did without renaming. I think it still give me the same error. What i did was

made a new folder called lib in the project folder
particle library install Adafruit_RTClib_RK


open the directory file of the library
i copied the whole library to the lib folder
then i copied the whole ds3231.ino into my RTCtest.ino
then no errors shown in the problem terminal (no red underline)

when i tried to compile everything (particle compile xenon D:\Xenon\RTCtest\src\RTCtest.ino --saveTo firmware.bin) It loads and gives me this error

PS D:\Xenon\RTCtest> particle compile xenon D:\Xenon\RTCtest\src\RTCtest.ino --saveTo firmware.bin

Compiling code for xenon

Including:
    D:\Xenon\RTCtest\src\RTCtest.ino
attempting to compile firmware

Processing  RTCtest.ino
make -C ../modules/xenon/user-part all
make[1]: Entering directory '/firmware/modules/xenon/user-part'

mkdir -p target/
make -f ../../../modules/shared/nRF52840/build_linker_script.mk PREBUILD=1
make[2]: Entering directory '/firmware/modules/xenon/user-part'
Creating target/platform_user_ram.ld ...
make[2]: Leaving directory '/firmware/modules/xenon/user-part'

make -C ../../../user
make[2]: Entering directory '/firmware/user'
Building cpp file: RTCtest.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-14-m
arm-none-eabi-gcc -DSTM32_DEVICE -DnRF52840 -DNRF52840_XXAA -DPLATFORM_THREADING=1 -DPLATFORM_ID=14 -DPLATFORM_NAME=xenon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00E -DUSBD_PID_CDC=0xC00E -DSPARK_PLATFORM -g3 -gdwarf-2 -Os
-mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DINCLUDE_PLATFORM=1 -DSOFTDEVICE_PRESENT=1 -DS140 -DPRODUCT_ID=14 -DPRODUCT_FIRMWARE_VERSION=65535 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-config-project.h\" -DENABLE_FEM=1 -DNRF_802154_PROJECT_CONFIG=\"openthread-platform-config.h\" -DRAAL_SOFTDEVICE=1 -D_WIZCHIP_=W5500 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DLFS_CONFIG=lfs_config.h -DSYSTEM_VERSION_STRING=1.4.0 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../third_party/miniz/miniz -I../services/inc -I../third_party/nanopb/nanopb -I../communication/inc -I../hal/inc -I../hal/shared -I../hal/src/xenon -I../hal/src/nRF52840 -I../hal/src/armv7 -I../hal/src/nRF52840 -I../hal/src/nRF52840/lwip -I../hal/src/nRF52840/freertos -I../hal/src/nRF52840/openthread -I../hal/src/nRF52840/mbedtls -I../hal/src/nRF52840/littlefs -I../hal/network/api -I../hal/network/lwip -I../hal/network/lwip/posix -I../hal/network/openthread -I../hal/network/lwip/wiznet -I../hal/network/ncp -I../hal/network/ncp/at_parser -I../third_party/lwip/lwip/src/include -I../third_party/freertos/freertos/FreeRTOS/Source/include -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/GCC/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/CMSIS/nrf52 -I../third_party/openthread/openthread/include -I../third_party/openthread/openthread/src/core -I../third_party/openthread/openthread/examples/platforms -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/hal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch/raal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice -I../third_party/wiznet_driver/wiznet_driver/Ethernet -I../gsm0710muxer/gsm0710muxer/include -I../platform/shared/inc -I../third_party/nrf5_sdk -I../third_party/nrf5_sdk/nrf5_sdk/components/toolchain/cmsis/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/mdk -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/src/prs -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/util -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/crc32 -I../third_party/nrf5_sdk/nrf5_sdk/integration/nrfx/legacy -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/log/src -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/queue -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/mbr/nrf52840/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/strerror -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_flags -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc/acm -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/common -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/nrf_ble_gatt -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/ble_advertising -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/t2t_lib -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/platform -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/generic/message -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/generic/record -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/lauchapp -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/text -I../third_party/nrf5_sdk/nrf5_sdk/components/nfc/ndef/uri -I../third_party/nrf5_sdk/nrf5_sdk/external/nrf_cc310/include -I../third_party/nrf5_sdk/nrf5_sdk/external/utf_converter -I../third_party/littlefs/littlefs -I../platform/MCU/nRF52840/inc -I../dynalib/inc -I -I./libraries -I. -MD -MP -MF ../build/target/user/platform-14-mRTCtest.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=None -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0xD4000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=6 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,1,1401 -DMODULE_DEPENDENCY2=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++14 -c -o ../build/target/user/platform-14-mRTCtest.o RTCtest.cpp
RTCtest.ino:3:20: fatal error: RTClib.h: No such file or directory
compilation terminated.
../build/module.mk:277: recipe for target '../build/target/user/platform-14-mRTCtest.o' failed
make[2]: *** [../build/target/user/platform-14-mRTCtest.o] Error 1
make[2]: Leaving directory '/firmware/user'
../../../build/recurse.mk:11: recipe for target 'user' failed
make[1]: *** [user] Error 2
make[1]: Leaving directory '/firmware/modules/xenon/user-part'
../build/recurse.mk:11: recipe for target 'modules/xenon/user-part' failed
make: *** [modules/xenon/user-part] Error 2

Do not copy anything into the lib folder - just copy the contents of the ds3231.ino from the lib/Adaafruit_RTClib_RK/examples into the .ino in the src folder created by the new project process. Do not rename any files.

When you install the library it will be setup in the correct place and all relevant links will be created. You do not have to edit/copy/change anything to do with the library.

Okay I deleted my project and make a new one. It gives me this error if i don’t copy the files into the lib folder.

Without creating a lib folder

Manually create the lib folder


the lib folder is empty.

Okay your sequence should be:

  1. create new project called RTCtest - you will have empty structure

image

  1. install library using command palette - lib folder should be created and Adafruit_RTClib_RK library should be visible

image

image

  1. open examples folder and locate DS3231.ino

  1. open DS3231.ino and select then copy all

  1. expand src and then open RTCtest.ino

  1. select all and paste copied code from example here

  1. select compile

image

  1. check result

If following these EXACT steps causes an error - then I suggest you uninstall Work bench and reinstall and follow ALL defaults suggestions and repeat the process.

1 Like

wah thank you so much for the trouble to help me. I always been compiling using this command
particle compile xenon (directory).
In this way, i can compile my code without registering my device (I don’t want to subscribe to their cloud as i will not be using it).

If i compile using the icon V, they give me this error

Are you using a windows emulator on a non windows host ?

1 Like

Im using laptop that came with windows hahaha