AnsweredAssumed Answered

STM32F4 file transfer via bluetooth

Question asked by mordasov.ilya on Nov 19, 2015
Latest reply on Nov 20, 2015 by mordasov.ilya
Hi there, I'm trying to receive file which has been sending from my laptop to my stm32f4discovery using usart via bluetooth HC-06.

If I send just text data it works fine, but when I try to send some file (it's about 40kB) I see nothing

My handler for receiving anything from usart looks like this:

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
    __HAL_UART_FLUSH_DRREGISTER(&huart3); // Clear the buffer to prevent overrun
 
    if (rxBuffer == '\n' || rxBuffer == '\r') // rxBuffer is uint8_t rxBuffer = 0;
    {
        char buf[40000];
        char msg[100];
        sprintf(buf, "%s\n", restring); // rxString is uint8_t rxString[45000]; 45kB for data
        print(but); // my own function to print in serial port
    }
}

I guess the problem could be in detection of file end. How to detect EOF?

Outcomes