esp-idf-svc icon indicating copy to clipboard operation
esp-idf-svc copied to clipboard

panic after using EthDriver

Open teamplayer3 opened this issue 1 year ago • 7 comments

After sys loop and eth driver dropped the board panics as follows:

code
fn main() -> Result<()> {
  esp_idf_sys::link_patches();

  // Bind the log crate to the ESP Logging facilities
  esp_idf_svc::log::EspLogger::initialize_default();

  let peripherals = Peripherals::take().unwrap();
  let pins = peripherals.pins;

  let sysloop = EspSystemEventLoop::take()?;

  let mut netif_config = NetifConfiguration::eth_default_client();
  netif_config.ip_configuration =
      ipv4::Configuration::Client(ipv4::ClientConfiguration::Fixed(ClientSettings {
          ip: Ipv4Addr::new(192, 168, 2, 12),
          subnet: Subnet {
              gateway: Ipv4Addr::new(192, 168, 2, 1),
              mask: Mask(24),
          },
          ..Default::default()
      }));
  let netif = EspNetif::new_with_conf(&netif_config)?;

  let spi = SpiDriver::new(
      peripherals.spi2,
      pins.gpio2,
      pins.gpio3,
      Some(pins.gpio4),
      Dma::Auto(1500),
  )?;

  let eth_driver = match EthDriver::new_spi(
      spi,
      pins.gpio1,
      Some(pins.gpio5),
      Some(pins.gpio6),
      SpiEthChipset::W5500,
      36.MHz().into(),
      Some(&MAC_ADDR),
      Some(1),
      sysloop.clone(),
  ) {
      Err(e) => {
          info!("{}", e);
          bail!("");
      }
      Ok(v) => v,
  };
  info!("driver init");

  let mut esp_spi_ethernet = EspEth::wrap_all(eth_driver, netif)?;

  if let Err(e) = esp_spi_ethernet.start() {
      error!("{e}")
  }

  info!("started esp");

  if !EthWait::new(esp_spi_ethernet.driver(), &sysloop)?
      .wait_with_timeout(Duration::from_secs(10), || {
          esp_spi_ethernet.netif().get_ip_info().unwrap().ip != Ipv4Addr::new(0, 0, 0, 0)
      })
  {
      info!("in bail");
      bail!("Eth did not receive a DHCP lease");
  }

  let ip_info = esp_spi_ethernet.netif().get_ip_info()?;

  info!("Eth DHCP info: {:?}", ip_info);

  ping(Ipv4Addr::new(192, 168, 2, 34))?;

  Ok(())
}

// pings gateway
fn ping(ip: ipv4::Ipv4Addr) -> Result<()> {
    info!("About to do some pings for {:?}", ip);

    let ping_summary = ping::EspPing::default().ping(ip, &Default::default())?;
    if ping_summary.transmitted != ping_summary.received {
        bail!("Pinging IP {} resulted in timeouts", ip);
    }

    info!("Pinging done");

    Ok(())
}
log
I (320) heap_init: At 50000020 len 00001FE0 (7 KiB): RTCRAM
I (327) spi_flash: detected chip: generic
I (331) spi_flash: flash io: dio
I (336) sleep: Configure to isolate all GPIO pins in sleep state
I (342) sleep: Enable automatic switching of GPIO sleep configuration
I (349) cpu_start: Starting scheduler.
I (354) system_api: Base MAC address is not set
I (354) system_api: read default base MAC address from EFUSE
I (364) w5500.mac: version=0
I (374) esp_idf_svc::eth: Driver initialized
I (374) esp_idf_svc::eth: Attached MAC address: [2, 0, 0, 18, 52, 86]
I (374) esp_idf_svc::eth: Initialization complete
I (384) esp32c3_w5500_example: driver init
I (384) esp_idf_svc::eth: Stopping
E (394) esp_eth: esp_eth_stop(288): driver not started yet
I (394) esp_idf_svc::eth: Stop requested
I (404) esp_eth.netif.netif_glue: 02:00:00:12:34:56
I (404) esp_eth.netif.netif_glue: ethernet attached to netif
I (414) esp_idf_svc::eth: Start requested
I (414) esp32c3_w5500_example: started esp
I (424) esp_idf_svc::eth: About to wait for duration 10s
I (424) esp_idf_svc::eth: Waiting done - success
I (434) esp32c3_w5500_example: Eth DHCP info: IpInfo { ip: 192.168.2.12, subnet: Subnet { gateway: 192.168.2.1, mask: Mask(24) }, dns: Some(8.8.8.8), secondary_dns: Some(8.8.4.4) }
I (454) esp32c3_w5500_example: About to do some pings for 192.168.2.34
I (454) esp_idf_svc::ping: About to run a summary ping 192.168.2.34 with configuration Configuration { count: 5, interval: 1s, timeout: 1s, data_size: 56, tos: 0 }
I (474) esp_idf_svc::ping: Ping session established, got handle 0x3fc9b970
0x3fc9b970 - _heap_start
    at ??:??
I (484) esp_idf_svc::ping: Ping session started
I (484) esp_idf_svc::ping: Waiting for the ping session to complete
I (1484) esp_idf_svc::ping: Ping timeout callback invoked
I (1484) esp_idf_svc::ping: From ??? icmp_seq=1 timeout
I (2484) esp_idf_svc::ping: Ping timeout callback invoked
I (2484) esp_idf_svc::ping: From ??? icmp_seq=2 timeout
I (3354) esp_idf_svc::ping: Ping success callback invoked
I (3354) esp_idf_svc::ping: From 192.168.2.34 icmp_seq=3 ttl=64 time=872ms bytes=56
I (3484) esp_idf_svc::ping: Ping success callback invoked
I (3484) esp_idf_svc::ping: From 192.168.2.34 icmp_seq=4 ttl=64 time=0ms bytes=56
I (4484) esp_idf_svc::ping: Ping success callback invoked
I (4484) esp_idf_svc::ping: From 192.168.2.34 icmp_seq=5 ttl=64 time=0ms bytes=56
I (5484) esp_idf_svc::ping: Ping end callback invoked
I (5484) esp_idf_svc::ping: 5 packets transmitted, 3 received, time 2869ms
I (5484) esp_idf_svc::ping: Ping session stopped
I (5484) esp_idf_svc::ping: Ping session 0x3fc9b970 removed
0x3fc9b970 - _heap_start
    at ??:??
I (5494) esp_idf_svc::eth: Stopping
I (5494) esp_idf_svc::eth: Stop requested
I (5504) esp_idf_svc::eth: Stopping
E (5504) esp_eth: esp_eth_stop(288): driver not started yet
I (5514) esp_idf_svc::eth: Stop requested
I (5514) gpio: GPIO[1]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (5524) esp_idf_svc::eth: Driver deinitialized
I (5534) gpio: GPIO[5]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (5544) gpio: GPIO[3]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (5554) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (5564) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (5564) esp_idf_svc::eth: Dropped
I (5574) esp_idf_svc::eventloop: Dropped
Error: Pinging IP 192.168.2.34 resulted in timeouts

assert failed: xQueueSemaphoreTake queue.c:1545 (( pxQueue ))
Core  0 register dump:
MEPC    : 0x4038159c  RA      : 0x403864ca  SP      : 0x3fc9b250  GP      : 0x3fc8e000  
0x4038159c - panic_abort
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_system/panic.c:408
0x403864ca - __ubsan_include
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_system/ubsan.c:294
0x3fc9b250 - _heap_start
  at ??:??
0x3fc8e000 - __global_pointer$
    at ??:??
TP      : 0x3fc81894  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
0x3fc81894 - __eh_frame_hdr_end
    at ??:??
0x37363534 - 
    at ??:??
0x7271706f - USB_SERIAL_JTAG
    at ??:??
0x33323130 - 
    at ??:??
S0/FP   : 0x3fc9b3ad  S1      : 0x0000008a  A0      : 0x3fc9b2a8  A1      : 0x3fc8e671  
0x3fc9b3ad - _heap_start
    at ??:??
0x0000008a - 
    at ??:??
0x3fc9b2a8 - _heap_start
    at ??:??
0x3fc8e671 - _coredump_dram_start
    at ??:??
A2      : 0x00000001  A3      : 0x00000029  A4      : 0x3fc9258c  A5      : 0x3fc92594  
0x00000001 - 
    at ??:??
0x00000029 - RV_STK_A0
    at ??:??
0x3fc9258c - g_pm
    at ??:??
0x3fc92594 - g_pm
    at ??:??
A6      : 0x7a797877  A7      : 0x76757473  S2      : 0x3fc9b2a8  S3      : 0x00000001  
0x7a797877 - USB_SERIAL_JTAG
    at ??:??
0x76757473 - USB_SERIAL_JTAG
    at ??:??
0x3fc9b2a8 - _heap_start
    at ??:??
0x00000001 - 
    at ??:??
S4      : 0x3fc9b2a8  S5      : 0x3c08d3ec  S6      : 0x00000000  S7      : 0x00000000  
0x3fc9b2a8 - _heap_start
    at ??:??
0x3c08d3ec - __FUNCTION__.7563
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
0x6e6d6c6b - USB_SERIAL_JTAG
    at ??:??
0x6a696867 - USB_SERIAL_JTAG
    at ??:??
0x66656463 - USB_SERIAL_JTAG
    at ??:??
0x62613938 - USB_SERIAL_JTAG
    at ??:??
MSTATUS : 0x00001801  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
0x00001801 - 
    at ??:??
0x40380001 - _iram_start
    at ??:??
0x00000007 - RV_STK_RA
    at ??:??
0x00000000 - 
    at ??:??
MHARTID : 0x00000000  
0x00000000 - 
    at ??:??

Stack memory:
3fc9b250: 0xa5a5a5a5 0xa5a5a5a5 0x3c0966a0 0x4038c1c0 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x3fc8e670
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0x3c0966a0 - __func__.4974
    at ??:??
0x4038c1c0 - newlib_include_assert_impl
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/newlib/assert.c:97
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0x3fc8e670 - _coredump_dram_start
    at ??:??
3fc9b270: 0x35343531 0xa5a5a500 0x00000000 0x00000000 0xa5000000 0x3fc8ef48 0x3c0966a0 0x3fc8ef2c
0x35343531 - 
    at ??:??
0xa5a5a500 - USB_SERIAL_JTAG
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0xa5000000 - USB_SERIAL_JTAG
    at ??:??
0x3fc8ef48 - __func__.4629
    at ??:??
0x3c0966a0 - __func__.4974
    at ??:??
0x3fc8ef2c - __func__.4629
    at ??:??
3fc9b290: 0x3c09673d 0x3fc8ef58 0x3fc9b270 0x3fc8ef5c 0x3c096b60 0x3fc8e670 0x65737361 0x66207472
0x3c09673d - __func__.5117
    at ??:??
0x3fc8ef58 - __func__.4629
    at ??:??
0x3fc9b270 - _heap_start
    at ??:??
0x3fc8ef5c - __func__.4629
    at ??:??
0x3c096b60 - __func__.5117
    at ??:??
0x3fc8e670 - _coredump_dram_start
    at ??:??
0x65737361 - USB_SERIAL_JTAG
    at ??:??
0x66207472 - USB_SERIAL_JTAG
    at ??:??
3fc9b2b0: 0x656c6961 0x78203a64 0x75657551 0x6d655365 0x6f687061 0x61546572 0x7120656b 0x65756575
0x656c6961 - USB_SERIAL_JTAG
    at ??:??
0x78203a64 - USB_SERIAL_JTAG
    at ??:??
0x75657551 - USB_SERIAL_JTAG
    at ??:??
0x6d655365 - USB_SERIAL_JTAG
    at ??:??
0x6f687061 - USB_SERIAL_JTAG
    at ??:??
0x61546572 - USB_SERIAL_JTAG
    at ??:??
0x7120656b - USB_SERIAL_JTAG
    at ??:??
0x65756575 - USB_SERIAL_JTAG
    at ??:??
3fc9b2d0: 0x313a632e 0x20353435 0x70202828 0x65755178 0x29206575 0xa5a50029 0xa5a5a5a5 0xa5a5a5a5
0x313a632e - 
    at ??:??
0x20353435 - 
    at ??:??
0x70202828 - USB_SERIAL_JTAG
    at ??:??
0x65755178 - USB_SERIAL_JTAG
    at ??:??
0x29206575 - 
    at ??:??
0xa5a50029 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
3fc9b2f0: 0xa5a5a5a5 0xa5a5a5a5 0x60024000 0x3fc9a814 0xa5a5a5a5 0x387f00ff 0x60024000 0xf8000100
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0x60024000 - GPSPI2
    at ??:??
0x3fc9a814 - _heap_start
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0x387f00ff - 
    at ??:??
0x60024000 - GPSPI2
    at ??:??
0xf8000100 - USB_SERIAL_JTAG
    at ??:??
3fc9b310: 0xa5a5a5a5 0x3fc9d014 0x3fc9a94c 0x3fc9a814 0x3fc9a7f4 0x3fc9a918 0x3fc9b3b8 0x4038078a
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0x3fc9d014 - _heap_start
    at ??:??
0x3fc9a94c - _heap_start
    at ??:??
0x3fc9a814 - _heap_start
    at ??:??
0x3fc9a7f4 - _heap_start
    at ??:??
0x3fc9a918 - _heap_start
    at ??:??
0x3fc9b3b8 - _heap_start
    at ??:??
0x4038078a - spi_new_trans
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/driver/spi_master.c:565
3fc9b330: 0x00000001 0x00000010 0x00000008 0x403886b4 0x00000008 0x00000008 0x00000008 0x00000000
0x00000001 - 
    at ??:??
0x00000010 - _esp_memprot_prefetch_pad_size
    at ??:??
0x00000008 - RV_STK_SP
    at ??:??
0x403886b4 - xTaskPriorityDisinherit
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/freertos/tasks.c:4807
0x00000008 - RV_STK_SP
    at ??:??
0x00000008 - RV_STK_SP
    at ??:??
0x00000008 - RV_STK_SP
    at ??:??
0x00000000 - 
    at ??:??
3fc9b350: 0x40388d28 0x40386c34 0x3fc9b3d0 0x3fc8e000 0x3fc81894 0xdfffffff 0x420379e6 0xfffff000
0x40388d28 - vPortClearInterruptMask
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/freertos/port/riscv/port.c:344
0x40386c34 - xQueueGenericSend
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/freertos/queue.c:947
0x3fc9b3d0 - _heap_start
    at ??:??
0x3fc8e000 - __global_pointer$
    at ??:??
0x3fc81894 - __eh_frame_hdr_end
    at ??:??
0xdfffffff - USB_SERIAL_JTAG
    at ??:??
0x420379e6 - eth_input_to_netif
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_netif_glue.c:39
0xfffff000 - USB_SERIAL_JTAG
    at ??:??
3fc9b370: 0x3fc991dc 0x00000000 0x000005f2 0x00000355 0x3fc9a7f4 0x3fc9a918 0x3fc9a8a8 0x40387148
0x3fc991dc - _heap_start
    at ??:??
0x00000000 - 
    at ??:??
0x000005f2 - 
    at ??:??
0x00000355 - 
    at ??:??
0x3fc9a7f4 - _heap_start
    at ??:??
0x3fc9a918 - _heap_start
    at ??:??
0x3fc9a8a8 - _heap_start
    at ??:??
0x40387148 - xQueueSemaphoreTake
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/freertos/queue.c:1549
3fc9b390: 0x00000000 0x00000001 0x3fc9b41c 0x00000000 0x00000000 0x3fc991ec 0x00000002 0x00000000
0x00000000 - 
    at ??:??
0x00000001 - 
    at ??:??
0x3fc9b41c - _heap_start
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x3fc991ec - _heap_start
    at ??:??
0x00000002 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b3b0: 0x00000000 0x00000000 0x00000000 0x00000355 0x3fc9a7f4 0x3fc9a918 0x3fc9a8a8 0x40380c68
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000355 - 
    at ??:??
0x3fc9a7f4 - _heap_start
    at ??:??
0x3fc9a918 - _heap_start
    at ??:??
0x3fc9a8a8 - _heap_start
    at ??:??
0x40380c68 - acquire_core
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/driver/spi_bus_lock.c:363
3fc9b3d0: 0x40388d28 0x403888c0 0x3fc9ac74 0x3fc9b428 0x3fc9a7f4 0x3fc9a918 0x00000102 0x403809e4
0x40388d28 - vPortClearInterruptMask
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/freertos/port/riscv/port.c:344
0x403888c0 - ulTaskGenericNotifyTake
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/freertos/tasks.c:5403
0x3fc9ac74 - _heap_start
    at ??:??
0x3fc9b428 - _heap_start
    at ??:??
0x3fc9a7f4 - _heap_start
    at ??:??
0x3fc9a918 - _heap_start
    at ??:??
0x00000102 - 
    at ??:??
0x403809e4 - spi_device_polling_start
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/driver/spi_master.c:947
3fc9b3f0: 0x3fc92ac8 0x00000001 0x00000001 0x3fc9b47b 0x3fc9ac08 0x00000001 0x3fc9a918 0x40380b24
0x3fc92ac8 - pxCurrentTCB
    at ??:??
0x00000001 - 
    at ??:??
0x00000001 - 
    at ??:??
0x3fc9b47b - _heap_start
    at ??:??
0x3fc9ac08 - _heap_start
    at ??:??
0x00000001 - 
    at ??:??
0x3fc9a918 - _heap_start
    at ??:??
0x40380b24 - spi_device_polling_transmit
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/driver/spi_master.c:1001
3fc9b410: 0x3fc9ac08 0x00000001 0x00000107 0x4203ab08 0x000005f2 0x3c08d3ec 0x00000004 0x00000002
0x3fc9ac08 - _heap_start
    at ??:??
0x00000001 - 
    at ??:??
0x00000107 - 
    at ??:??
0x4203ab08 - w5500_read
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_mac_w5500.c:96
0x000005f2 - 
    at ??:??
0x3c08d3ec - __FUNCTION__.7563
    at ??:??
0x00000004 - RV_STK_RA
    at ??:??
0x00000002 - 
    at ??:??
3fc9b430: 0x00000008 0x00000000 0x00000008 0x00000008 0x00000000 0x00000000 0x3fc9b47b 0x00000000
0x00000008 - RV_STK_SP
    at ??:??
0x00000000 - 
    at ??:??
0x00000008 - RV_STK_SP
    at ??:??
0x00000008 - RV_STK_SP
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x3fc9b47b - _heap_start
    at ??:??
0x00000000 - 
    at ??:??
3fc9b450: 0x00020008 0x3fc9d014 0x3fc9ac08 0x00000004 0x00020008 0x3fc9d014 0x3fc9ac08 0x4203adfe
0x00020008 - 
    at ??:??
0x3fc9d014 - _heap_start
    at ??:??
0x3fc9ac08 - _heap_start
    at ??:??
0x00000004 - RV_STK_RA
    at ??:??
0x00020008 - 
    at ??:??
0x3fc9d014 - _heap_start
    at ??:??
0x3fc9ac08 - _heap_start
    at ??:??
0x4203adfe - emac_w5500_task
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_mac_w5500.c:329
3fc9b470: 0x00000000 0x00000000 0x04000000 0x00000062 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x04000000 - 
    at ??:??
0x00000062 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b490: 0x00000000 0x00000000 0x00000000 0x40388cb2 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x40388cb2 - _prvTaskExitError
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/freertos/port/riscv/port.c:164
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b4b0: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000154
0x00000000 - 
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
    at ??:??
0x00000154 - 
    at ??:??
3fc9b4d0: 0x3fc9b3d0 0x00000265 0x3fc90ba4 0x3fc90ba4 0x3fc9b4d0 0x3fc90b9c 0x0000000a 0x950d0618
0x3fc9b3d0 - _heap_start
    at ??:??
0x00000265 - 
    at ??:??
0x3fc90ba4 - pxReadyTasksLists
    at ??:??
0x3fc90ba4 - pxReadyTasksLists
    at ??:??
0x3fc9b4d0 - _heap_start
    at ??:??
0x3fc90b9c - pxReadyTasksLists
    at ??:??
0x0000000a - RV_STK_SP
    at ??:??
0x950d0618 - USB_SERIAL_JTAG
    at ??:??
3fc9b4f0: 0x959fc6a6 0x3fc9b4d0 0x00000000 0x0000000f 0x3fc9accc 0x30353577 0x73745f30 0x62b0006b
0x959fc6a6 - USB_SERIAL_JTAG
    at ??:??
0x3fc9b4d0 - _heap_start
    at ??:??
0x00000000 - 
    at ??:??
0x0000000f - RV_STK_GP
    at ??:??
0x3fc9accc - _heap_start
    at ??:??
0x30353577 - 
    at ??:??
0x73745f30 - USB_SERIAL_JTAG
    at ??:??
0x62b0006b - USB_SERIAL_JTAG
    at ??:??
3fc9b510: 0x00df89fe 0x00000000 0x3fc9b4c0 0x0000000f 0x00000001 0x00000000 0x00000000 0x00000000
0x00df89fe - 
    at ??:??
0x00000000 - 
    at ??:??
0x3fc9b4c0 - _heap_start
    at ??:??
0x0000000f - RV_STK_GP
    at ??:??
0x00000001 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b530: 0x3fc93968 0x3fc939d0 0x3fc93a38 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000
0x3fc93968 - _heap_start
    at ??:??
0x3fc939d0 - _heap_start
    at ??:??
0x3fc93a38 - _heap_start
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000001 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b550: 0x00000000 0x420698d4 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x420698d4 - _cleanup_r
    at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/findfp.c:229
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b570: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b590: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b5b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b5d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b5f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
3fc9b610: 0x00000000 0x00000000 0x00000000 0x00000000 0x3f000000 0x0000004c 0x4203c3cc 0x4203c254
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x00000000 - 
    at ??:??
0x3f000000 - __eh_frame_hdr_end
    at ??:??
0x0000004c - RV_STK_S3
    at ??:??
0x4203c3cc - w5500_set_mediator
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:95
0x4203c254 - w5500_reset
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:115
3fc9b630: 0x4203c210 0x4203c338 0x4203bfe2 0x4203c14e 0x4203bfe6 0x4203bfce 0x4203bfd2 0x4203c382
0x4203c210 - w5500_reset_hw
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:133
0x4203c338 - w5500_init
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:207
0x4203bfe2 - w5500_deinit
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:226
0x4203c14e - w5500_negotiate
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:147
0x4203bfe6 - w5500_get_link
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:104
0x4203bfce - w5500_pwrctl
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:167
0x4203bfd2 - w5500_set_addr
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:172
0x4203c382 - w5500_get_addr
    at /home/esp32dev/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:179

The errors E (394) esp_eth: esp_eth_stop(288): driver not started yet are a little bit confusing as well (I know it belongs to esp-idf and is already handled in the rust code).

teamplayer3 avatar Nov 24 '22 09:11 teamplayer3

I think there is a drop of the spi device missing or something like this.

I get the following after using the EthDriver (not

I (419) esp_idf_svc::eth: About to wait for duration 20s
I (2409) esp_idf_svc::eth: Got eth event: Connected(0x3fc9b6a0) 
0x3fc9b6a0 - _heap_start
    at ??:??
I (22419) esp_idf_svc::eth: Timeout while waiting
I (22419) dhcp: in bail
I (22419) esp_idf_svc::eth: Stopping
I (22419) esp_idf_svc::eth: Stop requested
I (22419) esp_idf_svc::eth: Stopping
E (22429) esp_eth: esp_eth_stop(288): driver not started yet
I (22429) esp_idf_svc::eth: Stop requested
I (22439) gpio: GPIO[1]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (22449) esp_idf_svc::eth: Driver deinitialized
I (22449) gpio: GPIO[5]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (22459) gpio: GPIO[3]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (22469) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (22479) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (22489) esp_idf_svc::eth: Dropped
I (22489) esp_idf_svc::eventloop: Dropped
Error: Eth did not receive a DHCP lease
E (23229) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (23229) w5500.mac: w5500_read(97): spi transmit failed
E (24229) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (24229) w5500.mac: w5500_read(97): spi transmit failed
E (25229) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (25229) w5500.mac: w5500_read(97): spi transmit failed
E (26229) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (26229) w5500.mac: w5500_read(97): spi transmit failed
E (27229) spi_master: check_trans_valid(689): txdata transfer > host maximum
E (27229) w5500.mac: w5500_read(97): spi transmit failed
...
code
fn main() -> Result<()> {
    esp_idf_sys::link_patches();

    // Bind the log crate to the ESP Logging facilities
    esp_idf_svc::log::EspLogger::initialize_default();

    let peripherals = Peripherals::take().unwrap();
    let pins = peripherals.pins;

    let sysloop = EspSystemEventLoop::take()?;

    let mut netif_config = NetifConfiguration::eth_default_client();
    netif_config.ip_configuration =
        ipv4::Configuration::Client(ipv4::ClientConfiguration::DHCP(ipv4::DHCPClientSettings {
            hostname: Some("my-device".into()),
        }));
    let netif = EspNetif::new_with_conf(&netif_config)?;

    let eth_driver = match EthDriver::new_spi(
        peripherals.spi2,
        pins.gpio1,
        pins.gpio2,
        pins.gpio3,
        pins.gpio4,
        Dma::Auto(4096),
        Some(pins.gpio5),
        Some(pins.gpio6),
        SpiEthChipset::W5500,
        20.MHz().into(),
        Some(&MAC_ADDR),
        None,
        sysloop.clone(),
    ) {
        Err(e) => {
            info!("{}", e);
            bail!("");
        }
        Ok(v) => v,
    };

    info!("driver init");

    let mut esp_spi_ethernet = EspEth::wrap_all(eth_driver, netif)?;

    if let Err(e) = esp_spi_ethernet.start() {
        error!("{e}")
    }

    info!("started esp");

    if !EthWait::new(esp_spi_ethernet.driver(), &sysloop)?
        .wait_with_timeout(Duration::from_secs(20), || {
            esp_spi_ethernet.netif().get_ip_info().unwrap().ip != Ipv4Addr::new(0, 0, 0, 0)
        })
    {
        info!("in bail");
        bail!("Eth did not receive a DHCP lease");
    }

    let ip_info = esp_spi_ethernet.netif().get_ip_info()?;

    info!("Eth DHCP info: {:?}", ip_info);

    ping(Ipv4Addr::new(192, 168, 2, 34))?;

    Ok(())
}

teamplayer3 avatar Nov 24 '22 19:11 teamplayer3

@teamplayer3 Can you try with latest master?

ivmarkov avatar Dec 04 '22 16:12 ivmarkov

Now I get the following error:

backtrace
I (7479) esp_idf_svc::eth: Stopping
I (7489) esp_idf_svc::eth: Stop requested
I (7489) esp_idf_svc::eth: Stopping
E (7499) esp_eth: esp_eth_stop(288): driver not started yet
I (7499) esp_idf_svc::eth: Stop requested
I (7509) gpio: GPIO[1]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (7519) esp_idf_svc::eth: Driver deinitialized
I (7519) gpio: GPIO[5]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (7529) gpio: GPIO[3]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (7539) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (7549) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (7559) esp_idf_svc::eth: Dropped
I (7559) esp_idf_svc::eventloop: Dropped

assert failed: xQueueSemaphoreTake queue.c:1545 (( pxQueue ))
Core  0 register dump:
MEPC    : 0x4038159c  RA      : 0x40386372  SP      : 0x3fc9b240  GP      : 0x3fc8e000  
0x4038159c - panic_abort
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_system/panic.c:402
0x40386372 - __ubsan_include
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_system/ubsan.c:294
0x3fc9b240 - _static_data_end
  at ??:??
0x3fc8e000 - __global_pointer$
  at ??:??
TP      : 0x3fc819e4  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
0x3fc819e4 - __eh_frame_hdr
  at ??:??
0x37363534 - 
  at ??:??
0x7271706f - USB_SERIAL_JTAG
  at ??:??
0x33323130 - 
  at ??:??
S0/FP   : 0x3fc9b39d  S1      : 0x0000008a  A0      : 0x3fc9b298  A1      : 0x3fc8e665  
0x3fc9b39d - _static_data_end
  at ??:??
0x0000008a - RV_STK_MCAUSE
  at ??:??
0x3fc9b298 - _static_data_end
  at ??:??
0x3fc8e665 - _btdm_data_end
  at ??:??
A2      : 0x00000001  A3      : 0x00000029  A4      : 0x3fc9258c  A5      : 0x3fc92594  
0x00000001 - 
  at ??:??
0x00000029 - RV_STK_A0
  at ??:??
0x3fc9258c - g_pm
  at ??:??
0x3fc92594 - g_pm
  at ??:??
A6      : 0x7a797877  A7      : 0x76757473  S2      : 0x3fc9b298  S3      : 0x00000001  
0x7a797877 - USB_SERIAL_JTAG
  at ??:??
0x76757473 - USB_SERIAL_JTAG
  at ??:??
0x3fc9b298 - _static_data_end
  at ??:??
0x00000001 - 
  at ??:??
S4      : 0x3fc9b298  S5      : 0x3c08d28c  S6      : 0x00000000  S7      : 0x00000000  
0x3fc9b298 - _static_data_end
  at ??:??
0x3c08d28c - __FUNCTION__.7563
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
0x6e6d6c6b - USB_SERIAL_JTAG
  at ??:??
0x6a696867 - USB_SERIAL_JTAG
  at ??:??
0x66656463 - USB_SERIAL_JTAG
  at ??:??
0x62613938 - USB_SERIAL_JTAG
  at ??:??
MSTATUS : 0x00001801  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
0x00001801 - 
  at ??:??
0x40380001 - _iram_start
  at ??:??
0x00000007 - RV_STK_RA
  at ??:??
0x00000000 - 
  at ??:??
MHARTID : 0x00000000  
0x00000000 - 
  at ??:??

Stack memory:
3fc9b240: 0xa5a5a5a5 0xa5a5a5a5 0x3c096540 0x4038c064 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x3fc8e664
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0x3c096540 - __func__.4974
  at ??:??
0x4038c064 - newlib_include_assert_impl
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/newlib/assert.c:97
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0x3fc8e664 - _btdm_data_end
  at ??:??
3fc9b260: 0x35343531 0xa5a5a500 0x00000000 0x00000000 0xa5000000 0x3fc8ef3c 0x3c096540 0x3fc8ef20
0x35343531 - 
  at ??:??
0xa5a5a500 - USB_SERIAL_JTAG
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0xa5000000 - USB_SERIAL_JTAG
  at ??:??
0x3fc8ef3c - __func__.4629
  at ??:??
0x3c096540 - __func__.4974
  at ??:??
0x3fc8ef20 - __func__.4629
  at ??:??
3fc9b280: 0x3c0965dd 0x3fc8ef4c 0x3fc9b260 0x3fc8ef50 0x3c096a00 0x3fc8e664 0x65737361 0x66207472
0x3c0965dd - __func__.5117
  at ??:??
0x3fc8ef4c - __func__.4629
  at ??:??
0x3fc9b260 - _static_data_end
  at ??:??
0x3fc8ef50 - __func__.4629
  at ??:??
0x3c096a00 - __func__.5117
  at ??:??
0x3fc8e664 - _btdm_data_end
  at ??:??
0x65737361 - USB_SERIAL_JTAG
  at ??:??
0x66207472 - USB_SERIAL_JTAG
  at ??:??
3fc9b2a0: 0x656c6961 0x78203a64 0x75657551 0x6d655365 0x6f687061 0x61546572 0x7120656b 0x65756575
0x656c6961 - USB_SERIAL_JTAG
  at ??:??
0x78203a64 - USB_SERIAL_JTAG
  at ??:??
0x75657551 - USB_SERIAL_JTAG
  at ??:??
0x6d655365 - USB_SERIAL_JTAG
  at ??:??
0x6f687061 - USB_SERIAL_JTAG
  at ??:??
0x61546572 - USB_SERIAL_JTAG
  at ??:??
0x7120656b - USB_SERIAL_JTAG
  at ??:??
0x65756575 - USB_SERIAL_JTAG
  at ??:??
3fc9b2c0: 0x313a632e 0x20353435 0x70202828 0x65755178 0x29206575 0xa5a50029 0xa5a5a5a5 0xa5a5a5a5
0x313a632e - 
  at ??:??
0x20353435 - 
  at ??:??
0x70202828 - USB_SERIAL_JTAG
  at ??:??
0x65755178 - USB_SERIAL_JTAG
  at ??:??
0x29206575 - 
  at ??:??
0xa5a50029 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
3fc9b2e0: 0xa5a5a5a5 0xa5a5a5a5 0x60024000 0x3fc9a804 0xa5a5a5a5 0x387f00ff 0x60024000 0xf8000100
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0x60024000 - GPSPI2
  at ??:??
0x3fc9a804 - _static_data_end
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0x387f00ff - 
  at ??:??
0x60024000 - GPSPI2
  at ??:??
0xf8000100 - USB_SERIAL_JTAG
  at ??:??
3fc9b300: 0xa5a5a5a5 0x3fc9cf9c 0x3fc9a93c 0x3fc9a804 0x3fc9a7e4 0x3fc9a908 0x3fc9b3a8 0x4038078a
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0x3fc9cf9c - _static_data_end
  at ??:??
0x3fc9a93c - _static_data_end
  at ??:??
0x3fc9a804 - _static_data_end
  at ??:??
0x3fc9a7e4 - _static_data_end
  at ??:??
0x3fc9a908 - _static_data_end
  at ??:??
0x3fc9b3a8 - _static_data_end
  at ??:??
0x4038078a - spi_new_trans
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/driver/spi_master.c:565
3fc9b320: 0x00000001 0x00000010 0x00000008 0x4038855c 0x00000008 0x00000008 0x00000008 0x00000000
0x00000001 - 
  at ??:??
0x00000010 - RV_STK_TP
  at ??:??
0x00000008 - RV_STK_SP
  at ??:??
0x4038855c - xTaskPriorityDisinherit
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/freertos/tasks.c:4807
0x00000008 - RV_STK_SP
  at ??:??
0x00000008 - RV_STK_SP
  at ??:??
0x00000008 - RV_STK_SP
  at ??:??
0x00000000 - 
  at ??:??
3fc9b340: 0x40388bd0 0x40386adc 0x3fc9b3c0 0x3fc8e000 0x3fc819e4 0xdfffffff 0x42036968 0xfffff000
0x40388bd0 - vPortClearInterruptMask
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/freertos/port/riscv/port.c:344
0x40386adc - xQueueGenericSend
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/freertos/queue.c:947
0x3fc9b3c0 - _static_data_end
  at ??:??
0x3fc8e000 - __global_pointer$
  at ??:??
0x3fc819e4 - __eh_frame_hdr
  at ??:??
0xdfffffff - USB_SERIAL_JTAG
  at ??:??
0x42036968 - eth_input_to_netif
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_netif_glue.c:39
0xfffff000 - USB_SERIAL_JTAG
  at ??:??
3fc9b360: 0x3fc991cc 0x00000000 0x000005f2 0x00000355 0x3fc9a7e4 0x3fc9a908 0x3fc9a898 0x40386ff0
0x3fc991cc - _static_data_end
  at ??:??
0x00000000 - 
  at ??:??
0x000005f2 - 
  at ??:??
0x00000355 - 
  at ??:??
0x3fc9a7e4 - _static_data_end
  at ??:??
0x3fc9a908 - _static_data_end
  at ??:??
0x3fc9a898 - _static_data_end
  at ??:??
0x40386ff0 - xQueueSemaphoreTake
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/freertos/queue.c:1549
3fc9b380: 0x00000000 0x00000001 0x3fc9b40c 0x00000000 0x00000000 0x3fc991dc 0x00000002 0x00000000
0x00000000 - 
  at ??:??
0x00000001 - 
  at ??:??
0x3fc9b40c - _static_data_end
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x3fc991dc - _static_data_end
  at ??:??
0x00000002 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b3a0: 0x00000000 0x00000000 0x00000000 0x00000355 0x3fc9a7e4 0x3fc9a908 0x3fc9a898 0x40380c68
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000355 - 
  at ??:??
0x3fc9a7e4 - _static_data_end
  at ??:??
0x3fc9a908 - _static_data_end
  at ??:??
0x3fc9a898 - _static_data_end
  at ??:??
0x40380c68 - acquire_core
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/driver/spi_bus_lock.c:363
3fc9b3c0: 0x40388bd0 0x40388768 0x3fc9ac64 0x3fc9b418 0x3fc9a7e4 0x3fc9a908 0x00000102 0x403809e4
0x40388bd0 - vPortClearInterruptMask
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/freertos/port/riscv/port.c:344
0x40388768 - ulTaskGenericNotifyTake
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/freertos/tasks.c:5403
0x3fc9ac64 - _static_data_end
  at ??:??
0x3fc9b418 - _static_data_end
  at ??:??
0x3fc9a7e4 - _static_data_end
  at ??:??
0x3fc9a908 - _static_data_end
  at ??:??
0x00000102 - 
  at ??:??
0x403809e4 - spi_device_polling_start
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/driver/spi_master.c:947
3fc9b3e0: 0x3fc92ac0 0x00000001 0x00000001 0x3fc9b46b 0x3fc9abf8 0x00000001 0x3fc9a908 0x40380b24
0x3fc92ac0 - pxCurrentTCB
  at ??:??
0x00000001 - 
  at ??:??
0x00000001 - 
  at ??:??
0x3fc9b46b - _static_data_end
  at ??:??
0x3fc9abf8 - _static_data_end
  at ??:??
0x00000001 - 
  at ??:??
0x3fc9a908 - _static_data_end
  at ??:??
0x40380b24 - spi_device_polling_transmit
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/driver/spi_master.c:1001
3fc9b400: 0x3fc9abf8 0x00000001 0x00000107 0x42039a8a 0x000005f2 0x3c08d28c 0x00000004 0x00000002
0x3fc9abf8 - _static_data_end
  at ??:??
0x00000001 - 
  at ??:??
0x00000107 - 
  at ??:??
0x42039a8a - w5500_read
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_mac_w5500.c:96
0x000005f2 - 
  at ??:??
0x3c08d28c - __FUNCTION__.7563
  at ??:??
0x00000004 - RV_STK_RA
  at ??:??
0x00000002 - 
  at ??:??
3fc9b420: 0x00000008 0x00000000 0x00000008 0x00000008 0x00000000 0x00000000 0x3fc9b46b 0x00000000
0x00000008 - RV_STK_SP
  at ??:??
0x00000000 - 
  at ??:??
0x00000008 - RV_STK_SP
  at ??:??
0x00000008 - RV_STK_SP
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x3fc9b46b - _static_data_end
  at ??:??
0x00000000 - 
  at ??:??
3fc9b440: 0x00020008 0x3fc9cf9c 0x3fc9abf8 0x00000004 0x00020008 0x3fc9cf9c 0x3fc9abf8 0x42039d80
0x00020008 - 
  at ??:??
0x3fc9cf9c - _static_data_end
  at ??:??
0x3fc9abf8 - _static_data_end
  at ??:??
0x00000004 - RV_STK_RA
  at ??:??
0x00020008 - 
  at ??:??
0x3fc9cf9c - _static_data_end
  at ??:??
0x3fc9abf8 - _static_data_end
  at ??:??
0x42039d80 - emac_w5500_task
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_mac_w5500.c:329
3fc9b460: 0x00000000 0x00000000 0x04000000 0x00000062 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x04000000 - 
  at ??:??
0x00000062 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b480: 0x00000000 0x00000000 0x00000000 0x40388b5a 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x40388b5a - _prvTaskExitError
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/freertos/port/riscv/port.c:164
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b4a0: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000154
0x00000000 - 
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0xa5a5a5a5 - USB_SERIAL_JTAG
  at ??:??
0x00000154 - 
  at ??:??
3fc9b4c0: 0x3fc9b3c0 0x0000032b 0x3fc90ba4 0x3fc90ba4 0x3fc9b4c0 0x3fc90b9c 0x0000000a 0xc121dff4
0x3fc9b3c0 - _static_data_end
  at ??:??
0x0000032b - 
  at ??:??
0x3fc90ba4 - pxReadyTasksLists
  at ??:??
0x3fc90ba4 - pxReadyTasksLists
  at ??:??
0x3fc9b4c0 - _static_data_end
  at ??:??
0x3fc90b9c - pxReadyTasksLists
  at ??:??
0x0000000a - RV_STK_SP
  at ??:??
0xc121dff4 - USB_SERIAL_JTAG
  at ??:??
3fc9b4e0: 0x320423c6 0x3fc9b4c0 0x00000000 0x0000000f 0x3fc9acbc 0x30353577 0x73745f30 0xec53006b
0x320423c6 - 
  at ??:??
0x3fc9b4c0 - _static_data_end
  at ??:??
0x00000000 - 
  at ??:??
0x0000000f - RV_STK_GP
  at ??:??
0x3fc9acbc - _static_data_end
  at ??:??
0x30353577 - 
  at ??:??
0x73745f30 - USB_SERIAL_JTAG
  at ??:??
0xec53006b - USB_SERIAL_JTAG
  at ??:??
3fc9b500: 0x002b3b15 0x00000000 0x3fc9b4b0 0x0000000f 0x00000001 0x00000000 0x00000000 0x00000000
0x002b3b15 - 
  at ??:??
0x00000000 - 
  at ??:??
0x3fc9b4b0 - _static_data_end
  at ??:??
0x0000000f - RV_STK_GP
  at ??:??
0x00000001 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b520: 0x3fc93958 0x3fc939c0 0x3fc93a28 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000
0x3fc93958 - _static_data_end
  at ??:??
0x3fc939c0 - _static_data_end
  at ??:??
0x3fc93a28 - _static_data_end
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000001 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b540: 0x00000000 0x420685ae 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x420685ae - _cleanup_r
  at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/findfp.c:229
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b560: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b580: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b5a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b5c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b5e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
3fc9b600: 0x00000000 0x00000000 0x00000000 0x00000000 0x3f000000 0x0000004c 0x4203b34e 0x4203b1d6
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x00000000 - 
  at ??:??
0x3f000000 - __eh_frame_hdr
  at ??:??
0x0000004c - RV_STK_S3
  at ??:??
0x4203b34e - w5500_set_mediator
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:95
0x4203b1d6 - w5500_reset
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:115
3fc9b620: 0x4203b192 0x4203b2ba 0x4203af64 0x4203b0d0 0x4203af68 0x4203af50 0x4203af54 0x4203b304
0x4203b192 - w5500_reset_hw
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:133
0x4203b2ba - w5500_init
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:207
0x4203af64 - w5500_deinit
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:226
0x4203b0d0 - w5500_negotiate
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:147
0x4203af68 - w5500_get_link
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:104
0x4203af50 - w5500_pwrctl
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:167
0x4203af54 - w5500_set_addr
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:172
0x4203b304 - w5500_get_addr
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_eth/src/esp_eth_phy_w5500.c:179



ELF file SHA256: 0000000000000000

Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x40381162
0x40381162 - esp_restart_noos_dig
  at /home/al9hu7/.espressif/esp-idf/release-v4.4/components/esp_system/esp_system.c:44
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x16ec

teamplayer3 avatar Dec 04 '22 17:12 teamplayer3

Oh well. Will need to debug it for real in the next days. :) In any case, the fix I pushed should be there.

ivmarkov avatar Dec 04 '22 17:12 ivmarkov

@teamplayer3 is this still a problem after merge of 2175300370ac49875bb85b02c0a066b1b09320b0

Vollbrecht avatar Mar 29 '23 15:03 Vollbrecht

Will check it tomorrow.

teamplayer3 avatar Mar 29 '23 16:03 teamplayer3

@Vollbrecht I have updated my code to the latest api version. I still get the exact same error.

teamplayer3 avatar Mar 30 '23 13:03 teamplayer3