Question
STM32F4 file transfer via bluetooth
Posted on November 19, 2015 at 12:09
Hi there, I'm trying to receive file which has been sending from my laptop to my stm32f4discovery using usart via bluetooth HC-
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?
#stm32f3 #usart #stm32