Date   

Re: cmake is not recognizing board variable set in CMakeLists.txt

Marti Bolivar <marti@...>
 

On Tue, Sep 18, 2018 at 4:04 AM Sathishkumar Duraisamy
<bewithsathish@gmail.com> wrote:


On Tue, Sep 18, 2018 at 3:29 PM, Sathishkumar Duraisamy <bewithsathish@gmail.com> wrote:

Hi all,

I am Sathishkumar. I am experimenting with zephyr and learning to contribute to it. I am coming form Linux and feels home with kconfig, dts, etc.

As per the application primer, I have set(BOARD qemu_cortex_m3) in CMakeLists.txt. But cmake complaints :

BOARD is not being defined on the CMake command-line in the environment or
by the app.

Are this expected?

It seems set(BOARD qemu_cortex_m3) has to be in the beginning of the file after cmake version. It works.
The important thing is it must be set before you include the boilerplate file.



Regards,
Sathishkumar D
https://sathishscripts.ccom



--
Regards,
Sathishkumar D


Re: cmake is not recognizing board variable set in CMakeLists.txt

Sathishkumar Duraisamy <bewithsathish@...>
 


On Tue, Sep 18, 2018 at 3:29 PM, Sathishkumar Duraisamy <bewithsathish@...> wrote:
Hi all,

I am Sathishkumar. I am experimenting with zephyr and learning to contribute to it. I am coming form Linux and feels home with kconfig, dts, etc.

As per the application primer, I have set(BOARD qemu_cortex_m3)  in CMakeLists.txt. But cmake complaints :

 BOARD is not being defined on the CMake command-line in the environment or
  by the app.

Are this expected?

It seems set(BOARD qemu_cortex_m3) has to be in the beginning of the file after cmake version. It works. 

Regards,
Sathishkumar D




--
Regards,
Sathishkumar D


cmake is not recognizing board variable set in CMakeLists.txt

Sathishkumar Duraisamy <bewithsathish@...>
 

Hi all,

I am Sathishkumar. I am experimenting with zephyr and learning to contribute to it. I am coming form Linux and feels home with kconfig, dts, etc.

As per the application primer, I have set(BOARD qemu_cortex_m3)  in CMakeLists.txt. But cmake complaints :

 BOARD is not being defined on the CMake command-line in the environment or
  by the app.

Are this expected?

Regards,
Sathishkumar D


Re: MPU fault while testing Bluetooth Mesh Sample demos

Jiří Kubias <jiri.kubias@...>
 

Hi,
last night I have discovered that I have messed up variables and I have tried to assign value to constant variable -> that is the reason why I have received the MPU fault. 

Best regards, 
Jiri

po 17. 9. 2018 v 16:29 odesílatel Jiří Kubias <jiri.kubias@...> napsal:

Hi,
In my case the MPU falut was stable. But in your case it looks like some race condition issue.

Try to reorganise the initialisation or add some delays.

Regards Jiri



Dne po 17. 9. 2018 15:39 uživatel Vikrant More <vikrant8051@...> napsal:
Hi Jiri,
After replying to your email, I once again started testing thoroughly.
And yes, once again I got MPU fault.

Regards,
Vikrant

On Mon, Sep 17, 2018 at 6:30 PM vikrant8051 <vikrant8051@...> wrote:
HI Jiri,
After latest sync with master, I've not faced MPU FAULT issue
while testing. But it could be there. With v1.13, it could be suddenly
pops-up without any reason (as a app developer)

Thanks for linking your issue with this mailing list. Hope Zephyr
core developers will resolve it.

Regards,
vikrant



On Mon, Sep 17, 2018 at 12:37 PM Jiří Kubias <jiri.kubias@...> wrote:
Hi,
have you found a solution? Few days ago I have reported similar problem with MPU fault but with Atmel (Microchip) SAME70 chip. It is cased by binding DMA. 

    dev_cfg->dev_dma = device_get_binding(CONFIG_SPI_SAM_DMA_NAME);
if (!dev_cfg->dev_dma) {
SYS_LOG_ERR("%s device not found", CONFIG_SPI_SAM_DMA_NAME);
return -ENODEV;
}


and the console output  is

***** MPU FAULT *****
 Data Access Violation
 MMFAR Address: 0x412198
***** Hardware exception *****
Current thread ID = 0x204024b4
Faulting instruction address = 0x40e376
Fatal fault in essential thread! Spinning...


So far I didnt solved the issue, but I didnt had a much time to debug it. 

Best regards, 
Jiri



2018-09-14 12:33 GMT+02:00 vikrant8051 <vikrant8051@...>:
Hi Carles,
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Did you run addr2line in 0x20001c5c?


***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x20001884                                                                                                   
Faulting instruction address = 0x20001c88                                                                                        
Fatal fault in ISR! Spinning...


1)

/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


&


/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


Both returns -> :? ...... with zephyr-SDK


2)

I also tried to compile the App using latest gcc-arm-none-eabi-7-2018-q2


2.1)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


o/p -> isr_tables.c:?


2.2)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


o/p -> /home/vikrant/zephyr/kernel/init.c:80

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Have you tried increasing stack sizes?


Yes.

CONFIG_MAIN_STACK_SIZE=512 ....to 1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 ....to 4096


But still getting MPU Fault in case of Board executing BT Mesh Servers.


On Fri, Sep 14, 2018 at 3:31 PM Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Did you run addr2line in 0x20001c5c?

Have you tried increasing stack sizes?

 

Carles

 

From: devel@... <devel@...> On Behalf Of vikrant8051
Sent: 14 September 2018 11:48
To: devel@...; users@...
Subject: Re: [Zephyr-devel] MPU fault while testing Bluetooth Mesh Sample demos

 

Hi,

 

FYI,

With v1.12.99 I'm mot facing any MPU FAULT issue (while testing for #onoff_level_lighting_vnd_app)

It has last commit -> ba6763a187a347cfc825a2bece78e7d1ef28772d

 

That means something after it has changed the things bcz of that we are getting

MPU FAULT.

 

Thank You !!

 

On Wed, Sep 5, 2018 at 10:50 AM vikrant8051 <vikrant8051@...> wrote:

Hi,

I'm getting following MPU fault while testing with samples for Bluetooth Mesh . This issue has started after syncing with master branch.

 

***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x2000188c                                                                                                   
Faulting instruction address = 0x20001c5c                                                                                        
Fatal fault in ISR! Spinning...

 

 

Thank You !!

 

 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================



--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Re: MPU fault while testing Bluetooth Mesh Sample demos

Jiří Kubias <jiri.kubias@...>
 

Hi,
In my case the MPU falut was stable. But in your case it looks like some race condition issue.

Try to reorganise the initialisation or add some delays.

Regards Jiri



Dne po 17. 9. 2018 15:39 uživatel Vikrant More <vikrant8051@...> napsal:

Hi Jiri,
After replying to your email, I once again started testing thoroughly.
And yes, once again I got MPU fault.

Regards,
Vikrant

On Mon, Sep 17, 2018 at 6:30 PM vikrant8051 <vikrant8051@...> wrote:
HI Jiri,
After latest sync with master, I've not faced MPU FAULT issue
while testing. But it could be there. With v1.13, it could be suddenly
pops-up without any reason (as a app developer)

Thanks for linking your issue with this mailing list. Hope Zephyr
core developers will resolve it.

Regards,
vikrant



On Mon, Sep 17, 2018 at 12:37 PM Jiří Kubias <jiri.kubias@...> wrote:
Hi,
have you found a solution? Few days ago I have reported similar problem with MPU fault but with Atmel (Microchip) SAME70 chip. It is cased by binding DMA. 

    dev_cfg->dev_dma = device_get_binding(CONFIG_SPI_SAM_DMA_NAME);
if (!dev_cfg->dev_dma) {
SYS_LOG_ERR("%s device not found", CONFIG_SPI_SAM_DMA_NAME);
return -ENODEV;
}


and the console output  is

***** MPU FAULT *****
 Data Access Violation
 MMFAR Address: 0x412198
***** Hardware exception *****
Current thread ID = 0x204024b4
Faulting instruction address = 0x40e376
Fatal fault in essential thread! Spinning...


So far I didnt solved the issue, but I didnt had a much time to debug it. 

Best regards, 
Jiri



2018-09-14 12:33 GMT+02:00 vikrant8051 <vikrant8051@...>:
Hi Carles,
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Did you run addr2line in 0x20001c5c?


***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x20001884                                                                                                   
Faulting instruction address = 0x20001c88                                                                                        
Fatal fault in ISR! Spinning...


1)

/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


&


/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


Both returns -> :? ...... with zephyr-SDK


2)

I also tried to compile the App using latest gcc-arm-none-eabi-7-2018-q2


2.1)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


o/p -> isr_tables.c:?


2.2)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


o/p -> /home/vikrant/zephyr/kernel/init.c:80

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Have you tried increasing stack sizes?


Yes.

CONFIG_MAIN_STACK_SIZE=512 ....to 1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 ....to 4096


But still getting MPU Fault in case of Board executing BT Mesh Servers.


On Fri, Sep 14, 2018 at 3:31 PM Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Did you run addr2line in 0x20001c5c?

Have you tried increasing stack sizes?

 

Carles

 

From: devel@... <devel@...> On Behalf Of vikrant8051
Sent: 14 September 2018 11:48
To: devel@...; users@...
Subject: Re: [Zephyr-devel] MPU fault while testing Bluetooth Mesh Sample demos

 

Hi,

 

FYI,

With v1.12.99 I'm mot facing any MPU FAULT issue (while testing for #onoff_level_lighting_vnd_app)

It has last commit -> ba6763a187a347cfc825a2bece78e7d1ef28772d

 

That means something after it has changed the things bcz of that we are getting

MPU FAULT.

 

Thank You !!

 

On Wed, Sep 5, 2018 at 10:50 AM vikrant8051 <vikrant8051@...> wrote:

Hi,

I'm getting following MPU fault while testing with samples for Bluetooth Mesh . This issue has started after syncing with master branch.

 

***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x2000188c                                                                                                   
Faulting instruction address = 0x20001c5c                                                                                        
Fatal fault in ISR! Spinning...

 

 

Thank You !!

 

 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Re: MPU fault while testing Bluetooth Mesh Sample demos

vikrant8051 <vikrant8051@...>
 

Hi Jiri,
After replying to your email, I once again started testing thoroughly.
And yes, once again I got MPU fault.

Regards,
Vikrant


On Mon, Sep 17, 2018 at 6:30 PM vikrant8051 <vikrant8051@...> wrote:
HI Jiri,
After latest sync with master, I've not faced MPU FAULT issue
while testing. But it could be there. With v1.13, it could be suddenly
pops-up without any reason (as a app developer)

Thanks for linking your issue with this mailing list. Hope Zephyr
core developers will resolve it.

Regards,
vikrant



On Mon, Sep 17, 2018 at 12:37 PM Jiří Kubias <jiri.kubias@...> wrote:
Hi,
have you found a solution? Few days ago I have reported similar problem with MPU fault but with Atmel (Microchip) SAME70 chip. It is cased by binding DMA. 

    dev_cfg->dev_dma = device_get_binding(CONFIG_SPI_SAM_DMA_NAME);
if (!dev_cfg->dev_dma) {
SYS_LOG_ERR("%s device not found", CONFIG_SPI_SAM_DMA_NAME);
return -ENODEV;
}


and the console output  is

***** MPU FAULT *****
 Data Access Violation
 MMFAR Address: 0x412198
***** Hardware exception *****
Current thread ID = 0x204024b4
Faulting instruction address = 0x40e376
Fatal fault in essential thread! Spinning...


So far I didnt solved the issue, but I didnt had a much time to debug it. 

Best regards, 
Jiri



2018-09-14 12:33 GMT+02:00 vikrant8051 <vikrant8051@...>:
Hi Carles,
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Did you run addr2line in 0x20001c5c?


***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x20001884                                                                                                   
Faulting instruction address = 0x20001c88                                                                                        
Fatal fault in ISR! Spinning...


1)

/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


&


/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


Both returns -> :? ...... with zephyr-SDK


2)

I also tried to compile the App using latest gcc-arm-none-eabi-7-2018-q2


2.1)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


o/p -> isr_tables.c:?


2.2)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


o/p -> /home/vikrant/zephyr/kernel/init.c:80

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Have you tried increasing stack sizes?


Yes.

CONFIG_MAIN_STACK_SIZE=512 ....to 1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 ....to 4096


But still getting MPU Fault in case of Board executing BT Mesh Servers.


On Fri, Sep 14, 2018 at 3:31 PM Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Did you run addr2line in 0x20001c5c?

Have you tried increasing stack sizes?

 

Carles

 

From: devel@... <devel@...> On Behalf Of vikrant8051
Sent: 14 September 2018 11:48
To: devel@...; users@...
Subject: Re: [Zephyr-devel] MPU fault while testing Bluetooth Mesh Sample demos

 

Hi,

 

FYI,

With v1.12.99 I'm mot facing any MPU FAULT issue (while testing for #onoff_level_lighting_vnd_app)

It has last commit -> ba6763a187a347cfc825a2bece78e7d1ef28772d

 

That means something after it has changed the things bcz of that we are getting

MPU FAULT.

 

Thank You !!

 

On Wed, Sep 5, 2018 at 10:50 AM vikrant8051 <vikrant8051@...> wrote:

Hi,

I'm getting following MPU fault while testing with samples for Bluetooth Mesh . This issue has started after syncing with master branch.

 

***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x2000188c                                                                                                   
Faulting instruction address = 0x20001c5c                                                                                        
Fatal fault in ISR! Spinning...

 

 

Thank You !!

 

 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Re: SPI driver development

Jiří Kubias <jiri.kubias@...>
 

Hi Vincent,
Im open minded 8-). I have implemented SPI driver with polling - seems to be working fine for moth ways. But configuration stuff need some recheck and only one CS is supported.  I have tried to implement the DMA (I can compile it) into my driver but it fails when I bind the DMA - I have received MPU protection fault. Unfortunately there not many examples with DMA so it is not so simply to implement it... In another thread was reported also MPU fault with v1.13 which Im using. But it seems to be fixed in GIT so I have to recheck it again to see if the problem is still there or not.  I would like to finish it this week but Im sharing my time with another projects.... 

I will also try to implement the flash driver - but I didnt started yet.

Regards, 
Jiri


2018-09-17 15:07 GMT+02:00 <vincent@...>:

Hi Jiri, 

I'm was planning a SPI driver for the SAM4S and later on the SAMe70. 
I have sufficient boards to test the SPI driver, with displays, flash, IMU and transceivers on them to push its boundries. I can add the IRQ and DMA also, as I was using both with another RTOS before. 

Perhaps we can combine effort for this. 

Kind regards,
Vincent 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Re: SPI driver development

Vincent - VLoTech
 

Hi Jiri, 

I'm was planning a SPI driver for the SAM4S and later on the SAMe70. 
I have sufficient boards to test the SPI driver, with displays, flash, IMU and transceivers on them to push its boundries. I can add the IRQ and DMA also, as I was using both with another RTOS before. 

Perhaps we can combine effort for this. 

Kind regards,
Vincent 


Re: MPU fault while testing Bluetooth Mesh Sample demos

vikrant8051 <vikrant8051@...>
 

HI Jiri,
After latest sync with master, I've not faced MPU FAULT issue
while testing. But it could be there. With v1.13, it could be suddenly
pops-up without any reason (as a app developer)

Thanks for linking your issue with this mailing list. Hope Zephyr
core developers will resolve it.

Regards,
vikrant



On Mon, Sep 17, 2018 at 12:37 PM Jiří Kubias <jiri.kubias@...> wrote:
Hi,
have you found a solution? Few days ago I have reported similar problem with MPU fault but with Atmel (Microchip) SAME70 chip. It is cased by binding DMA. 

    dev_cfg->dev_dma = device_get_binding(CONFIG_SPI_SAM_DMA_NAME);
if (!dev_cfg->dev_dma) {
SYS_LOG_ERR("%s device not found", CONFIG_SPI_SAM_DMA_NAME);
return -ENODEV;
}


and the console output  is

***** MPU FAULT *****
 Data Access Violation
 MMFAR Address: 0x412198
***** Hardware exception *****
Current thread ID = 0x204024b4
Faulting instruction address = 0x40e376
Fatal fault in essential thread! Spinning...


So far I didnt solved the issue, but I didnt had a much time to debug it. 

Best regards, 
Jiri



2018-09-14 12:33 GMT+02:00 vikrant8051 <vikrant8051@...>:
Hi Carles,
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Did you run addr2line in 0x20001c5c?


***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x20001884                                                                                                   
Faulting instruction address = 0x20001c88                                                                                        
Fatal fault in ISR! Spinning...


1)

/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


&


/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


Both returns -> :? ...... with zephyr-SDK


2)

I also tried to compile the App using latest gcc-arm-none-eabi-7-2018-q2


2.1)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


o/p -> isr_tables.c:?


2.2)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


o/p -> /home/vikrant/zephyr/kernel/init.c:80

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Have you tried increasing stack sizes?


Yes.

CONFIG_MAIN_STACK_SIZE=512 ....to 1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 ....to 4096


But still getting MPU Fault in case of Board executing BT Mesh Servers.


On Fri, Sep 14, 2018 at 3:31 PM Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Did you run addr2line in 0x20001c5c?

Have you tried increasing stack sizes?

 

Carles

 

From: devel@... <devel@...> On Behalf Of vikrant8051
Sent: 14 September 2018 11:48
To: devel@...; users@...
Subject: Re: [Zephyr-devel] MPU fault while testing Bluetooth Mesh Sample demos

 

Hi,

 

FYI,

With v1.12.99 I'm mot facing any MPU FAULT issue (while testing for #onoff_level_lighting_vnd_app)

It has last commit -> ba6763a187a347cfc825a2bece78e7d1ef28772d

 

That means something after it has changed the things bcz of that we are getting

MPU FAULT.

 

Thank You !!

 

On Wed, Sep 5, 2018 at 10:50 AM vikrant8051 <vikrant8051@...> wrote:

Hi,

I'm getting following MPU fault while testing with samples for Bluetooth Mesh . This issue has started after syncing with master branch.

 

***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x2000188c                                                                                                   
Faulting instruction address = 0x20001c5c                                                                                        
Fatal fault in ISR! Spinning...

 

 

Thank You !!

 

 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Looking for new maintainer for RPL

Ravi kumar Veeramally
 

Hello,

RPL (mesh routing) technology over 802.15.4 has been supported in Zephyr
from the beginning. Originally it was taken from Contiki OS and modified
according to Zephyr network buffer management.

While developing sample RPL applications like rpl_border_router and
rpl_node, we fixed various issues in RPL base code. No new RPL features
nor bug fixes from upstream Contiki have been merged after that.

Upstream Contiki has continued development and is now quite far from
Zephyr RPL implementation. For example Contiki supports non-storing mode
which Zephyr does not support.

There is a lot of re-engineering work going on in Zephyr network stack
right now. Like network buffer changes and socket based support for
application level protocols.

Due to on-going efforts for network stack re-engineering, RPL needs also
modifications. At our side, current priorities are are different from
supporting WPAN family of IoT enablers.

Therefore, we are seeking new maintainers and stakeholders to support
RPL in Zephyr. If no new maintainers are found, the current plan is to 
deprecate RPL code in near future.

Thanks in advance,
Ravi.


sensor.h "error: invalid conversion from ..."

Paul ADAM <paul.adam@...>
 

Hello,
when I am compiling sensor.h in a cpp file, I have following error 5 times:

/home/.../zephyr/include/sensor.h: In function ‘int sensor_trigger_set(device*, sensor_trigger*, sensor_trigger_handler_t)’:
/home/.../zephyr/include/sensor.h:339:45: error: invalid conversion from ‘const void*’ to ‘const sensor_driver_api*’ [-fpermissive]
  const struct sensor_driver_api *api = dev->driver_api;
                                        ~~~~~^~~~~~~~~~

The solution (if I do not want to let the compiler be more permissive) is to change the code like this:

    const struct sensor_driver_api *api = ( const struct sensor_driver_api * ) dev->driver_api;

What do you think about? Is there another solution?
Someone told me that this is required by MISRA-C standard. Do you confirm?
Should I do a git pull request? Or can someone modify the code in the repository?

Best regards
Paul


Re: sensor.h "error: invalid conversion from ..."

Mark Ruvald Pedersen (MPED)
 

FYI, Zephyr is not MISRA-C compliant as Zephyr currently uses several GNU C extensions.
Some little work is ongoing to at least make Zephyr more C99 compliant.

MISRA-C Rule 1 (required): "All code shall conform to ISO 9899 standard C, with no extensions permitted."

Regards, Mark


From: devel@... [devel@...] on behalf of Paul ADAM [paul.adam@...]
Sent: Monday, September 17, 2018 11:18
To: Zephyr-devel@...
Subject: [Zephyr-devel] sensor.h "error: invalid conversion from ..."

Hello,
when I am compiling sensor.h in a cpp file, I have following error 5 times:

/home/.../zephyr/include/sensor.h: In function ‘int sensor_trigger_set(device*, sensor_trigger*, sensor_trigger_handler_t)’:
/home/.../zephyr/include/sensor.h:339:45: error: invalid conversion from ‘const void*’ to ‘const sensor_driver_api*’ [-fpermissive]
  const struct sensor_driver_api *api = dev->driver_api;
                                        ~~~~~^~~~~~~~~~

The solution (if I do not want to let the compiler be more permissive) is to change the code like this:

    const struct sensor_driver_api *api = ( const struct sensor_driver_api * ) dev->driver_api;

What do you think about? Is there another solution?
I was told that this explicit conversion is required by MISRA-C standard. Do you confirm?
Should I do a git pull request? Or can someone modify the code in the repository?

Best regards
Paul


sensor.h "error: invalid conversion from ..."

Paul ADAM <paul.adam@...>
 

Hello,
when I am compiling sensor.h in a cpp file, I have following error 5 times:

/home/.../zephyr/include/sensor.h: In function ‘int sensor_trigger_set(device*, sensor_trigger*, sensor_trigger_handler_t)’:
/home/.../zephyr/include/sensor.h:339:45: error: invalid conversion from ‘const void*’ to ‘const sensor_driver_api*’ [-fpermissive]
  const struct sensor_driver_api *api = dev->driver_api;
                                        ~~~~~^~~~~~~~~~

The solution (if I do not want to let the compiler be more permissive) is to change the code like this:

    const struct sensor_driver_api *api = ( const struct sensor_driver_api * ) dev->driver_api;

What do you think about? Is there another solution?
I was told that this explicit conversion is required by MISRA-C standard. Do you confirm?
Should I do a git pull request? Or can someone modify the code in the repository?

Best regards
Paul


Re: MISRA-C and Zephyr

Jiří Kubias <jiri.kubias@...>
 

Hi,
I have one practical question regarding MISRA-C standard. Where I can get the standard as a regular coder? I can buy one for £15 + VAT, but I dont thing that every body want to buy it. Is there any public description of this standard? There are many of us who never met with MISRA standard.

Regards,
 Jiri Kubias 

2018-09-16 23:20 GMT+02:00 Flavio Ceolin <flavio.ceolin@...>:

Hi Reto,

> On 09/15/2018 06:07 AM, Kumar Gala wrote:
>> Not support MISRA directly, but I assume we can implement the MISRA checks either by configuring specific rules of cppcheck or implementing our own.  If there’s some MISRA checker out there, even better.
>
> Cppcheck has some MISRAC C 2012 checks for a while now [1].

Yeah, last time I've checked it was requiring the MISRA-C standard
converted to a pure text. The problem is that we can distribute
MISRA-C. Though, I'll check if the standard is only required for
pretty-print the errors.

>
> Also, it is quite simple to add such checks to clang-tidy [2]. I am no
> longer working in a safety relevant area, so I did not push this pet
> project in the past, but extending it for Zephyrs needs would probably
> be a good reason to do so.

Good to know :)

>
> [1] http://cppcheck.net/misra.php
> [2] https://github.com/rettichschnidi/clang-tidy-misra
>
> Kind regards,
> Reto
>
>
>

Regards,
Flavio Ceolin






--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Re: MPU fault while testing Bluetooth Mesh Sample demos

Jiří Kubias <jiri.kubias@...>
 

Hi,
have you found a solution? Few days ago I have reported similar problem with MPU fault but with Atmel (Microchip) SAME70 chip. It is cased by binding DMA. 

    dev_cfg->dev_dma = device_get_binding(CONFIG_SPI_SAM_DMA_NAME);
if (!dev_cfg->dev_dma) {
SYS_LOG_ERR("%s device not found", CONFIG_SPI_SAM_DMA_NAME);
return -ENODEV;
}


and the console output  is

***** MPU FAULT *****
 Data Access Violation
 MMFAR Address: 0x412198
***** Hardware exception *****
Current thread ID = 0x204024b4
Faulting instruction address = 0x40e376
Fatal fault in essential thread! Spinning...


So far I didnt solved the issue, but I didnt had a much time to debug it. 

Best regards, 
Jiri



2018-09-14 12:33 GMT+02:00 vikrant8051 <vikrant8051@...>:

Hi Carles,
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Did you run addr2line in 0x20001c5c?


***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x20001884                                                                                                   
Faulting instruction address = 0x20001c88                                                                                        
Fatal fault in ISR! Spinning...


1)

/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


&


/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-addr2line -e  /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


Both returns -> :? ...... with zephyr-SDK


2)

I also tried to compile the App using latest gcc-arm-none-eabi-7-2018-q2


2.1)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001c88


o/p -> isr_tables.c:?


2.2)

/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-addr2line -e /home/vikrant/zephyr/samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/build/zephyr/zephyr.elf 0x20001884


o/p -> /home/vikrant/zephyr/kernel/init.c:80

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

>> Have you tried increasing stack sizes?


Yes.

CONFIG_MAIN_STACK_SIZE=512 ....to 1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 ....to 4096


But still getting MPU Fault in case of Board executing BT Mesh Servers.


On Fri, Sep 14, 2018 at 3:31 PM Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

Did you run addr2line in 0x20001c5c?

Have you tried increasing stack sizes?

 

Carles

 

From: devel@... <devel@...> On Behalf Of vikrant8051
Sent: 14 September 2018 11:48
To: devel@...; users@...
Subject: Re: [Zephyr-devel] MPU fault while testing Bluetooth Mesh Sample demos

 

Hi,

 

FYI,

With v1.12.99 I'm mot facing any MPU FAULT issue (while testing for #onoff_level_lighting_vnd_app)

It has last commit -> ba6763a187a347cfc825a2bece78e7d1ef28772d

 

That means something after it has changed the things bcz of that we are getting

MPU FAULT.

 

Thank You !!

 

On Wed, Sep 5, 2018 at 10:50 AM vikrant8051 <vikrant8051@...> wrote:

Hi,

I'm getting following MPU fault while testing with samples for Bluetooth Mesh . This issue has started after syncing with master branch.

 

***** MPU FAULT *****                                                                                                            
  Instruction Access Violation                                                                                                   
***** Hardware exception *****                                                                                                   
Current thread ID = 0x2000188c                                                                                                   
Faulting instruction address = 0x20001c5c                                                                                        
Fatal fault in ISR! Spinning...

 

 

Thank You !!

 

 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Re: Application specific MBEDTLS configuration

Flavio Ceolin
 

Hi,

Hi,

On 2018-09-16 12:25, Flavio Ceolin wrote:
HI Aurelien,

Hi all,

I have specific needs for my application and I would therefore like to
provide my own mbedtls config file or extend an existing one. The
existing MBEDTLS_CFG_FILE seems to only be able to use files in the
zephyr source code (as opposed to the app source code). The recently
added generic TLS configuration allow to specific an additional include
file through the TLS_USER_CONFIG_FILE option, but it seems to suffer
from the same issue.

Does anyone have a trick to provide an application specific mbedtls
config file?
Have you tried to pass the absolute path of your header in
MBEDTLS_CFG_FILE ?
Yes, it indeed works that way. That said I don't consider that as a
solution. The value in the Kconfig file comes from the app's prj.conf
and I don't want to hard-code the path there. I would like to be able
to distribute the app that people can then build it against Zephyr, in
the directory they want.
Agree, it's worth to fill an issue regarding this.


Regards,
Aurelien

--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
Regards,
Flavio Ceolin


Re: Application specific MBEDTLS configuration

Aurelien Jarno
 

Hi,

On 2018-09-16 12:25, Flavio Ceolin wrote:
HI Aurelien,

Hi all,

I have specific needs for my application and I would therefore like to
provide my own mbedtls config file or extend an existing one. The
existing MBEDTLS_CFG_FILE seems to only be able to use files in the
zephyr source code (as opposed to the app source code). The recently
added generic TLS configuration allow to specific an additional include
file through the TLS_USER_CONFIG_FILE option, but it seems to suffer
from the same issue.

Does anyone have a trick to provide an application specific mbedtls
config file?
Have you tried to pass the absolute path of your header in
MBEDTLS_CFG_FILE ?
Yes, it indeed works that way. That said I don't consider that as a
solution. The value in the Kconfig file comes from the app's prj.conf
and I don't want to hard-code the path there. I would like to be able
to distribute the app that people can then build it against Zephyr, in
the directory they want.

Regards,
Aurelien

--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net


Re: MISRA-C and Zephyr

Flavio Ceolin
 

Hi Reto,

On 09/15/2018 06:07 AM, Kumar Gala wrote:
Not support MISRA directly, but I assume we can implement the MISRA checks either by configuring specific rules of cppcheck or implementing our own. If there’s some MISRA checker out there, even better.
Cppcheck has some MISRAC C 2012 checks for a while now [1].
Yeah, last time I've checked it was requiring the MISRA-C standard
converted to a pure text. The problem is that we can distribute
MISRA-C. Though, I'll check if the standard is only required for
pretty-print the errors.


Also, it is quite simple to add such checks to clang-tidy [2]. I am no
longer working in a safety relevant area, so I did not push this pet
project in the past, but extending it for Zephyrs needs would probably
be a good reason to do so.
Good to know :)


[1] http://cppcheck.net/misra.php
[2] https://github.com/rettichschnidi/clang-tidy-misra

Kind regards,
Reto


Regards,
Flavio Ceolin


Re: Application specific MBEDTLS configuration

Flavio Ceolin
 

HI Aurelien,

Hi all,

I have specific needs for my application and I would therefore like to
provide my own mbedtls config file or extend an existing one. The
existing MBEDTLS_CFG_FILE seems to only be able to use files in the
zephyr source code (as opposed to the app source code). The recently
added generic TLS configuration allow to specific an additional include
file through the TLS_USER_CONFIG_FILE option, but it seems to suffer
from the same issue.

Does anyone have a trick to provide an application specific mbedtls
config file?
Have you tried to pass the absolute path of your header in
MBEDTLS_CFG_FILE ?


Thanks,
Aurelien

--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net

Regards,
Flavio Ceolin


Re: MISRA-C and Zephyr

Flavio Ceolin
 

Hi Himanshu,

Hello Flavio,

On Fri, Sep 14, 2018 at 11:19:40PM -0700, Flavio ceolin wrote:
Agree, we have to automate it as much as possible. But we can't just wait
have all tools ready to start fixing the issues. Currently there are almost
8k violations on kernel. Any tool we setup will make a lot of noise.

Some rules we will be able to check with coccinelle, but ideally we need a
qualified tool with Misra c support.
Thanks for using Coccinelle for the memset cleanup!

Coccinelle can handle MISRA-C compliance at some extent and it really
depends on the what you wish to accomplish through a coccinelle script.

Some scripts are easy to write, but certainly we can't claim to write
scripts with 0% false positives. It depends upon the problem set and
how well you design a cocci script.
Agree, we'll never put any compliance claim based on Coccinelle, even
because to this *much likely* we have to use a qualified
tool. Nevertheless, there are rules that we can't even check with
Coccinelle. My idea is using Coccinelle as a best effort with other
tools to enforce as much as possible MISRA-C guidelines.

For instance: We planned to remove the unnecessary casts returned by
memory allocating functions *alloc since we know the conversion
from void* and other type is implicit.

https://github.com/torvalds/linux/blob/master/scripts/coccinelle/api/alloc/alloc_cast.cocci

But while working and testing the script, I found some strange code
where the cast was necessary and removing it would be a regression:

drivers/scsi/fnic/fnic_trace.c

<snip>
static unsigned long fnic_trace_buf_p;
...
fnic_trace_buf_p = (unsigned long)vmalloc((trace_max_pages * PAGE_SIZE));
</snip>

And some other case as well, where the cast was required...

Therefore, we removed those cases by embedding a python script into the
coccinelle script(yes, we can embedd python & Ocaml script if required)

What I'm trying to explain is that some cases are easy to handle while some
are disaster to get desired property.

Also, we classify accuracy of the Coccinelle by defining a property
called "Confidence" at the top of the cocci scripts.

Confindence: High --> very rare chances of false postives.
Moderarte --> some chances of false postivies.

We always try to improve the cocci script as much as possible.

If there is any MISRA-C compliant build system then its obviously great.
But if not, then my proposal would be add `coccicheck` to CI and write
cocci scripts to warn.
Yeah, that is really what I had in mind. Currently I'm using coccinelle
where I can but I'm still reviewing the output manually.


For now we have some ideas that we are going to inherit from the
mainline kernel like:

* ARRAY_SIZE: Lots of instances in Zephyr where it is hard-coded rather
than simply using the ARRAY_SIZE helper macro.

* GENMASK: again we could use the helper macro instead of
BIT(3) | BIT(2) | BIT(1) == GENMASK(3,1)

And this GENMASK defintion is defined in:

drivers/dma/dma_stm32f4x.c:#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))

So, we could probably, move the declaration to include/misc/util.h
and use it throroughly on the codebase.

...and few more.

Many of the rules we made for mainline is based on enforcing usage of
available standard APIs and thus avoiding developers to roll-out their
own wrappers. In this way we can enforce new incoming code to adhere to
the Zephyr APIs and prevent any subsequent violations/redundancy.
Good !



https://github.com/zephyrproject-rtos/zephyr/pull/9725

Thanks a lot for you work on coccinelle and Zephyr, I certainly will
ping you with more questions :)

Regards,
Flavio Ceolin

2901 - 2920 of 8033