RAK439初始化失败,返回5B,会死在customer_assert里面,请问什么问题



  • 0_1533534514759_QQ图片20180806120634.png
    0_1533534524150_QQ图片20180806131715.png
    请问这是什么情况?



  • ![0_1533712588845_IMG_20180808_120123.jpg](正在上传 100%)
    已解决,调试这个一定要注意SPI的时序,这个模块的CLK空闲时电平,第2个跳变沿读写数据,一定要注意这点。所以要注意SPI的极性为高,相位为2。还有使用HAL库时,注意程序的编写,以下是我的读写程序。
    static unsigned char SPI_WriteReadbyte(unsigned char write_data)
    {
    unsigned char read_data;
    if(HAL_SPI_TransmitReceive(&hspi1,&write_data,&read_data,1,0xffff)!=HAL_OK)
    {
    return 0;
    }
    return read_data;
    }

    static void _spi_io_buffer(uint8_t* write, uint8_t* read, uint16_t len)
    {
    uint8_t recv=0,dummy=0;
    uint32_t i=0;
    SetWifiCSOnOff(0);
    if(read == NULL)
    {
    for(i=0;i<len;i++)
    {
    if(write == NULL)
    {
    recv=SPI_WriteReadbyte(dummy);
    }
    else
    {
    recv=SPI_WriteReadbyte(write[i]);
    }
    // DPRINTF("send=%x ",write[i]);
    // DPRINTF("recv dummy=%x\r\n",dummy);
    }
    }
    else
    {
    for(i=0;i<len;i++)
    {
    if(write == NULL)
    {
    read[i]=SPI_WriteReadbyte(dummy);
    // DPRINTF("send dummy=%x ",dummy);
    }
    else
    {
    read[i]=SPI_WriteReadbyte(write[i]);
    // DPRINTF("send=%x ",write[i]);
    }
    }
    }
    SetWifiCSOnOff(1);
    }


登录后回复
 

与 RAK支持中心 的连接断开,我们正在尝试重连,请耐心等待