Date   

Opus codec on nrf52840

nicolas lantz
 

Hi,

I would like to use the Opus codec with zephyr on a nrf52840 to encode or decode an audio stream.
Has anyone have a suggestion on this project?


Regards,

Nicolas
 


Re: logging subsys questions / concerns

Boie, Andrew P
 

Thanks for all the feedback.
As agreed on Slack I am copying Krzysztof and Jakub here so that they see your
comments and then, if applicable, we can create one or more issues alongside
the ones that Paul has already opened.
Just to follow up after some further inspection:

Introduce a k_sem with initial count 0 and max count UINT_MAX. Log
points have the caller give the semaphore every time something is
added to the log buffer, and have the background thread simply do a
blocking k_sem_take().
On further inspection, we don't even need a semaphore. It appears some wheels were re-invented, we can simply delete all the code subsys/logging/log_list.c and use either a k_queue or k_pipe instead, which the log thread can then sleep on until there's data to write.

Andrew


Re: logging subsys questions / concerns

Carles Cufi
 

Hi Andrew,

Thanks for all the feedback.
As agreed on Slack I am copying Krzysztof and Jakub here so that they see your comments and then, if applicable, we can create one or more issues alongside the ones that Paul has already opened.

Regards,

Carles

-----Original Message-----
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> On
Behalf Of Boie, Andrew P
Sent: 28 November 2018 21:01
To: zephyr-devel <zephyr-devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] logging subsys questions / concerns

I've been looking at the logging subsystem code and I wanted to bring up
some topics.

1) The default priority of the logging thread is -2. This is a very high
non preemptive priority. I don't understand why the logging background
thread doesn't run at the lowest preemptible priority on the system,
like the idle thread. If people are running out of buffer space then
they need to make their buffers bigger or switch to synchronous logging.

2) The panic mode handling is not correct. It gets called from
_NanoFatalErrorHandler, which flushes the log and then sets the
panic_mode global *permanently* to true. This is not a good policy.
NanoFatalErrorHandler getting called does not necessarily mean that the
system has completely crashed, it's quite possible that the damage is
limited to one thread dying, with the rest of the threads (and the
overall system) still running just fine. I think we need to move the
invocation of LOG_PANIC until *much* later, when we decide we need to
hang the system instead of just aborting the faulting thread.

3) It does not appear that there is any support for invoking LOG()
macros from user mode, which severely limits its usability. Until there
is an answer to this, conversations about default mapping printk() to
the log subsystem really scare me. Is LOG intended to be used by end
user applications or just internally to the kernel?

4) The synchronization between threads invoking log points, and the
background logging thread, do not make sense to me, and seem to be a way
of dealing with making the log thread default to a very high non-
preemptible priority, which I already complained about.

I think CONFIG_LOG_PROCESS_SLEEP_MS and
CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD should be completely removed.
Introduce a k_sem with initial count 0 and max count UINT_MAX. Log
points have the caller give the semaphore every time something is added
to the log buffer, and have the background thread simply do a blocking
k_sem_take(). So much simpler, and we rely on the scheduler to do its
job instead of this weird setup where the log thread is high priority
but sleeps for hard-coded intervals.

5) What does it mean if CONFIG_LOG_INPLACE_PROCESS=n, but
CONFIG_LOG_PROCESS_THREAD=n? Can we simplify our Kconfigs?



logging subsys questions / concerns

Boie, Andrew P
 

I've been looking at the logging subsystem code and I wanted to bring up some topics.
 
1) The default priority of the logging thread is -2. This is a very high non preemptive priority. I don't understand why the logging background thread doesn't run at the lowest preemptible priority on the system, like the idle thread. If people are running out of buffer space then they need to make their buffers bigger or switch to synchronous logging.
 
2) The panic mode handling is not correct. It gets called from _NanoFatalErrorHandler, which flushes the log and then sets the panic_mode global *permanently* to true. This is not a good policy. NanoFatalErrorHandler getting called does not necessarily mean that the system has completely crashed, it's quite possible that the damage is limited to one thread dying, with the rest of the threads (and the overall system) still running just fine. I think we need to move the invocation of LOG_PANIC until *much* later, when we decide we need to hang the system instead of just aborting the faulting thread.
 
3) It does not appear that there is any support for invoking LOG() macros from user mode, which severely limits its usability. Until there is an answer to this, conversations about default mapping printk() to the log subsystem really scare me. Is LOG intended to be used by end user applications or just internally to the kernel?
 
4) The synchronization between threads invoking log points, and the background logging thread, do not make sense to me, and seem to be a way of dealing with making the log thread default to a very high non-preemptible priority, which I already complained about.
 
I think CONFIG_LOG_PROCESS_SLEEP_MS and CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD should be completely removed. Introduce a k_sem with initial count 0 and max count UINT_MAX. Log points have the caller give the semaphore every time something is added to the log buffer, and have the background thread simply do a blocking k_sem_take(). So much simpler, and we rely on the scheduler to do its job instead of this weird setup where the log thread is high priority but sleeps for hard-coded intervals.
 
5) What does it mean if CONFIG_LOG_INPLACE_PROCESS=n, but CONFIG_LOG_PROCESS_THREAD=n? Can we simplify our Kconfigs?


Re: cmake application project architecture

Florian Fouillet <Florian.Fouillet@...>
 

I understand, thank you very much.

-----Original Message-----
From: Bøe, Sebastian [mailto:Sebastian.Boe@nordicsemi.no]
Sent: Wednesday, November 28, 2018 9:53 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; Hovland, Sigvart <Sigvart.Hovland@nordicsemi.no>; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

[External email: Use caution with links and attachments]

________________________________



It adds a dependency between DL and offsets_h.

offsets_h is a target that happens to depend on various kernel headers, including syscall_list.h, which evidently was used by the application library.

I'm not aware of any such example.

________________________________________
From: Florian Fouillet <Florian.Fouillet@schneider-electric.com>
Sent: Wednesday, November 28, 2018 3:49:43 PM
To: Bøe, Sebastian; Hovland, Sigvart; devel@lists.zephyrproject.org
Subject: RE: [Zephyr-devel] cmake application project architecture

Hi,

Thank you for your reply. It's working.

What does add_dependencies(DL offsets_h) do?

Is there any zephyr cmake example using multiple CMakeLists I can read?

Thanks for your help!



-----Original Message-----
From: Bøe, Sebastian [mailto:Sebastian.Boe@nordicsemi.no]
Sent: Wednesday, November 28, 2018 9:45 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; Hovland, Sigvart <Sigvart.Hovland@nordicsemi.no>; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

[External email: Use caution with links and attachments]

________________________________



You also need

add_dependencies(DL offsets_h)

________________________________________
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Florian Fouillet <Florian.Fouillet@schneider-electric.com>
Sent: Wednesday, November 28, 2018 3:42:54 PM
To: Hovland, Sigvart; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

Hi,

By adding target_link_libraries(DL PRIVATE zephyr_interface)

I still have the following issue

fatal error: syscall_list.h: No such file or directory

From: Hovland, Sigvart [mailto:Sigvart.Hovland@nordicsemi.no]
Sent: Wednesday, November 28, 2018 4:26 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; devel@lists.zephyrproject.org
Subject: RE: cmake application project architecture


[External email: Use caution with links and attachments]

________________________________


Maybe adding

target_link_libraries(DL PRIVATE zephyr_interface)


To your 2nd CMake file could help?

From: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org> [mailto:devel@lists.zephyrproject.org] On Behalf Of Florian Fouillet
Sent: Tuesday, November 27, 2018 9:53 PM
To: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] cmake application project architecture

Hi everyone,

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP.

I want to create my own application using cmake as recommended by the documentation.

However I don't want to put everything in one CMakeLists.txt. I want to break down my project into libraries (multiple CMakeLists.txt).

Do you know if there is any documentation talking about that?

My top CMakeLists looks like that:

cmake_minimum_required(VERSION 3.8.2)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)


add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/DataLinkLayer
${CMAKE_CURRENT_SOURCE_DIR}/build/${BOARD}/DataLinkLayer)

target_sources(app PRIVATE src/main.c)

target_link_libraries(app
PRIVATE DL
)


And my second CMakeLists (under the folder DataLinkLayer) looks like that:

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

add_library(DL src/DataLinkInterface.c)

target_include_directories(DL
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Interface)



The issue is I can include the boilerplate.cmake in only one CMakeLists.txt otherwise It's not working, But, the second CmakeLists doesn't know the zephyr library..

I tried to add: include_directories(/home/user/zephyr/include) in the second CMakeLists but it is not enough. Do you know what should I do?


Thank you,


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


Re: cmake application project architecture

Sebastian Boe
 

It adds a dependency between DL and offsets_h.

offsets_h is a target that happens to depend on various kernel headers,
including syscall_list.h, which evidently was used by the application
library.

I'm not aware of any such example.

________________________________________
From: Florian Fouillet <Florian.Fouillet@schneider-electric.com>
Sent: Wednesday, November 28, 2018 3:49:43 PM
To: Bøe, Sebastian; Hovland, Sigvart; devel@lists.zephyrproject.org
Subject: RE: [Zephyr-devel] cmake application project architecture

Hi,

Thank you for your reply. It's working.

What does add_dependencies(DL offsets_h) do?

Is there any zephyr cmake example using multiple CMakeLists I can read?

Thanks for your help!



-----Original Message-----
From: Bøe, Sebastian [mailto:Sebastian.Boe@nordicsemi.no]
Sent: Wednesday, November 28, 2018 9:45 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; Hovland, Sigvart <Sigvart.Hovland@nordicsemi.no>; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

[External email: Use caution with links and attachments]

________________________________



You also need

add_dependencies(DL offsets_h)

________________________________________
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Florian Fouillet <Florian.Fouillet@schneider-electric.com>
Sent: Wednesday, November 28, 2018 3:42:54 PM
To: Hovland, Sigvart; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

Hi,

By adding target_link_libraries(DL PRIVATE zephyr_interface)

I still have the following issue

fatal error: syscall_list.h: No such file or directory

From: Hovland, Sigvart [mailto:Sigvart.Hovland@nordicsemi.no]
Sent: Wednesday, November 28, 2018 4:26 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; devel@lists.zephyrproject.org
Subject: RE: cmake application project architecture


[External email: Use caution with links and attachments]

________________________________


Maybe adding

target_link_libraries(DL PRIVATE zephyr_interface)


To your 2nd CMake file could help?

From: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org> [mailto:devel@lists.zephyrproject.org] On Behalf Of Florian Fouillet
Sent: Tuesday, November 27, 2018 9:53 PM
To: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] cmake application project architecture

Hi everyone,

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP.

I want to create my own application using cmake as recommended by the documentation.

However I don't want to put everything in one CMakeLists.txt. I want to break down my project into libraries (multiple CMakeLists.txt).

Do you know if there is any documentation talking about that?

My top CMakeLists looks like that:

cmake_minimum_required(VERSION 3.8.2)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)


add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/DataLinkLayer
${CMAKE_CURRENT_SOURCE_DIR}/build/${BOARD}/DataLinkLayer)

target_sources(app PRIVATE src/main.c)

target_link_libraries(app
PRIVATE DL
)


And my second CMakeLists (under the folder DataLinkLayer) looks like that:

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

add_library(DL src/DataLinkInterface.c)

target_include_directories(DL
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Interface)



The issue is I can include the boilerplate.cmake in only one CMakeLists.txt otherwise It's not working, But, the second CmakeLists doesn't know the zephyr library..

I tried to add: include_directories(/home/user/zephyr/include) in the second CMakeLists but it is not enough. Do you know what should I do?


Thank you,


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


Re: cmake application project architecture

Florian Fouillet <Florian.Fouillet@...>
 

Hi,

Thank you for your reply. It's working.

What does add_dependencies(DL offsets_h) do?

Is there any zephyr cmake example using multiple CMakeLists I can read?

Thanks for your help!

-----Original Message-----
From: Bøe, Sebastian [mailto:Sebastian.Boe@nordicsemi.no]
Sent: Wednesday, November 28, 2018 9:45 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; Hovland, Sigvart <Sigvart.Hovland@nordicsemi.no>; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

[External email: Use caution with links and attachments]

________________________________



You also need

add_dependencies(DL offsets_h)

________________________________________
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Florian Fouillet <Florian.Fouillet@schneider-electric.com>
Sent: Wednesday, November 28, 2018 3:42:54 PM
To: Hovland, Sigvart; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

Hi,

By adding target_link_libraries(DL PRIVATE zephyr_interface)

I still have the following issue

fatal error: syscall_list.h: No such file or directory

From: Hovland, Sigvart [mailto:Sigvart.Hovland@nordicsemi.no]
Sent: Wednesday, November 28, 2018 4:26 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; devel@lists.zephyrproject.org
Subject: RE: cmake application project architecture


[External email: Use caution with links and attachments]

________________________________


Maybe adding

target_link_libraries(DL PRIVATE zephyr_interface)


To your 2nd CMake file could help?

From: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org> [mailto:devel@lists.zephyrproject.org] On Behalf Of Florian Fouillet
Sent: Tuesday, November 27, 2018 9:53 PM
To: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] cmake application project architecture

Hi everyone,

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP.

I want to create my own application using cmake as recommended by the documentation.

However I don't want to put everything in one CMakeLists.txt. I want to break down my project into libraries (multiple CMakeLists.txt).

Do you know if there is any documentation talking about that?

My top CMakeLists looks like that:

cmake_minimum_required(VERSION 3.8.2)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)


add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/DataLinkLayer
${CMAKE_CURRENT_SOURCE_DIR}/build/${BOARD}/DataLinkLayer)

target_sources(app PRIVATE src/main.c)

target_link_libraries(app
PRIVATE DL
)


And my second CMakeLists (under the folder DataLinkLayer) looks like that:

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

add_library(DL src/DataLinkInterface.c)

target_include_directories(DL
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Interface)



The issue is I can include the boilerplate.cmake in only one CMakeLists.txt otherwise It's not working, But, the second CmakeLists doesn't know the zephyr library..

I tried to add: include_directories(/home/user/zephyr/include) in the second CMakeLists but it is not enough. Do you know what should I do?


Thank you,


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


Re: cmake application project architecture

Sebastian Boe
 

You also need

add_dependencies(DL offsets_h)

________________________________________
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Florian Fouillet <Florian.Fouillet@schneider-electric.com>
Sent: Wednesday, November 28, 2018 3:42:54 PM
To: Hovland, Sigvart; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] cmake application project architecture

Hi,

By adding target_link_libraries(DL PRIVATE zephyr_interface)

I still have the following issue

fatal error: syscall_list.h: No such file or directory

From: Hovland, Sigvart [mailto:Sigvart.Hovland@nordicsemi.no]
Sent: Wednesday, November 28, 2018 4:26 AM
To: Florian Fouillet <Florian.Fouillet@schneider-electric.com>; devel@lists.zephyrproject.org
Subject: RE: cmake application project architecture


[External email: Use caution with links and attachments]

________________________________


Maybe adding

target_link_libraries(DL PRIVATE zephyr_interface)


To your 2nd CMake file could help?

From: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org> [mailto:devel@lists.zephyrproject.org] On Behalf Of Florian Fouillet
Sent: Tuesday, November 27, 2018 9:53 PM
To: devel@lists.zephyrproject.org<mailto:devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] cmake application project architecture

Hi everyone,

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP.

I want to create my own application using cmake as recommended by the documentation.

However I don’t want to put everything in one CMakeLists.txt. I want to break down my project into libraries (multiple CMakeLists.txt).

Do you know if there is any documentation talking about that?

My top CMakeLists looks like that:

cmake_minimum_required(VERSION 3.8.2)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)


add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/DataLinkLayer
${CMAKE_CURRENT_SOURCE_DIR}/build/${BOARD}/DataLinkLayer)

target_sources(app PRIVATE src/main.c)

target_link_libraries(app
PRIVATE DL
)


And my second CMakeLists (under the folder DataLinkLayer) looks like that:

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

add_library(DL src/DataLinkInterface.c)

target_include_directories(DL
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Interface)



The issue is I can include the boilerplate.cmake in only one CMakeLists.txt otherwise It’s not working, But, the second CmakeLists doesn’t know the zephyr library..

I tried to add: include_directories(/home/user/zephyr/include) in the second CMakeLists but it is not enough. Do you know what should I do?


Thank you,


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


Re: cmake application project architecture

Florian Fouillet <Florian.Fouillet@...>
 

Hi,

 

By adding target_link_libraries(DL PRIVATE zephyr_interface)

 

I still have the following issue

 

fatal error: syscall_list.h: No such file or directory

 

From: Hovland, Sigvart [mailto:Sigvart.Hovland@...]
Sent: Wednesday, November 28, 2018 4:26 AM
To: Florian Fouillet <Florian.Fouillet@...>; devel@...
Subject: RE: cmake application project architecture

 

[External email: Use caution with links and attachments]


 

Maybe adding

target_link_libraries(DL PRIVATE zephyr_interface)

To your 2nd CMake file  could help?

 

From: devel@... [mailto:devel@...] On Behalf Of Florian Fouillet
Sent: Tuesday, November 27, 2018 9:53 PM
To: devel@...
Subject: [Zephyr-devel] cmake application project architecture

 

Hi everyone,

 

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP.

 

I want to create my own application using cmake as recommended by the documentation.

 

However I don’t want to put everything in one CMakeLists.txt. I want to break down my project into libraries (multiple CMakeLists.txt).

 

Do you know if there is any documentation talking about that?

 

My top CMakeLists looks like that:

 

cmake_minimum_required(VERSION 3.8.2)

 

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)

project(NONE)

 

 

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/DataLinkLayer

${CMAKE_CURRENT_SOURCE_DIR}/build/${BOARD}/DataLinkLayer)

 

target_sources(app PRIVATE src/main.c)

 

target_link_libraries(app

PRIVATE DL

)

 

 

And my second CMakeLists (under the folder DataLinkLayer) looks like that:

 

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

 

add_library(DL src/DataLinkInterface.c)

 

target_include_directories(DL

INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Interface)

 

 

 

The issue is I can include the boilerplate.cmake in only one CMakeLists.txt otherwise It’s not working, But, the second CmakeLists doesn’t know the zephyr library..

 

I tried to add: include_directories(/home/user/zephyr/include) in the second CMakeLists but it is not enough. Do you know what should I do?

 

 

Thank you,

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


How to print Debug and Error messages on console #nrf52480 #nrf52832

Akash Naidu <akashnaiduece@...>
 

Hi All,
Currently i have been working on "zephyr/samples/bluetooth/ipsp" example, in which i can able to see LOG_INF messages only.
How to print LOG_DBG and LOG_ERR messages on console.

The above example is running on nrf52 DK.
Thanks in Advance

BR
Akash.


Re: checkstack.pl

Benjamin Lindqvist
 

Lol. Mistyped again -- to clarify, I definitely mean checkstack.pl and
not checkpatch.pl, if anyone did not extrapolate successfully
Den ons 28 nov. 2018 kl 13:10 skrev Benjamin Lindqvist
<benjamin.lindqvist@endian.se>:


Hi,

I wanted to try out scripts/checkstack.pl and verified that it
actually works on a vmlinux image by

arm-none-eabi-objdump -d vmlinux | zephyr/scripts/checkpatch.pl arm

but when I do it on build/zephyr/zephyr.elf it just quietly exits,
with no output. Anyone have any idea why it doesn't work?


checkstack.pl

Benjamin Lindqvist
 

Hi,

I wanted to try out scripts/checkstack.pl and verified that it
actually works on a vmlinux image by

arm-none-eabi-objdump -d vmlinux | zephyr/scripts/checkpatch.pl arm

but when I do it on build/zephyr/zephyr.elf it just quietly exits,
with no output. Anyone have any idea why it doesn't work?


Re: [Zephyr-users] Cannot write with i2c NRF52832 (TWI and TWIM)

vikrant8051 <vikrant8051@...>
 

Hi to all,
I renamed driver name from CONFIG_I2C_0_NAME to DT_I2C_0_NAME.
Plus add following Kconfig things in prj.conf. Now everything is working fine.

CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_NRFX_TWI=y
CONFIG_I2C_0_NRF_TWI=y
CONFIG_HAS_HW_NRF_TWI0=y
CONFIG_I2C_INIT_PRIORITY=60
CONFIG_I2C_0=y

Thanks & Regards,
vikrant


On Wed, Nov 28, 2018 at 3:03 PM Vikrant More <vikrant8051@...> wrote:
Hi Jamie,
It seen that it is working with 1.12.99 which is your case.

But with latest master branch, it is not.

Issue is in driver name
#define I2C_DEV CONFIG_I2C_0_NAME

Thanks for support !!

On Wed, Nov 28, 2018 at 2:48 PM Jamie Mccrae <Jamie.Mccrae@...> wrote:

Attached

 

From: Vikrant More [mailto:vikrant8051@...]
Sent: 28 November 2018 09:10
To: Jamie Mccrae <Jamie.Mccrae@...>
Subject: Re: [Zephyr-devel] [Zephyr-users] Cannot write with i2c NRF52832 (TWI and TWIM)

 

Hi Jamie,

Please share your .config file to me so that I can compare for

what I've missed.

 

Thanks !!

 

On Wed, Nov 28, 2018 at 2:33 PM lairdjm <jamie.mccrae@...> wrote:

Works fine with those lines added to prj.conf

 

[0/1] Re-running CMake...

CMake Deprecation Warning at C:/test/zephyr/cmake/app/boilerplate.cmake:38 (cmake_policy):

  The OLD behavior for policy CMP0000 will be removed from a future version

  of CMake.

 

  The cmake-policies(7) manual explains that the OLD behaviors of all

  policies are deprecated and that a policy should be set to OLD only under

  specific short-term circumstances.  Projects should be ported to the NEW

  behavior and not rely on setting a policy to OLD.

Call Stack (most recent call first):

  CMakeLists.txt:1 (include)

 

 

-- Selected BOARD nrf52840_pca10056

Zephyr version: 1.12.99

Parsing Kconfig tree in C:/test/zephyr//Kconfig

Using C:/test/zephyr/samples/drivers/i2c_fujitsu_fram/build/zephyr/.config as base

fatal: No tags can describe '02addfff50f936af41dfc71ab2d6140ace86f455'.

Try --always, or create some tags.

-- Generating zephyr/include/generated/generated_dts_board.h

-- Cache files will be written to: C:\Users\jamie.mccrae\AppData\Local/.cache/zephyr

-- Configuring done

-- Generating done

-- Build files have been written to: C:/test/zephyr/samples/drivers/i2c_fujitsu_fram/build

[129/134] Linking C executable zephyr\zephyr_prebuilt.elf

Memory region         Used Size  Region Size  %age Used

           FLASH:       48292 B         1 MB      4.61%

            SRAM:       11220 B       256 KB      4.28%

        IDT_LIST:         136 B         2 KB      6.64%

[134/134] Linking C executable zephyr\zephyr.elf

 


Re: cmake application project architecture

Sigvart Hovland
 

Maybe adding

target_link_libraries(DL PRIVATE zephyr_interface)

To your 2nd CMake file  could help?

 

From: devel@... [mailto:devel@...] On Behalf Of Florian Fouillet
Sent: Tuesday, November 27, 2018 9:53 PM
To: devel@...
Subject: [Zephyr-devel] cmake application project architecture

 

Hi everyone,

 

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP.

 

I want to create my own application using cmake as recommended by the documentation.

 

However I don’t want to put everything in one CMakeLists.txt. I want to break down my project into libraries (multiple CMakeLists.txt).

 

Do you know if there is any documentation talking about that?

 

My top CMakeLists looks like that:

 

cmake_minimum_required(VERSION 3.8.2)

 

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)

project(NONE)

 

 

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/DataLinkLayer

${CMAKE_CURRENT_SOURCE_DIR}/build/${BOARD}/DataLinkLayer)

 

target_sources(app PRIVATE src/main.c)

 

target_link_libraries(app

PRIVATE DL

)

 

 

And my second CMakeLists (under the folder DataLinkLayer) looks like that:

 

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

 

add_library(DL src/DataLinkInterface.c)

 

target_include_directories(DL

INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Interface)

 

 

 

The issue is I can include the boilerplate.cmake in only one CMakeLists.txt otherwise It’s not working, But, the second CmakeLists doesn’t know the zephyr library..

 

I tried to add: include_directories(/home/user/zephyr/include) in the second CMakeLists but it is not enough. Do you know what should I do?

 

 

Thank you,

 


Re: [Zephyr-users] Cannot write with i2c NRF52832 (TWI and TWIM)

lairdjm
 

Works fine with those lines added to prj.conf

 

[0/1] Re-running CMake...

CMake Deprecation Warning at C:/test/zephyr/cmake/app/boilerplate.cmake:38 (cmake_policy):

  The OLD behavior for policy CMP0000 will be removed from a future version

  of CMake.

 

  The cmake-policies(7) manual explains that the OLD behaviors of all

  policies are deprecated and that a policy should be set to OLD only under

  specific short-term circumstances.  Projects should be ported to the NEW

  behavior and not rely on setting a policy to OLD.

Call Stack (most recent call first):

  CMakeLists.txt:1 (include)

 

 

-- Selected BOARD nrf52840_pca10056

Zephyr version: 1.12.99

Parsing Kconfig tree in C:/test/zephyr//Kconfig

Using C:/test/zephyr/samples/drivers/i2c_fujitsu_fram/build/zephyr/.config as base

fatal: No tags can describe '02addfff50f936af41dfc71ab2d6140ace86f455'.

Try --always, or create some tags.

-- Generating zephyr/include/generated/generated_dts_board.h

-- Cache files will be written to: C:\Users\jamie.mccrae\AppData\Local/.cache/zephyr

-- Configuring done

-- Generating done

-- Build files have been written to: C:/test/zephyr/samples/drivers/i2c_fujitsu_fram/build

[129/134] Linking C executable zephyr\zephyr_prebuilt.elf

Memory region         Used Size  Region Size  %age Used

           FLASH:       48292 B         1 MB      4.61%

            SRAM:       11220 B       256 KB      4.28%

        IDT_LIST:         136 B         2 KB      6.64%

[134/134] Linking C executable zephyr\zephyr.elf

 


Re: [Zephyr-users] Cannot write with i2c NRF52832 (TWI and TWIM)

lairdjm
 

Run ninja menuconfig, go through the settings and set the various I2C options up then it should build.


Re: [Zephyr-users] Cannot write with i2c NRF52832 (TWI and TWIM)

vikrant8051 <vikrant8051@...>
 

Hi Rodrigo,
Currently trying to build zephyr/samples/drivers/i2c_fujitsu_fram/ demo eg.
to test i2c for nRF52840_pca10056.

As per your previous email, I added following things in prj.conf

CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_I2C_0_NRF_TWI=y
CONFIG_I2C_INIT_PRIORITY=60
CONFIG_I2C_0=y

But still getting following error,

../src/main.c:16:17: error: ‘CONFIG_I2C_0_NAME’ undeclared (first use in this function)
 #define I2C_DEV CONFIG_I2C_0_NAME
                 ^
../src/main.c:84:31: note: in expansion of macro ‘I2C_DEV’
  i2c_dev = device_get_binding(I2C_DEV);
                               ^~~~~~~
../src/main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
 #define I2C_DEV CONFIG_I2C_0_NAME
                 ^
../src/main.c:84:31: note: in expansion of macro ‘I2C_DEV’
  i2c_dev = device_get_binding(I2C_DEV);
                               ^~~~~~~
[19/141] Building C object zephyr/CMakeFiles/zephyr.dir/lib/mempool/mempool.c.obj
ninja: build stopped: subcommand failed.

Please help me to sort out this issue.

Thank You !!

On Wed, Oct 24, 2018 at 2:01 AM Rodrigo Peixoto <rodrigopex@...> wrote:
Hi,
I am trying to use the i2c on my custom board. I can read data from the devices, but (oddly) I cannot write to any of the 3 devices "attached" to the i2c line. I am using SDA on pin P0.06 and SCL on pin P0.07. Any clue? I have already spent a lot of time trying to fix this and nothing seems to work in this direction. 

Zephyr version: 1.13

i2c configs:
prj file (begin)
...
CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_I2C_0_NRF_TWI=y
CONFIG_I2C_INIT_PRIORITY=60
CONFIG_SYS_LOG_I2C_LEVEL=4
CONFIG_I2C_0=y
...
prj file (end)

board.dts (begin)
...
&i2c0 {
status = "ok";
sda-pin = <6>;
scl-pin = <7>;
};
...
board.dts (end)

I am using the commands like: 
error = i2c_burst_read(i2c_dev, ACC_I2C_ADDR, reg, &temp, 1);
error = i2c_burst_read16(i2c_dev, ADE_I2C_ADDR, reg, &buf, 4);

error = i2c_burst_write(i2c_dev, ACC_I2C_ADDR, reg, &setup, 1);
error = i2c_burst_write16(i2c_dev, ADE_I2C_ADDR, reg, &buf, 3);

All the reading commands work and the writing ones do not show an error and seem to make no effect.  


Thank you.
Best regards,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex



Re: Leds_demo on nrf52840 #nrf52832 #zephyrbluetoothmesh

frv
 

Hi Akash,

Maybe have also a look at this example:
https://docs.zephyrproject.org/1.13.0/samples/boards/nrf52/mesh/onoff-app/README.html

Best regards,
Frank


uart hardware flow control problem of nrf52_pca10040 #uart #nrf52832

icephyr
 

Hi guys,
     I met a problem here and hop anyone can help. Thanks.

     I enable hardware control in menuconfig, build a firmware of hci_uart sample and burn the firmware into nrf52_pca10040 (nrf52832), 
(top menu) → Device Drivers → Serial Drivers → nRF UART nrfx drivers
                                                                     Zephyr Kernel Configuration
[*] UART Port 0 Driver type (nRF UART 0)  --->
[*] Enable interrupt support on port 0
[ ] Enable parity bit
[*] Enable flow control
 
and then connect it  with my NXP board via uart, tx rx rts cts,
but when I attach the ble with command hciattach, it prints time out and seems the uart cannot communicate.
root~# hciattach /dev/ttymxc2 any 115200
Device setup complete
root:~# Bluetooth: hci0 command 0x1003 tx timeout
root:~# Bluetooth: hci0 command 0x1001 tx timeout
root:~# Bluetooth: hci0 command 0x1009 tx timeout
So I wonder if the hardware flow control works fine with nrf52832 or zephyr ? Or maybe my way to enable hardware flow control is wrong ?

By the way, is there any problems that we use software flow control instead of hardware flow control when  the baudrate of uart is 1M ?

Thanks if someone can give me any advice.


cmake application project architecture

Florian Fouillet <Florian.Fouillet@...>
 

Hi everyone,

 

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP.

 

I want to create my own application using cmake as recommended by the documentation.

 

However I don’t want to put everything in one CMakeLists.txt. I want to break down my project into libraries (multiple CMakeLists.txt).

 

Do you know if there is any documentation talking about that?

 

My top CMakeLists looks like that:

 

cmake_minimum_required(VERSION 3.8.2)

 

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)

project(NONE)

 

 

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/DataLinkLayer

${CMAKE_CURRENT_SOURCE_DIR}/build/${BOARD}/DataLinkLayer)

 

target_sources(app PRIVATE src/main.c)

 

target_link_libraries(app

PRIVATE DL

)

 

 

And my second CMakeLists (under the folder DataLinkLayer) looks like that:

 

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

 

add_library(DL src/DataLinkInterface.c)

 

target_include_directories(DL

INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Interface)

 

 

 

The issue is I can include the boilerplate.cmake in only one CMakeLists.txt otherwise It’s not working, But, the second CmakeLists doesn’t know the zephyr library..

 

I tried to add: include_directories(/home/user/zephyr/include) in the second CMakeLists but it is not enough. Do you know what should I do?

 

 

Thank you,

 

2561 - 2580 of 8037