Sifive hifive b wifi: only receive 'C'

when I send ‘AT’ command to esp32 from spi1, getting ‘C’ response.

but send ‘AT’ to esp32, should be get ‘OK’.

environment:
freedom-sdk
ubuntu 20.04 x64

main.c:

drive_spi.h

#include “drive_spi.h”:

volatile SPI_STRUCT *spi_init(uint32_t spi_adress)
{
volatile SPI_STRUCT new_spi_device = (volatile SPI_STRUCT)spi_adress;
return new_spi_device;
}

drive_spi.c

thanks a lot.

SPI protocol used for communication with the WiFi chip is more complex than that. It requires 3 transactions for each read or write. See for example: https://github.com/riscv-rust/riscv-rust-quickstart/blob/5ff7048687e807b52d3df0d05dd0729a7c52bf79/examples/spi_wifi.rs#L65-L67

1 Like

Thank for your reply. I try it.