Skip to content

when use on esp32-s3, the code freeze, and the board need a hard reset torecover #10

@chf-6309

Description

@chf-6309

I try to lauch those little codes:

# --- branche rapide : contourner le driver LAN ---
from wiznet5k import WIZNET5K
from machine  import SPI, Pin
import time

# Reset W5500
rst = Pin(5, Pin.OUT)
rst(0)
time.sleep_ms(100)
rst(1)
time.sleep_ms(222)

# CS et autres périphériques SPI
cs_ssd1306 = Pin(1,  Pin.OUT, value=1)
cs_ssd1309 = Pin(2,  Pin.OUT, value=1)
cs_ltc6806 = Pin(10, Pin.OUT, value=1)
cs_w5500   = Pin(11, Pin.OUT, value=1)
eth_int    = Pin(6, Pin.IN)
eth_rst    = Pin(5, Pin.OUT)

# Free the SPI bus from other devices
cs_ssd1306(1)
cs_ssd1309(1)
cs_ltc6806(1)
cs_w5500(1)

spi = SPI(1, sck=Pin(14), mosi=Pin(13), miso=Pin(12), baudrate=8_000_000)
cs  = Pin(11, Pin.OUT)

eth = WIZNET5K(spi, cs)

eth.mac(b'\x02\x12\x34\x56\x78\x9A')
eth.ifconfig(('192.168.1.50', '255.255.255.0',
              '192.168.1.1',  '8.8.8.8'))

print("MAC :", ":".join(f"{b:02X}" for b in eth.mac()))
print("IP  :",  eth.ifconfig())

its look that I'm on an infinite loop, waiting about one minute, and after reset (stop/restart from Thonny IDE), I got the messages: (even CTRL+D doesn't work)

MPY: soft reboot

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
  File "<stdin>", line 31, in <module>
  File "wiznet5k.py", line 167, in __init__
  File "wiznet5k.py", line 193, in set_dhcp
  File "wiznet5k_dhcp.py", line 493, in request_dhcp_lease
  File "wiznet5k_dhcp.py", line 350, in _dhcp_state_machine
  File "wiznet5k.py", line 302, in link_status
  File "wiznet5k.py", line 421, in read
KeyboardInterrupt: 

MPY: soft reboot
MicroPython v1.25.0 on 2025-04-15; Generic ESP32S3 module with Octal-SPIRAM with ESP32S3

Type "help()" for more information.

>>> 

All 3 "sublibs" and wiznet5k.pynare on the board root.

may I did something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions