PYBD SF6W WiFi Issues - [CYW43] HT not ready

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
Post Reply
bluesteel
Posts: 3
Joined: Tue Aug 31, 2021 3:54 pm

PYBD SF6W WiFi Issues - [CYW43] HT not ready

Post by bluesteel » Tue Aug 31, 2021 4:22 pm

Hello,

We have quite a few battery powered devices that use the PYBD SF6W as a control board, and they're doing brilliantly - easy to use, and low-power consumption when asleep. I'm using the wifi on sensor devices to do occasional software updates. After a couple of the boards started having problems connecting to the wifi I've noticed some new printouts in the console logs. The same software works OK on other boards so my current gut instinct is towards a HW cause (that has occurred on two boards). These boards have previously worked without a problem so not a manufacture issue, but perhaps something that might have happened during use.

I have tried the same program using v1.13 and v1.16 of micropython firmware and the same console logs are produced. The board is powered from USB (from the desktop PC) and is rebooted to green LED before using rshell/repl to import main.

The main.py calls the function below:

Code: Select all

import pyb
import machine

def main():
    print('Testing Network')
    
    import network
    sta_if = network.WLAN(network.STA_IF)
    sta_if.config(trace=1)
    
    print('deactivating network')
    sta_if.active(False) # disable wifi if currently active - in case of issues from a previous run
    sta_if.deinit()
    pyb.delay(5000)

    print('setting active')
    sta_if.active(True)
    pyb.delay(5000)
    
    print('setting active')
    sta_if.active(True)
    pyb.delay(5000)
    
    print('setting active')
    sta_if.active(True)    
    pyb.delay(5000)
    
    print('setting antenna')
    sta_if.config(antenna=0)  # select antenna, 0=chip, 1=external
    pyb.delay(5000)
    
    print('connecting')
    sta_if.connect('ssid', 'password')
    pyb.delay(5000)
    
    print('checking if is connected')
    while not sta_if.isconnected():
        pyb.delay(5000)

        # Check the status
        print('getting status')
        status = sta_if.status()
        
        if status <= 0:
            # Error States?
            return False
        
        print('checking if is connected')
The console output is:

Code: Select all

MicroPython v1.16 on 2021-06-18; PYBD-SF6W with STM32F767IIK
Type "help()" for more information.
>>>
>>> import main
Testing Network
deactivating network
setting active
[CYW43] HT not ready
setting active
[CYW43] HT not ready
setting active
[CYW43] HT not ready
setting antenna
[CYW43] HT not ready
connecting
[CYW43] HT not ready
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "main.py", line 70, in <module>
  File "main.py", line 13, in boot
  File "main.py", line 17, in start
  File "main.py", line 50, in main
OSError: -5
>>>
Where line 50 is "sta_if.connect('ssid', 'password')"

I have also seen messages of "[CYW43] F2 not ready". Which looks to refer (maybe?) to one of the fifos in the datasheet.

Searching for these output messages in the micropython github repos doesn't give any hits so I haven't been able to dig deeper into the underlying C code to find clues as to what might be the problem. I also tried looking through the "Cypress WWD drivers for 4343W" repo (under a previous commit as they have since deleted the sources) but didn't spot these output strings.
https://github.com/cypress/wwd/tree/900 ... 59ec5c0b16

I can't see any obvious visible damage to the boards under a magnifying glass so I'm a bit stumped. I'd like to repair (firmware/hardware) so they can go back into the devices (especially as it's tricky to get new ones given the shortage of STM32 chips). So, any advice, tips, clues, or pointers would be very much appreciated.

Many thanks!

bluesteel
Posts: 3
Joined: Tue Aug 31, 2021 3:54 pm

Re: PYBD SF6W WiFi Issues - [CYW43] HT not ready

Post by bluesteel » Wed Sep 01, 2021 10:35 am

Hello, an update to the original post.

The code example to reproduce this can be further simplified as follows:

Code: Select all

Entering REPL. Use Control-X to exit.
>
MicroPython v1.16 on 2021-06-18; PYBD-SF6W with STM32F767IIK
Type "help()" for more information.
>>>
>>> import network
>>> sta_if = network.WLAN(network.STA_IF)
>>> sta_if.active()
False
>>> sta_if.active(True)
[CYW43] HT not ready
>>>
This is now happening on 7 of the PYBDs that I've tested so far :shock: . I've tried with different versions of the MicroPython firmware including v1.13, v1.14, v1.15 and v1.16 - all produce the same output as above.

Thanks!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: PYBD SF6W WiFi Issues - [CYW43] HT not ready

Post by pythoncoder » Thu Sep 02, 2021 7:21 am

I've never seen this message.

CYW43 presumably refers to the CYW4343 chip that performs the WiFi interface, and a quick look at the source suggests that the message may come from here. It's possible that this chip may have become damaged. To get a definitive answer it might be an idea to post an issue on GitHub where it will get the attention of @Damien (the designer of the Pyboard D).
Peter Hinch
Index to my micropython libraries.

bluesteel
Posts: 3
Joined: Tue Aug 31, 2021 3:54 pm

Re: PYBD SF6W WiFi Issues - [CYW43] HT not ready

Post by bluesteel » Thu Sep 02, 2021 9:16 am

Hello,

Yes, good idea about raising a ticket. After doing a bit more digging I opened an issue on GitHub at:
https://github.com/micropython/micropython/issues/7738.

When I changed the firmware to v1.12 it outputted a few extra statements including:
"[CYW43] send_ethernet failed: -5" which I did manage to find within the sources.
https://github.com/micropython/micropyt ... lwip.c#L77

As you suggest, the chip may well have been damaged. Sadly, it looks as though I've managed to do the same thing to 10 boards.

I'll be sure to update here as well as on the github issue if I find any cause/solutions.

Thanks!

Post Reply