USB DFU

 SerialPort.setPortName(name);
    SerialPort.setBaudRate(QSerialPort::Baud115200);
    //设置数据位数

    SerialPort.setDataBits(QSerialPort::Data8);

    // 设置校验位
    //SerialPort->setParity(QSerialPort::NoParity);
    //设置奇偶校验
    SerialPort.setParity(QSerialPort::NoParity);


    // 设置流控制
    SerialPort.setFlowControl(QSerialPort::NoFlowControl);
    //设置停止位
    SerialPort.setStopBits(QSerialPort::OneStop);
     qDebug() << "Application path:" << name;
    // 打开串口
    if(SerialPort.open(QIODevice::ReadWrite))
    {
        // 设置波特率


        //qDebug() <<SerialPort.waitForBytesWritten(3000);
        //SerialPort.close();
    }

    //打开串口
    else
    {
        QMessageBox::about(NULL, "提示", "串口无法打开\r\n不存在或已被占用");
        return;

    }

I am using qt C++ to refactor the dfu master station, currently I have a problem, that is, I want to communicate with 52840 simulated com but failed, I initialize, you see this is correct, I try to initialize the send command 0x06,0x01,0x0c after successful sending DFU did not respond, I want to know what's wrong. Thank you

Parents
  • If you’re using an nRF52840 over a virtual COM port, the issue is likely not Qt but the DFU protocol itself.

    A few things to check:

    • Make sure the nRF52840 is actually in DFU mode, not normal application mode.

    • Verify baud rate, parity, stop bits, and flow control match the device settings.

    • Confirm that 0x06, 0x01, 0x0C is valid for the specific DFU protocol you’re using (Nordic Secure DFU is packet-based and not simple raw commands).

    • Check whether the device expects SLIP encoding or a specific packet structure (init packet + CRC).

    • Use a serial sniffer or log the raw TX/RX data to confirm the device is receiving the bytes. eggy car

    If this is Nordic Secure DFU, you cannot just send raw hex commands — the packets must follow the DFU transport protocol.

Reply
  • If you’re using an nRF52840 over a virtual COM port, the issue is likely not Qt but the DFU protocol itself.

    A few things to check:

    • Make sure the nRF52840 is actually in DFU mode, not normal application mode.

    • Verify baud rate, parity, stop bits, and flow control match the device settings.

    • Confirm that 0x06, 0x01, 0x0C is valid for the specific DFU protocol you’re using (Nordic Secure DFU is packet-based and not simple raw commands).

    • Check whether the device expects SLIP encoding or a specific packet structure (init packet + CRC).

    • Use a serial sniffer or log the raw TX/RX data to confirm the device is receiving the bytes. eggy car

    If this is Nordic Secure DFU, you cannot just send raw hex commands — the packets must follow the DFU transport protocol.

Children
No Data
Related