Date   

Re: sys_dlist_remove: bus fault with CONFIG_NO_OPTIMIZATIONS

Christopher Friedt
 

Hi Maureen / list,

On Mon., Sep. 30, 2019, 11:31 a.m. Christopher Friedt, <chrisfriedt@...> wrote:
Hi Maureen,

On Mon., Sep. 30, 2019, 11:26 a.m. Maureen Helm, <maureen.helm@...> wrote:

Hi Christopher,

It’s possible that a stack overflowed. Kinetis platforms have a “system MPU” instead of the Arm MPU, and memory access violations trigger a bus fault.

That's interesting, because now that I think about it, I did have to disable the MPU to even get to main(). Good catch!

Do you know if Zephyr has a way to instrument stack usage?

I just thought I would follow up on-list in case anyone else has a similar issue.

So I simply enabled

CONFIG_STACK_CANARIES=y

because ARMv7-M supports gcc's stack canaries, and found that the "tx_workq" thread indeed did have a stack overflow.

Great catch Maureen, and thanks for pointing out that the kinetis MPU is not an actual ARM MPU too. I assumed they were the same originally.

Cheers,

C


Re: sys_dlist_remove: bus fault with CONFIG_NO_OPTIMIZATIONS

Christopher Friedt
 

Hi Maureen,

On Mon., Sep. 30, 2019, 11:26 a.m. Maureen Helm, <maureen.helm@...> wrote:

Hi Christopher,

It’s possible that a stack overflowed. Kinetis platforms have a “system MPU” instead of the Arm MPU, and memory access violations trigger a bus fault.

That's interesting, because now that I think about it, I did have to disable the MPU to even get to main(). Good catch!

Do you know if Zephyr has a way to instrument stack usage?

Cheers,

Chris



Re: sys_dlist_remove: bus fault with CONFIG_NO_OPTIMIZATIONS

Maureen Helm
 

Hi Christopher,

It’s possible that a stack overflowed. Kinetis platforms have a “system MPU” instead of the Arm MPU, and memory access violations trigger a bus fault.

 

Maureen

 

From: devel@... <devel@...> On Behalf Of Christopher Friedt via Lists.Zephyrproject.Org
Sent: Monday, September 30, 2019 7:28 AM
To: devel@...
Cc: devel@...
Subject: [Zephyr-devel] sys_dlist_remove: bus fault with CONFIG_NO_OPTIMIZATIONS

 

Hi list,

 

I'm experimenting with Zephyr on the kinetis platform and I am encountering a bus fault while running the "samples/net/sockets/dumb_http_server" example.

 

The bus fault only seems to happen when I have CONFIG_NO_OPTIMIZATIONS=y . And is triggered in sys_dlist_remove().

 

Logs show:

 

initializing network

IPv4 address: xxx.xxx.xxx.xxx

Single-threaded dumb HTTP server waits for a connection on port 8080...

eth_mcux: Enabled 100M full-duplex mode

 

At this point, I can ping the device, but as soon as I run curl or use a browser to open the static page, there is a bus fault (imprecise data bus error)

 

The PC was at sys_dlist_remove and the LR was in sys_dlist_get.

 

I don't have a full stack trace unfortunately because I'm unable to catch this issue with the debugger at present.

 

It's a bit concerning to me that disabling optimizations would result in a bus fault in such a critical path. Potentially related to atomic operations?

 

I haven't yet inspected the sys_dlist*() code yet, but just wanted to probe the list and see if this is a known issue.

 

Any thoughts?

 

 

PS:

 

Maybe some suggestions for the documentation in this sample project:

 

User should add/modify samples/net/sockets/dumb_http_server/prj.conf

 

* CONFIG_NET_CONFIG_MY_IPV4_ADDR

* CONFIG_NET_CONFIG_MY_IPV4_NETMASK

* CONFIG_NET_CONFIG_MY_IPV4_GW


sys_dlist_remove: bus fault with CONFIG_NO_OPTIMIZATIONS

Christopher Friedt
 

Hi list,

I'm experimenting with Zephyr on the kinetis platform and I am encountering a bus fault while running the "samples/net/sockets/dumb_http_server" example.

The bus fault only seems to happen when I have CONFIG_NO_OPTIMIZATIONS=y . And is triggered in sys_dlist_remove().

Logs show:

initializing network
IPv4 address: xxx.xxx.xxx.xxx
Single-threaded dumb HTTP server waits for a connection on port 8080...
eth_mcux: Enabled 100M full-duplex mode

At this point, I can ping the device, but as soon as I run curl or use a browser to open the static page, there is a bus fault (imprecise data bus error)

The PC was at sys_dlist_remove and the LR was in sys_dlist_get.

I don't have a full stack trace unfortunately because I'm unable to catch this issue with the debugger at present.

It's a bit concerning to me that disabling optimizations would result in a bus fault in such a critical path. Potentially related to atomic operations?

I haven't yet inspected the sys_dlist*() code yet, but just wanted to probe the list and see if this is a known issue.

Any thoughts?


PS:

Maybe some suggestions for the documentation in this sample project:

User should add/modify samples/net/sockets/dumb_http_server/prj.conf

* CONFIG_NET_CONFIG_MY_IPV4_ADDR
* CONFIG_NET_CONFIG_MY_IPV4_NETMASK
* CONFIG_NET_CONFIG_MY_IPV4_GW


Cancelled Event: Zephyr Project: Dev Meeting - Thursday, 26 September 2019 #cal-cancelled

devel@lists.zephyrproject.org Calendar <devel@...>
 

Cancelled: Zephyr Project: Dev Meeting

This event has been cancelled.

When:
Thursday, 26 September 2019
8:00am to 9:00am
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/993312203

Organizer: devel@...

Description:
Join Zoom Meeting
https://zoom.us/j/993312203

One tap mobile
+16699006833,,993312203# US (San Jose)
+16465588656,,993312203# US (New York)

Dial by your location
        +1 669 900 6833 US (San Jose)
        +1 646 558 8656 US (New York)
        +1 877 369 0926 US Toll-free
        +1 855 880 1246 US Toll-free
Meeting ID: 993 312 203
Find your local number: https://zoom.us/u/ankEMRagf


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

giriprasad@...
 

Thanks Marc,

I have verified that and it is fine. As mentioned in the previous mails, I am suspecting on the changes that I have made in the file "zephyr/subsys/net/l2/ethernet/ethernet.c". Although, I am not supposed to make changes in that file, I made them for my testing purpose and ping is working only with those changes. Apart from the changes I have mentioned, I haven't done any other changes to the lower layers of Zephyr. I have just done few configurations in the application layer. I am not sure, why enc28j60 is not working directly with Zephyr. Please help me in this regards. Please let me know if more information is needed.

Regards,
Giri


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

Jukka Rissanen
 

Hi Giri,

can you create an issue in github for this. Trying to resolve your issue in mailing list is not very effective.

Cheers,
Jukka


On Thu, 2019-09-26 at 02:19 -0700, giriprasad@... wrote:
But, without those changes, if I am trying to ping the board on which Zephyr is running, it is not responding to ping requests and wireshark capture in this scenario can be found in the attached file. I am unable to figure out where the mistake is happening. I have been trying in different ways but in vain. Is there any suggestions or check points to resolve this issue. Please help...

Thanks & Regards,
Giri Prasad N.
_._,_._,_


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

giriprasad@...
 

But, without those changes, if I am trying to ping the board on which Zephyr is running, it is not responding to ping requests and wireshark capture in this scenario can be found in the attached file. I am unable to figure out where the mistake is happening. I have been trying in different ways but in vain. Is there any suggestions or check points to resolve this issue. Please help...

Thanks & Regards,
Giri Prasad N.


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

Marc Herbert
 

On 24 Sep 2019, at 02:20, giriprasad@... wrote:

Thanks for the reply. I have verified the ufw status and it is inactive. Is it enough to say that firewall is disabled.
It should but might not be enough because ufw is just a user interface. Use "ip[6]tables -L" to verify the actual state.


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

Jukka Rissanen
 

The changes that you do there basically turn off ARP, the end result is that the IPv4 connectivity cannot work properly after this.

Cheers,
Jukka


On Wed, 2019-09-25 at 04:15 -0700, giriprasad@... wrote:
Hi Jukka,

"net iface" is returning a valid mac address. But for my Ethernet to work, I have tweaked Zephyr code. I have posted about it in another topic of this mailing list. Please follow this link https://lists.zephyrproject.org/g/devel/message/6325
Please let me understand the problem I am facing, as mentioned in the above link. I am suspecting that, this is causing the issue. Please help me in this regards.

Thanks & regards,
Giri.


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

giriprasad@...
 

Hi Jukka,

"net iface" is returning a valid mac address. But for my Ethernet to work, I have tweaked Zephyr code. I have posted about it in another topic of this mailing list. Please follow this link https://lists.zephyrproject.org/g/devel/message/6325
Please let me understand the problem I am facing, as mentioned in the above link. I am suspecting that, this is causing the issue. Please help me in this regards.

Thanks & regards,
Giri.


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

Jukka Rissanen
 

Hi Giri,

yes, that is definitely a problem. The destination MAC address should be a valid unicast address. Does you ethernet board have a proper MAC address set to it? You can see the MAC address using "net iface" command in net-shell.

Cheers,
Jukka


On Tue, 2019-09-24 at 05:52 -0700, giriprasad@... wrote:
Hi Jukka,

I have verified the MAC address. Zephyr is sending the [SYN/ACK] packet with destination MAC address as "ff:ff:ff:ff:ff:ff", which is a broadcast address. Does this causing my ubuntu to not receive the packets?

Thanks & Regards,
Giri


clarification Zephyr kernel type

Khalid Talash <khalid.talash@...>
 

Hello,

I am currently writing a paper comparing different RTOSs. I want to compare the kernel architecture types of the different RTOSs but Zephyrs kernel confuses me a little bit. I get from literature and wikipedia that basically kernel types are monolithic or microkernel. From your visualization of system architecture on your security overview page I would guess Zephyr uses microkernel type because functionalities like file systems and IPC are seperate from Kernel. But your documentation also says Zephyr uses unified kernel which on the other hand sounds like monolithic to me.
Could you please which classification of kernel type (monolithic or microkernel) fits Zephyr? This would help me so much.

Thanks in advance.

Sincerely
Khalid Talash


Upcoming Event: Zephyr Project: APIs - Tue, 09/24/2019 9:00am-10:00am, Please RSVP #cal-reminder

devel@lists.zephyrproject.org Calendar <devel@...>
 

Reminder: Zephyr Project: APIs

When: Tuesday, 24 September 2019, 9:00am to 10:00am, (GMT-07:00) America/Los Angeles

Where:https://zoom.us/j/177647878

An RSVP is requested. Click here to RSVP

Organizer: devel@...

Description: Join from PC, Mac, Linux, iOS or Android: https://zoom.us/j/177647878

Or iPhone one-tap :
    US: +16465588656,,177647878# or +16699006833,,177647878# 
Or Telephone:
    Dial(for higher quality, dial a number based on your current location): 
        US: +1 646 558 8656 or +1 669 900 6833 or +1 855 880 1246 (Toll Free) or +1 877 369 0926 (Toll Free)
    Meeting ID: 177 647 878
    International numbers available: https://zoom.us/zoomconference?m=ioAR9GK1OE5LkN1ojt-heTCl7yPcJrhY


 Live meeting minutes: https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit?usp=sharing


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

giriprasad@...
 

Hi Jukka,

I have verified the MAC address. Zephyr is sending the [SYN/ACK] packet with destination MAC address as "ff:ff:ff:ff:ff:ff", which is a broadcast address. Does this causing my ubuntu to not receive the packets?

Thanks & Regards,
Giri


Interfacing ENC28J60(ethernet) with PCA10056. #nrf52840

giriprasad@...
 
Edited

Hi Team,

I have interfaced ENC28j60 module to PCA10056 and flashed the example "zephyr/samples/net/sockets/echo" . After this, I am unable to ping PCA10056. I am getting the wireshark log as shown in attached file "wireshark_log_arp_enabled.png".  Here, mac_address of ENC28J60 is " 00:04:a3:ae:89:92", IP Address is "192.168.31.37". IP Address of the PC I am pinging from is "192.168.31.74". After this,I have commented out few lines of code in the file "zephyr//subsys/net/l2/ethernet/ethernet.c". Now, I am able to ping "PCA10056". Please  find the wireshark log of this in the attached file "wireshark_log_arp_disabled.png". Also attached screenshot of the changes I have made to the file "zephyr//subsys/net/l2/ethernet/ethernet.c" with name "ethernet_file_changes.png". Please help me in understanding why I am unable to ping without changes to the file "zephyr//subsys/net/l2/ethernet/ethernet.c". Please let me know, if more information is needed.

Thanks & Regards,
Giri


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

Jukka Rissanen
 

Hi Giri,

You could also verify from wireshark that the MAC addresses are
correctly set in the packets. If zephyr sends a packet
using wrong destination MAC address, then your ubuntu would not
receive it.

Cheers,
Jukka

On Tue, 2019-09-24 at 02:20 -0700, giriprasad@... wrote:
Hi,

Thanks for the reply. I have verified the ufw status and it is
inactive. Is it enough to say that firewall is disabled.

Regards,
Giri
_._,_._,_
Links:


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

giriprasad@...
 

Hi,

Thanks for the reply. I have verified the ufw status and it is inactive. Is it enough to say that firewall is disabled.

Regards,
Giri


Re: Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

Jukka Rissanen
 

Hi,

The text logs do not reveal anything useful (other than the zephyr
version used and that you are using ethernet + dhcp).

From the wireshark image, we can see that ubuntu does not receive the
SYN,ACK that zephyr sends as ubuntu tries to send SYN multiple times.
Perhaps there is a firewall that blocks the connection?

Cheers,
Jukka

On Mon, 2019-09-23 at 23:59 -0700, giriprasad@... wrote:
Hi Team,

I am running tcp socket client program in Ubuntu bash of Windows
subsystem for Linux and server program on PCA10056 board, on which
zephyr is running. I am able to establish connection and transfer
data between server and client. Please observe the zephyr debug log
of this, in the file attached with name
"socket_connection_log_zephyr_server_wsl_client.txt". Also observe
the log of wireshark running on Windows PC. File name is
"ws_log_sock_conn_zephyr_server_wsl_client.png"


After this, I have tried running the client code in the PC which is
running on Ubuntu OS. But, this time I am unable to establish
connection between my PC and PCA10056. Please observe the zephyr
debug log of this, in the file attached with name
"socket_connection_log_zephyr_server_ubuntu_client.txt". Also observe
the log of wireshark running on Ubuntu PC. File name is
"ws_log_sock_conn_zephyr_server_ubuntu_client.png".

I am unsure of this behavior. Please help me to establish connection
between Ubuntu PC and PCA10056. Please let me know, if more
information is needed.

Thanks & Regards,
Giri Prasad N.


Need help in establishing client-server socket communication between my Ubuntu PC and PCA10056 board, on which Zephyr is running. #nrf52840 #samples

giriprasad@...
 

Hi Team,

I am running tcp socket client program in Ubuntu bash of Windows subsystem for Linux and server program on PCA10056 board, on which zephyr is running. I am able to establish connection and transfer data between server and client. Please observe the zephyr debug log of this, in the file attached with name "socket_connection_log_zephyr_server_wsl_client.txt". Also observe the log of wireshark running on Windows PC. File name is "ws_log_sock_conn_zephyr_server_wsl_client.png"


After this, I have tried running the client code in the PC which is running on Ubuntu OS. But, this time I am unable to establish connection between my PC and PCA10056. Please observe the zephyr debug log of this, in the file attached with name "socket_connection_log_zephyr_server_ubuntu_client.txt". Also observe the log of wireshark running on Ubuntu PC. File name is "ws_log_sock_conn_zephyr_server_ubuntu_client.png".

I am unsure of this behavior. Please help me to establish connection between Ubuntu PC and PCA10056. Please let me know, if more information is needed.

Thanks & Regards,
Giri Prasad N.