~aleteoryx/muditaos

6934d02455f95ecde8d7e86d6bb91101d6402d63 — Marek Niepieklo 4 years ago 8c53ac5
[CP-346] USB stops working during file transfer

Increased CDC receive queue length to 1024 elements
Improved debug output in Filesystem EP
M module-services/service-desktop/endpoints/filesystem/FileOperations.cpp => module-services/service-desktop/endpoints/filesystem/FileOperations.cpp +3 -3
@@ 144,7 144,7 @@ auto FileOperations::getFileHashForReceiveID(transfer_id rxID) -> std::string

auto FileOperations::getDataForReceiveID(transfer_id rxID, std::uint32_t chunkNo) -> std::string
{
    LOG_DEBUG("Getting data for rxID %u", static_cast<unsigned>(rxID));
    LOG_DEBUG("Getting chunk %u for rxID %u", static_cast<unsigned>(chunkNo), static_cast<unsigned>(rxID));

    const auto fileCtxEntry = readTransfers.find(rxID);



@@ 188,7 188,7 @@ auto FileOperations::createTransmitIDForFile(const std::filesystem::path &file,
    cancelTimedOutWriteTransfer();
    const auto txID = ++runningXfrId;

    LOG_DEBUG("Creating rxID %u", static_cast<unsigned>(txID));
    LOG_DEBUG("Creating txID %u", static_cast<unsigned>(txID));

    createFileWriteContextFor(file, size, Crc32, txID);



@@ 198,7 198,7 @@ auto FileOperations::createTransmitIDForFile(const std::filesystem::path &file,
auto FileOperations::sendDataForTransmitID(transfer_id txID, std::uint32_t chunkNo, const std::string &data)
    -> sys::ReturnCodes
{
    LOG_DEBUG("Transmitting data for txID %u", static_cast<unsigned>(txID));
    LOG_DEBUG("Transmitting chunk %u for txID %u", static_cast<unsigned>(chunkNo), static_cast<unsigned>(txID));
    auto returnCode = sys::ReturnCodes::Success;

    const auto fileCtxEntry = writeTransfers.find(txID);

M module-services/service-desktop/service-desktop/ServiceDesktop.hpp => module-services/service-desktop/service-desktop/ServiceDesktop.hpp +1 -1
@@ 26,7 26,7 @@ namespace sdesktop
{
    inline constexpr auto service_stack             = 8192;
    inline constexpr auto worker_stack              = 8704;
    inline constexpr auto cdc_queue_len             = 32;
    inline constexpr auto cdc_queue_len             = 1024;
    inline constexpr auto cdc_queue_object_size     = 1024;
    inline constexpr auto irq_queue_object_size     = sizeof(bsp::USBDeviceStatus);
    inline constexpr auto file_transfer_timeout     = 5000;