Date   

How to Request BLE Data Length Extension? #bt #bluetooth

George Ruinelli
 

I am trying to set the Bluetooth Low Energy DLE from 27 to something higher, eg. 251.
I was able to do it manually through the nRF Connect Tool, Wireshark then confirms me that the data no longer is fragmented:


How ever I need to be able to do it directly within Zephyr.

I am aware of https://lists.zephyrproject.org/g/users/topic/data_length_extension_on/23297993 and https://lists.zephyrproject.org/g/devel/topic/30301574, but it did not help me further.

I found bt_conn_le_data_len_update() which seems to do what I need, but it doesn't have any impact.
I tried to add its call to exchange_func(), but it simply seems to be ignored:
static void exchange_func(struct bt_conn *conn, uint8_t att_err, struct bt_gatt_exchange_params *params) {
    struct bt_conn_info info = {0};
    int err;

    if (att_err == 0) {
        LOG_INF("MTU exchange successful");
        LOG_DBG("MTU: %d bytes", bt_gatt_get_mtu(conn));
    }
    else {
        LOG_ERR("MTU exchange failed!");
    }

    err = bt_conn_get_info(conn, &info);
    if (err) {
        LOG_ERR("Failed to get connection info %d\n", err);
    }


    LOG_ERR("Data Length: %d", info.le.data_len->tx_max_len); // Reports 27

    struct bt_conn_le_data_len_param param;
    param.tx_max_len = 251;
    param.tx_max_time = 2120;
    err = bt_conn_le_data_len_update(conn, &param);
    if (err) {
        LOG_ERR("Failed to Update DLE: %d\n", err);
    }

    LOG_ERR("Data Length: %d", info.le.data_len->tx_max_len); // Still reporst 27
}

Sadly searching the web for bt_conn_le_data_len_update() only reveals its documentation but no further information :(

Sincerely
George


Re: Data Length Extension on NRF52840 #nrf52840 #ble #hci

George Ruinelli
 

@Josh

Can you give some insight, how you requested Data Length Extension?
I can not find any documentation how to do this.
I was able to enable to do it manually through the nRF Connect Tool, but need to do it directly in Zephyr.

Sincerely
George


Re: Choosing the network interface for a socket

Jukka Rissanen
 

Hi Maik,

For listening socket you need to call bind() to assing the local
address. For sending socket, the local address (interface) is selected
automatically (if you have not bound the socket) according to
destination address.

Cheers,
Jukka

On Fri, 2020-08-21 at 09:27 +0200, Maik Vermeulen wrote:
Hello,

Currently I am playing with TCP sockets on a board that has both an
LTE-M modem, and an ethernet interface.

It is not clear to me how I can control whether the socket should
use
the LTE-M connection, or the ethernet interface.

Could anyone give me some pointers?

Best regards,
Maik Vermeulen




Choosing the network interface for a socket

Maik Vermeulen
 

Hello,

Currently I am playing with TCP sockets on a board that has both an LTE-M modem, and an ethernet interface.

It is not clear to me how I can control whether the socket should use the LTE-M connection, or the ethernet interface.

Could anyone give me some pointers?

Best regards,
Maik Vermeulen


HCI USB driver for Windows #ble #driver #nrf52840 #usb

todd.krein@...
 

I have the HCI USB project built and running on my nRF52840 DK board. It works if I talk to it via ubuntu running under VirtualBox on my Win 10 system, but not if I plug it into a Raspberry Pi, or my Win 10 machine directly.

Does anyone know of a Windows driver that will successfully drive the nRF52840 as a BT device under windows?


Re: How to use "Serial CAN Bus Module" #driver #uart #can

s9gosich@...
 

@Lawrence King

Thank you for the code!


@All

I tried the last few days to get it working but I don’t know how to use a second UART. I’m using the nRF52832dk board which has only “uart0” defined in the Devicetree (see ~/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts and ~/zephyr/dts/arm/nordic/nrf52832.dtsi). Since uart0 is already being used I want to define an “uart1” as was used in the code by Lawrence King for nRF52840 (which supports “uart1” in the Devicetree). But as I understand it at the moment, this is difficult without deep knowledge about the Hardware and Devicetree. 

How can I solve this? Is there an easy path I haven’t found. Something like SoftwareSerial in Arduino?

Can I define an “uart1” with an “.overlay” file in my project folder? Are there examples for this?

Do I have to edit the Devicetree files in the ~/zephyr/dts folder?

Thank you!


Re: How to Run

Kate Stewart
 

Hi Deepa,
    Best place to start is following the instructions at:
https://docs.zephyrproject.org/latest/getting_started/index.html

"Blinky Sample" is Zephyr's equivalent of hello world. 

Since you have a windows system,   click on the Windows tab
under the first step in the getting started link

Screen Shot 2020-08-18 at 9.22.31 AM.png

You can run Zephyr in a virtual environment on your computer but it's designed to 
be run on small microprocessors.    A list of the boards that support zephyr can be

Hope this helps.

Kate


On Tue, Aug 18, 2020 at 8:11 AM Deepa Lakshmi <lakshmidpa@...> wrote:
hi team
       I need to run the zephyr hello world project in my lap. please, tell me the steps.
should update my OS to zeohyr from windows ?
or 
Zephyr can be run with windows 10 itself, with supporting packages.

please, let me know soon.


Thanks & Regards,
Deepa.R
8072608604


How to Run

Deepa Lakshmi <lakshmidpa@...>
 

hi team
       I need to run the zephyr hello world project in my lap. please, tell me the steps.
should update my OS to zeohyr from windows ?
or 
Zephyr can be run with windows 10 itself, with supporting packages.

please, let me know soon.


Thanks & Regards,
Deepa.R
8072608604


Re: LWM2M client to nrf582540-DK #nrf52840 #networking

Lubos, Robert
 

Hi Nikos,

 

Unfortunately, we don’t have a step-by-step guide for the scenario you describe, but I can provide you with some guidelines.

 

OpenThread has a reference implementation of border router, which can be run on a Linux host under docker (OpenThread is a protocol that enables IP over 802.15.4):

https://openthread.io/guides/border-router/docker

 

The `lwm2m_client` does not support OpenThread out-of-the box, but it can be easily added, see this comment:

https://github.com/zephyrproject-rtos/zephyr/issues/24840#issuecomment-624717991

 

Regards,

Robert

 

From: users@... [mailto:users@...] On Behalf Of Nikos Karamolegkos via lists.zephyrproject.org
Sent: Wednesday, August 5, 2020 11:32
To: users@...
Subject: [Zephyr-users] LWM2M client to nrf582540-DK #nrf52840 #networking

 

Hi all,

I have two nrf582540-dk modules and I would like to run the lwm2m client example of the link using the leshan server. How could I implement this using real device? How my 802.15.4 device will communicate with the server running on my PC? Is there any border router? 

I really need this. Can someone point me in the right direction?

Thank you,
Nikos


UART_ERROR_FRAMING

Edyta Bosacka <edyta.bosacka@...>
 

Hi 🙂 I read some data from gps by uart and sometimes when I start my program it workA, but sometimes I get error form uart_err_check - "UART_ERROR_FRAMING = (1 << 2)". 
What could be the reason of it ?
 




Re: sending data to SD card - CS control inhibited (no GPIO device)

Florian Vaussard
 

Hello,

Le 29.07.20 à 12:03, Edyta Bosacka a écrit :
I want to write some data in .csv file on SD card. Some of data are written , but then I get error :
 "CS control inhibited (no GPIO device)"
I do not know if you resolved your issue, but the message that you mention is for sure
not the root cause of your issue. It is not even an error, since it is an <inf>. I agree
that it can be a bit misleading.

I added this in config file:
This seems to work, since your SD card is detected by the sdhc_spi driver, look at the
next lines.

If part of your data is written, then the usage fault might be in your writing loop.
It is hard to tell you more without more information. Maybe open a GH issue if you still
face an issue.

Cheers,

Florian


Re: How to use "Serial CAN Bus Module" #driver #uart #can

Lawrence King
 

I have used the Longan module with Zephyr on nrf52840. I connected it to a Serial, then modified the Longan library to compile and work under Zephyr.

 

This isn’t everything you need (missing the .h includes, and the uart1_xx functions) but should get you started.

 

Lawrence King

Principal Developer

+1(416)627-7302

 

From: users@... <users@...> On Behalf Of s9gosich@...
Sent: Wednesday, August 12, 2020 11:52 AM
To: users@...
Subject: [Zephyr-users] How to use "Serial CAN Bus Module" #can #driver #uart

 

Hi all,

I’m new to zephyr and need some help.

I have a nrf52dk board and want to use this ( https://www.longan-labs.cc/1030001.html ) serial to CAN device. I was able to test this with an Arduino and this library ( https://github.com/Longan-Labs/Serial_CAN_Arduino ). Now, I’m a bit lost how to use it with Zephyr.
Can I import the arduino library into Zephyr? Or do I need to rewrite the library? Or would it be easier to buy some othe CAN module which is supported by Zephyr?

 

Thank you!

Govinda


How to use "Serial CAN Bus Module" #driver #uart #can

s9gosich@...
 

Hi all,

I’m new to zephyr and need some help.

I have a nrf52dk board and want to use this ( https://www.longan-labs.cc/1030001.html ) serial to CAN device. I was able to test this with an Arduino and this library ( https://github.com/Longan-Labs/Serial_CAN_Arduino ). Now, I’m a bit lost how to use it with Zephyr.
Can I import the arduino library into Zephyr? Or do I need to rewrite the library? Or would it be easier to buy some othe CAN module which is supported by Zephyr?


Thank you!

Govinda


Re: Debugging with Eclipse and PyOCD: Uncaught Exception in pyocd.exe

Bolivar, Marti
 

Hi, responses inline.

"Weber, Dominik via lists.zephyrproject.org"
<dominik.weber=iis.fraunhofer.de@lists.zephyrproject.org> writes:

Hello there,

I'm new to Zephyr and having some trouble with debugging my application with PyOCD and Eclipse. I'm running a multithreaded application on a nRF52840 DK. I flash and want to debug the application via the onboard debugger on the DK. I followed the steps described in the tutorial: https://docs.zephyrproject.org/2.3.0/application/index.html#application in the section "Eclipse Debugging".

I use:

* Zephyr 2.3 Build 99

* Segger J-Link OB-SAM3U128-V2-NordicSemi

* Eclipse 2019-09

* Python 3.8.3

* West 0.7.2

* C compiler GNU 9.2.1

All Python dependencies for Zephyr are satisfied.
Does this mean you installed the latest pyocd? The zephyr
requirements-run-test.txt file from which pyocd comes just says:

pyocd>=0.24.0

The version of this tool is likely what is at issue.


When I try to debug the application via pyocd.exe or pyocd-gdbserver.exe I get the following error:

0001289:CRITICAL:__main__:uncaught exception: 'JLinkProbe' object has no attribute '_lock'
Traceback (most recent call last):
File "c:\python38\lib\site-packages\pyocd\__main__.py", line 362, in run
self._COMMANDS[self._args.cmd](self)
File "c:\python38\lib\site-packages\pyocd\__main__.py", line 680, in do_gdbserver
with session:
File "c:\python38\lib\site-packages\pyocd\core\session.py", line 302, in __enter__
self.open()
File "c:\python38\lib\site-packages\pyocd\core\session.py", line 420, in open
self._board.init()
File "c:\python38\lib\site-packages\pyocd\board\board.py", line 85, in init
self.target.init()
File "c:\python38\lib\site-packages\pyocd\core\coresight_target.py", line 160, in init
seq.invoke()
File "c:\python38\lib\site-packages\pyocd\utility\sequencer.py", line 213, in invoke
resultSequence.invoke()
File "c:\python38\lib\site-packages\pyocd\utility\sequencer.py", line 208, in invoke
resultSequence = call()
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 359, in power_up_debug
self.write_reg(DP_CTRL_STAT, CSYSPWRUPREQ | CDBGPWRUPREQ | MASKLANE | TRNNORMAL)
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 348, in write_reg
self.write_dp(addr, data)
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 528, in write_dp
did_lock = self._set_dpbanksel(addr, True)
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 480, in _set_dpbanksel
self.lock()
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 252, in lock
self.probe.lock()
File "c:\python38\lib\site-packages\pyocd\probe\debug_probe.py", line 173, in lock
self._lock.acquire()
AttributeError: 'JLinkProbe' object has no attribute '_lock'

Is this a bug in the python scripts or is the debugger not supported?
This error is coming from pyocd itself. Since it's an AttributeError it
looks like there's probably a bug in the tool. Knowing the exact version
is the next step. I would try manually installing the 0.24.0 version
given in the requirements file if the latest release is buggy here.

I don't understand if "When I try to debug the application via pyocd.exe
or pyocd-gdbserver.exe" means you are using 'west debug' or 'west
debugserver', but if so, you can run in verbose mode to see the pyocd
commands under the hood:

west -v debug

Example output:

$ west -v debug
[...]
-- west debug: using runner pyocd
-- runners.pyocd: pyOCD GDB server running on port 3333
runners.pyocd: pyocd gdbserver -p 3333 -T 4444 -t nrf52840 -f 4000000
runners.pyocd: /home/mbolivar/bin/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb /home/mbolivar/zp/zephyr/build/zephyr/zephyr.elf -ex 'target remote :3333' -ex 'monitor halt' -ex 'monitor reset' -ex load

Thanks,
Martí


Thanks for your help!

Best Regards,
Dominik



Debugging with Eclipse and PyOCD: Uncaught Exception in pyocd.exe

Weber, Dominik <dominik.weber@...>
 

Hello there,

 

I’m new to Zephyr and having some trouble with debugging my application with PyOCD and Eclipse. I’m running a multithreaded application on a nRF52840 DK. I flash and want to debug the application via the onboard debugger on the DK. I followed the steps described in the tutorial: https://docs.zephyrproject.org/2.3.0/application/index.html#application in the section „Eclipse Debugging“.

 

I use:

·         Zephyr 2.3 Build 99

·         Segger J-Link OB-SAM3U128-V2-NordicSemi

·         Eclipse 2019-09

·         Python 3.8.3

·         West 0.7.2

·         C compiler GNU 9.2.1

 

All Python dependencies for Zephyr are satisfied.

 

When I try to debug the application via pyocd.exe or pyocd-gdbserver.exe I get the following error:

 

0001289:CRITICAL:__main__:uncaught exception: 'JLinkProbe' object has no attribute '_lock'

Traceback (most recent call last):

  File "c:\python38\lib\site-packages\pyocd\__main__.py", line 362, in run

    self._COMMANDS[self._args.cmd](self)

  File "c:\python38\lib\site-packages\pyocd\__main__.py", line 680, in do_gdbserver

    with session:

  File "c:\python38\lib\site-packages\pyocd\core\session.py", line 302, in __enter__

    self.open()

  File "c:\python38\lib\site-packages\pyocd\core\session.py", line 420, in open

    self._board.init()

  File "c:\python38\lib\site-packages\pyocd\board\board.py", line 85, in init

    self.target.init()

  File "c:\python38\lib\site-packages\pyocd\core\coresight_target.py", line 160, in init

    seq.invoke()

  File "c:\python38\lib\site-packages\pyocd\utility\sequencer.py", line 213, in invoke

    resultSequence.invoke()

  File "c:\python38\lib\site-packages\pyocd\utility\sequencer.py", line 208, in invoke

    resultSequence = call()

  File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 359, in power_up_debug

    self.write_reg(DP_CTRL_STAT, CSYSPWRUPREQ | CDBGPWRUPREQ | MASKLANE | TRNNORMAL)

  File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 348, in write_reg

    self.write_dp(addr, data)

  File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 528, in write_dp

    did_lock = self._set_dpbanksel(addr, True)

  File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 480, in _set_dpbanksel

    self.lock()

  File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 252, in lock

    self.probe.lock()

  File "c:\python38\lib\site-packages\pyocd\probe\debug_probe.py", line 173, in lock

    self._lock.acquire()

AttributeError: 'JLinkProbe' object has no attribute '_lock'

 

Is this a bug in the python scripts or is the debugger not supported?

 

Thanks for your help!

 

Best Regards,

Dominik

 


API meeting: agenda

Carles Cufi
 


How to enable external #pullup resistor in #pullup #i2c

Diogo Correia <dcorreia@...>
 

Hello there,

I'm trying to connect my board (nrf52dk-nrf52832) to a development kit, through I2C, which has external pull up resistors. I would like to configure the I2C port to accept the external pull-up resistors, just like in nRF52 SDK, I've already searched on the "All Configuration Options" page but can't find anything.

Kind regards,
Diogo Correia


Re: Using counter (with RTC) on #nrf52832

Diogo Correia <diogo.correia@...>
 

Hi Krzysztof,

I thought that the use of one of the counters would be considered due to its presence in the device-tree.
So from what I understood, every instance from the device-tree must be enabled, either on .conf or Kconfig files? I'm asking this, because i've used a sensor (with TWI), did not enabled the port on the config file, just created added it into the .orverlay file, and it worked.

Kind regards,
Diogo


Diogo Correia 
Junior Researcher | Fraunhofer Portugal AICOS
t. +351 220430300  w. www.fraunhofer.pt


De: Chruściński, Krzysztof <Krzysztof.Chruscinski@...>
Enviado: 7 de agosto de 2020 06:49:32
Para: Diogo Correia; users@...
Assunto: RE: [Zephyr-users] Using counter (with RTC) on #nRF52832
 

Hi Diogo,

 

CMake is complaining because even though COUNTER driver is enabled there is no COUNTER instance enabled. In the example there is a Kconfig (samples/drivers/counter/alarm/Kconfig) which enabled COUNTER_RTC0 for Nordic platform and you need to do the same.

 

Note that for other drivers enabling instances happens in Device Tree. Counter will be aligned to that at some point.

 

Regards,

Krzysztof

 

From: users@... <users@...> On Behalf Of Diogo Correia via lists.zephyrproject.org
Sent: Thursday, August 6, 2020 3:23 PM
To: users@...
Subject: [Zephyr-users] Using counter (with RTC) on #nRF52832

 

Hi there,

 

I've started using Zephyr OS last week, so is better to advise that there might be a tiny chance of this question being dumb. I'm trying to use the Nordic's nRF52832 RTC clock, so wrote a small piece of software (based on the samples/counter/alarm/ example). However, when trying to compile I receive the following error:

 

CMake Error at /home/diogo.correia/zephyrproject/zephyr/cmake/extensions.cmake:372 (add_library):
  No SOURCES given to target: drivers__counter
Call Stack (most recent call first):
  /home/diogo.correia/zephyrproject/zephyr/cmake/extensions.cmake:349 (zephyr_library_named)
  /home/diogo.correia/zephyrproject/zephyr/drivers/counter/CMakeLists.txt:3 (zephyr_library)


-- Build files have been written to: /home/diogo.correia/zephyrproject/zephyrLAB/build
FAILED: build.ninja
/usr/local/bin/cmake -S/home/diogo.correia/zephyrproject/zephyrLAB -B/home/diogo.correia/zephyrproject/zephyrLAB/build
ninja: error: rebuilding 'build.ninja': subcommand failed
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/diogo.correia/zephyrproject/zephyrLAB/build

 

 

My .conf file:

 

#Nordic nRF52 RTT LOGGER

 

CONFIG_USE_SEGGER_RTT=y

 

CONFIG_RTT_CONSOLE=y

 

CONFIG_UART_CONSOLE=n

 



 

#Counter

 

CONFIG_COUNTER=y

 

 

 

My .c file:

 

#include

<zephyr.h>

 

#include

<sys/printk.h>

 

#include

<device.h>

 

#include

<drivers/counter.h>

 



 

#if

defined(CONFIG_COUNTER_RTC0)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc0))

 

#elif

defined(CONFIG_COUNTER_RTC1)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc1))

 

#elif

defined(CONFIG_COUNTER_RTC2)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc2))

 

#endif

 

 

 



 

struct device *counter;

 

 

 

struct counter_alarm_cfg alarm_config;

 

 

 

void

init();

 

void

counter_callback(struct device *counter_dev,

u8_t

chan_id,

u32_t ticks,

void *user_data);

 

 

 

 



 

 

 

 

void

main(void)

 

{

 

init();

 

while(1) {

 

k_sleep(K_FOREVER);

 

}

 



}

 

 

 

 



 

 

 

void

init(){

 

// Counter

 

counter = device_get_binding(TIMER);

 

if (counter ==

NULL){

 

printk("ERROR: %s not found.\n",

TIMER);

 

return;

 

}

 

counter_start(counter);

 

alarm_config.flags =

0;

 

alarm_config.ticks =

counter_us_to_ticks(counter,

1000000);

 

alarm_config.callback = counter_callback;

 

counter_set_channel_alarm(counter,

0, &alarm_config);

 

}

 

 



 

 

 

 

 


Re: Using counter (with RTC) on #nrf52832

Chruściński, Krzysztof
 

Hi Diogo,

 

As written before “Note that for other drivers enabling instances happens in Device Tree. Counter will be aligned to that at some point.”.

We are going towards instances being enabled in DT and counter is not yet there.

 

Regards,

Krzysztof

 

From: Diogo Correia <diogo.correia@...>
Sent: Friday, August 7, 2020 11:08 AM
To: Chruściński, Krzysztof <Krzysztof.Chruscinski@...>; users@...
Subject: Re: [Zephyr-users] Using counter (with RTC) on #nRF52832

 

Hi Krzysztof,

I thought that the use of one of the counters would be considered due to its presence in the device-tree.
So from what I understood, every instance from the device-tree must be enabled, either on .conf or Kconfig files? I'm asking this, because i've used a sensor (with TWI), did not enabled the port on the config file, just created added it into the .orverlay file, and it worked.

 

Kind regards,

Diogo

 

Diogo Correia 

Junior Researcher | Fraunhofer Portugal AICOS
t. +351 220430300  w. www.fraunhofer.pt

 


De: Chruściński, Krzysztof <Krzysztof.Chruscinski@...>
Enviado: 7 de agosto de 2020 06:49:32
Para: Diogo Correia; users@...
Assunto: RE: [Zephyr-users] Using counter (with RTC) on #nRF52832

 

Hi Diogo,

 

CMake is complaining because even though COUNTER driver is enabled there is no COUNTER instance enabled. In the example there is a Kconfig (samples/drivers/counter/alarm/Kconfig) which enabled COUNTER_RTC0 for Nordic platform and you need to do the same.

 

Note that for other drivers enabling instances happens in Device Tree. Counter will be aligned to that at some point.

 

Regards,

Krzysztof

 

From: users@... <users@...> On Behalf Of Diogo Correia via lists.zephyrproject.org
Sent: Thursday, August 6, 2020 3:23 PM
To: users@...
Subject: [Zephyr-users] Using counter (with RTC) on #nRF52832

 

Hi there,

 

I've started using Zephyr OS last week, so is better to advise that there might be a tiny chance of this question being dumb. I'm trying to use the Nordic's nRF52832 RTC clock, so wrote a small piece of software (based on the samples/counter/alarm/ example). However, when trying to compile I receive the following error:

 

CMake Error at /home/diogo.correia/zephyrproject/zephyr/cmake/extensions.cmake:372 (add_library):
  No SOURCES given to target: drivers__counter
Call Stack (most recent call first):
  /home/diogo.correia/zephyrproject/zephyr/cmake/extensions.cmake:349 (zephyr_library_named)
  /home/diogo.correia/zephyrproject/zephyr/drivers/counter/CMakeLists.txt:3 (zephyr_library)


-- Build files have been written to: /home/diogo.correia/zephyrproject/zephyrLAB/build
FAILED: build.ninja
/usr/local/bin/cmake -S/home/diogo.correia/zephyrproject/zephyrLAB -B/home/diogo.correia/zephyrproject/zephyrLAB/build
ninja: error: rebuilding 'build.ninja': subcommand failed
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/diogo.correia/zephyrproject/zephyrLAB/build

 

 

My .conf file:

 

#Nordic nRF52 RTT LOGGER

 

CONFIG_USE_SEGGER_RTT=y

 

CONFIG_RTT_CONSOLE=y

 

CONFIG_UART_CONSOLE=n

 

 

 

#Counter

 

CONFIG_COUNTER=y

 

 

 

My .c file:

 

#include

<zephyr.h>

 

#include

<sys/printk.h>

 

#include

<device.h>

 

#include

<drivers/counter.h>

 

 

 

#if

defined(CONFIG_COUNTER_RTC0)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc0))

 

#elif

defined(CONFIG_COUNTER_RTC1)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc1))

 

#elif

defined(CONFIG_COUNTER_RTC2)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc2))

 

#endif

 

 

 

 

 

struct device *counter;

 

 

 

struct counter_alarm_cfg alarm_config;

 

 

 

void

init();

 

void

counter_callback(struct device *counter_dev,

u8_t

chan_id,

u32_t ticks,

void *user_data);

 

 

 

 

 

 

 

 

 

void

main(void)

 

{

 

init();

 

while(1) {

 

k_sleep(K_FOREVER);

 

}

 

 

}

 

 

 

 

 

 

 

 

void

init(){

 

// Counter

 

counter = device_get_binding(TIMER);

 

if (counter ==

NULL){

 

printk("ERROR: %s not found.\n",

TIMER);

 

return;

 

}

 

counter_start(counter);

 

alarm_config.flags =

0;

 

alarm_config.ticks =

counter_us_to_ticks(counter,

1000000);

 

alarm_config.callback = counter_callback;

 

counter_set_channel_alarm(counter,

0, &alarm_config);

 

}

 

 

 

 

 

 

 

 


Re: Using counter (with RTC) on #nrf52832

Chruściński, Krzysztof
 

Hi Diogo,

 

CMake is complaining because even though COUNTER driver is enabled there is no COUNTER instance enabled. In the example there is a Kconfig (samples/drivers/counter/alarm/Kconfig) which enabled COUNTER_RTC0 for Nordic platform and you need to do the same.

 

Note that for other drivers enabling instances happens in Device Tree. Counter will be aligned to that at some point.

 

Regards,

Krzysztof

 

From: users@... <users@...> On Behalf Of Diogo Correia via lists.zephyrproject.org
Sent: Thursday, August 6, 2020 3:23 PM
To: users@...
Subject: [Zephyr-users] Using counter (with RTC) on #nRF52832

 

Hi there,

 

I've started using Zephyr OS last week, so is better to advise that there might be a tiny chance of this question being dumb. I'm trying to use the Nordic's nRF52832 RTC clock, so wrote a small piece of software (based on the samples/counter/alarm/ example). However, when trying to compile I receive the following error:

 

CMake Error at /home/diogo.correia/zephyrproject/zephyr/cmake/extensions.cmake:372 (add_library):
  No SOURCES given to target: drivers__counter
Call Stack (most recent call first):
  /home/diogo.correia/zephyrproject/zephyr/cmake/extensions.cmake:349 (zephyr_library_named)
  /home/diogo.correia/zephyrproject/zephyr/drivers/counter/CMakeLists.txt:3 (zephyr_library)


-- Build files have been written to: /home/diogo.correia/zephyrproject/zephyrLAB/build
FAILED: build.ninja
/usr/local/bin/cmake -S/home/diogo.correia/zephyrproject/zephyrLAB -B/home/diogo.correia/zephyrproject/zephyrLAB/build
ninja: error: rebuilding 'build.ninja': subcommand failed
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/diogo.correia/zephyrproject/zephyrLAB/build

 

 

My .conf file:

 

#Nordic nRF52 RTT LOGGER

 

CONFIG_USE_SEGGER_RTT=y

 

CONFIG_RTT_CONSOLE=y

 

CONFIG_UART_CONSOLE=n

 



 

#Counter

 

CONFIG_COUNTER=y

 

 

 

My .c file:

 

#include

<zephyr.h>

 

#include

<sys/printk.h>

 

#include

<device.h>

 

#include

<drivers/counter.h>

 



 

#if

defined(CONFIG_COUNTER_RTC0)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc0))

 

#elif

defined(CONFIG_COUNTER_RTC1)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc1))

 

#elif

defined(CONFIG_COUNTER_RTC2)

 

#define TIMER

DT_LABEL(DT_NODELABEL(rtc2))

 

#endif

 

 

 



 

struct device *counter;

 

 

 

struct counter_alarm_cfg alarm_config;

 

 

 

void

init();

 

void

counter_callback(struct device *counter_dev,

u8_t

chan_id,

u32_t ticks,

void *user_data);

 

 

 

 



 

 

 

 

void

main(void)

 

{

 

init();

 

while(1) {

 

k_sleep(K_FOREVER);

 

}

 



}

 

 

 

 



 

 

 

void

init(){

 

// Counter

 

counter = device_get_binding(TIMER);

 

if (counter ==

NULL){

 

printk("ERROR: %s not found.\n",

TIMER);

 

return;

 

}

 

counter_start(counter);

 

alarm_config.flags =

0;

 

alarm_config.ticks =

counter_us_to_ticks(counter,

1000000);

 

alarm_config.callback = counter_callback;

 

counter_set_channel_alarm(counter,

0, &alarm_config);

 

}

 

 



 

 

 

 

 

 

Diogo Correia
Junior Researcher

 

 

Fraunhofer Portugal Research Center for

Assistive Information and Communication Solutions

Rua Alfredo Allen 455/461

4200-135 Porto, Portugal

follow us on facebook youtube linkedin twitter

t.

+351 220430300

f.

+351 226005029

e.

diogo.correia@...

w.

www.fraunhofer.pt


Fraunhofer Portugal Challenge 2018

561 - 580 of 2730