So, I am working on nrf52840 with nrf connect sdk and I want to get date and time in my project, I found a library in nrf connect sdk ->libraries->other libraries->date-time, I tried to add the configuration in my prj.conf, but an error occur.
So, I am working on nrf52840 with nrf connect sdk and I want to get date and time in my project, I found a library in nrf connect sdk ->libraries->other libraries->date-time, I tried to add the configuration in my prj.conf, but an error occur.
Hello Jay_lin
The error tells you what to do -> please add a path to find your board definition.
What toolchain are you using?
segger embedded studio or visualCode?
When you are using SES then you can adapt the file: cmakelist.txt to add the missing board root path
set(BOARD_ROOT $ENV{EXAMPLE_BASE}})
where:
EXAMPLE_BASE can be c:\cm\ncs\projects\my_project\boards
When you are using visualCode then you can manually add a board configuration to build with.
Perhaps the next website helps:
developer.nordicsemi.com/.../build-flash-debug.html
Hi nRF5xFanboy I am using vscode, I have a question when I delete the config relate to Time it build and work, but when I add config relate to Time it shows error is it still the problem about board configuration?
Which config?
Can you provide a configuration key+value you talking about in the proj.conf
The error at the bottom tells you the missing dependencies
what modem do you use?
I edit the post the config I add below #TIme is causing the problem when I delete them It build. what is modem? sorry for noob question
Hello Jay_Lin,
* don't be sorry foor noob questions.*
What hardware are you using ?
If this is only a nordic development kit nrf52840DK ? (like the picture here)
If yes, then you can never have date&time because this board is unable to synchronize with a possible time server present on the internet (or another time source like a cellular network)
it needs a modem to establish connection to get the real world date & time
An alternative solution is to connect a gps receiver and obtain time from there.
Yes I am using nrf52840dk, thanks for the solution I will do some study
Yes I am using nrf52840dk, thanks for the solution I will do some study
Hello Jay_Lin,
If there is no additional hardware involved then you can not have real world date&time
With the nrf52840dk you can only have "systems tics counter"
You need a modem + sim-card
For example:
https://www.conrad.nl/nl/p/sos-electronic-arduino-mc60gsm-gps-1925472.html?utm_source=google&utm_medium=surfaces&utm_campaign=shopping-feed&utm_content=free-google-shopping-clicks&utm_term=1925472&adcampaign=gshop&tid=14579472676_122103879770_pla-304375124321_pla-1925472&gclid=CjwKCAjwo_KXBhAaEiwA2RZ8hL9boviQGXVCdF7HGNy9fEt0hANdcVzmH7xv0gVGdmEnsR13i1ODPRoC29EQAvD_BwE
Can you please mark my answer as solution, thanks! ;-)