beechwoods-software / zephyr-cyw43-driver

Zephyr out of tree build for image with cyw43-driver
MIT License
9 stars 1 forks source link

Getting Hard Fault #1

Closed munir-zin closed 3 months ago

munir-zin commented 5 months ago

Hi, I have pulled this code and built it for picow. I am getting below error after few seconds of flash.

uart:~$ cyw43 loaded ok, mac 
API: 12.2
Data: RaspberryPi.PicoW
Compiler: 1.29.4
ClmImport: 1.47.1
Customization: v5 22/06/24
Creation: 2022-06-24 06:55:08

Connecting to network "Redmi"
Default interface is infineon_cyw43_module@0

calling net_mgmt(NET_REQUEST_WIFI_CONNECT)
0 Finished calling net_mgmt(NET_REQUEST_WIFI_SCAN)
*** Booting Zephyr OS build zephyr-v3.5.0-5237-g9260c5b6b284 ***
[00:00:01.746,000] <inf> net_config: Initializing network
[00:00:01.746,000] <inf> net_config: Waiting interface 1 (0x20000670) to be up...
[00:00:05.759,000] <inf> net_config: Interface 1 (0x20000670) coming up
[00:00:05.761,000] <err> os: ***** HARD FAULT *****
[00:00:05.761,000] <err> os: r0/a1:  0x000002bd  r1/a2:  0x00001000  r2/a3:  0x00000000
[00:00:05.761,000] <err> os: r3/a4:  0x000002bd r12/ip:  0x00000003 r14/lr:  0x1001d9a1
[00:00:05.761,000] <err> os:  xpsr:  0x01000000
[00:00:05.761,000] <err> os: Faulting instruction address (r15/pc): 0x1002330e
[00:00:05.761,000] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:05.762,000] <err> os: Current thread: 0x200023a8 (net_mgmt)
[00:00:05.842,000] <err> os: Halting system
drensber commented 5 months ago

I’ll have to look into this.

Are you just building the generic image, or are you trying to build the driver along with your own application? I’ve seen similar issues to the one you describe when there are device issues that screw up the zephyr init and prevent the network stack from even starting. If you’re just building a plain image as described in my README, that shouldn’t be an issue, though.

—Dave

On Feb 2, 2024, at 5:59 AM, munir-zin @.***> wrote:

Hi, I have pulled this code and built it for picow. I am getting below error after few seconds of flash.

uart:~$ cyw43 loaded ok, mac API: 12.2 Data: RaspberryPi.PicoW Compiler: 1.29.4 ClmImport: 1.47.1 Customization: v5 22/06/24 Creation: 2022-06-24 06:55:08

Connecting to network "Redmi" Default interface is @.***

calling net_mgmt(NET_REQUEST_WIFI_CONNECT) 0 Finished calling net_mgmt(NET_REQUEST_WIFI_SCAN) Booting Zephyr OS build zephyr-v3.5.0-5237-g9260c5b6b284 [00:00:01.746,000] net_config: Initializing network [00:00:01.746,000] net_config: Waiting interface 1 (0x20000670) to be up... [00:00:05.759,000] net_config: Interface 1 (0x20000670) coming up [00:00:05.761,000] os: HARD FAULT [00:00:05.761,000] os: r0/a1: 0x000002bd r1/a2: 0x00001000 r2/a3: 0x00000000 [00:00:05.761,000] os: r3/a4: 0x000002bd r12/ip: 0x00000003 r14/lr: 0x1001d9a1 [00:00:05.761,000] os: xpsr: 0x01000000 [00:00:05.761,000] os: Faulting instruction address (r15/pc): 0x1002330e [00:00:05.761,000] os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0 [00:00:05.762,000] os: Current thread: 0x200023a8 (net_mgmt) [00:00:05.842,000] os: Halting system

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

munir-zin commented 5 months ago

I buit the repo as suggested in readme. No additional code added by me.

drensber commented 5 months ago

I just did a build in a clean workspace and tried it on my Pico W. It worked fine:

uart:~$ cyw43 loaded ok, mac 28:cd:c1:06:d5:8c
API: 12.2
Data: RaspberryPi.PicoW
Compiler: 1.29.4
ClmImport: 1.47.1
Customization: v5 22/06/24
Creation: 2022-06-24 06:55:08

To configure wifi, either:

  1. Run 'wifi connect "<SSID>" "<passphrase>"' on the command line.

                        - or -

  2. Define CONFIG_WIFI_SSID and CONFIG_WIFI_PSK in local.conf and rebuild.

*** Booting Zephyr OS build v3.6.0-rc1-45-g129b73ce266e ***
[00:00:00.930,000] <inf> net_config: Initializing network
[00:00:00.930,000] <inf> net_config: Waiting interface 1 (0x20000650) to be up...
uart:~$ 
uart:~$ 
uart:~$ 
uart:~$ 
uart:~$ 
uart:~$ wifi status
Status: successful
==================
State: DISCONNECTED
uart:~$ wifi connect <SSID redacted> <passphrase redacted>
Connection requested
Connected
Connected
[00:00:27.615,000] <inf> net_config: Interface 1 (0x20000650) coming up
[00:00:27.630,000] <inf> net_config: Running dhcpv4 client...
[00:00:27.661,000] <inf> net_dhcpv4: Received: 192.168.1.120
[00:00:27.663,000] <inf> net_config: IPv4 address: 192.168.1.120
[00:00:27.663,000] <inf> net_config: Lease time: 86400 seconds
[00:00:27.663,000] <inf> net_config: Subnet: 255.255.255.0
[00:00:27.663,000] <inf> net_config: Router: 192.168.1.1
uart:~$ 
uart:~$ 
uart:~$ net iface

Interface eth0 (0x20000650) (WiFi) [1]
===============================
Link addr : 28:CD:C1:06:D5:8C
MTU       : 1500
Flags     : AUTO_START,IPv4
Device    : infineon_cyw43_module@0 (0x10023bc4)
Ethernet capabilities supported:
IPv4 unicast addresses (max 1):
        192.168.1.120 DHCP preferred
IPv4 multicast addresses (max 2):
        224.0.0.1
IPv4 gateway : 192.168.1.1
IPv4 netmask : 255.255.255.0
DHCPv4 lease time : 86400
DHCPv4 renew time : 43200
DHCPv4 server     : 192.168.1.1
DHCPv4 requested  : 192.168.1.120
DHCPv4 state      : bound
DHCPv4 attempts   : 1
uart:~$ net dns www.google.com
Query for 'www.google.com' sent.
dns: 142.250.80.100
dns: All results received
uart:~$ net ping 142.250.80.100
PING 142.250.80.100
28 bytes from 142.250.80.100 to 192.168.1.120: icmp_seq=1 ttl=59 time=21 ms
28 bytes from 142.250.80.100 to 192.168.1.120: icmp_seq=2 ttl=59 time=15 ms
28 bytes from 142.250.80.100 to 192.168.1.120: icmp_seq=3 ttl=59 time=20 ms

The only real difference I can see is that mine is pulling in the tip of Zephyr (currently a 3.6 release candidate), while yours is an older 3.5 version. I'm not sure why that would be.... maybe just because you did the build several days ago... or maybe you need to update your Zephyr SDK?

It should work with 3.5 anyway, though. Is there anything special about your hardware? Do you have any devices connected to your pico w?