0

I am working on stm32f107VCx microprocessor.

my compiler is keil and I am using spl (standard peripheral library).

I can send and recieve data with UDP protocol but I dont know how to save this strings that I have given from UDP. Actually I want to save this strings into a file in my PC.

amiroruji72
  • 17
  • 2
  • 6
  • Could you please clarify? You have a controller, and you want to transfer some strings from there to your PC, using UDP protocol, and then save them to a file, is that right? – Martin James Aug 29 '17 at 20:28
  • https://stackoverflow.com/questions/11573974/write-to-txt-file – yano Aug 29 '17 at 21:38
  • You have to write an application. Look at python and see what you can do. – Jeroen3 Aug 30 '17 at 06:18

1 Answers1

2

My suggestion: connect the STM.. and the PC via a RS-232 bus. Then have the STM.. send the strings over the bus to the PC.

Have the PC read the RS-232 bus and write the resulting data to some file.

if it were me, I would implement some protocol so the STM.. can tell the PC how many bytes are in each string to be saved and have the STM.. append some checksum so the PC can validate the string.

Suggest the PC reply with a ACK or NAK so the STM.. knows if the transfer of the string was successful (or not)

Do note that the RS-232 bus will be MUCH slower than the UDP communications, so some strings may be lost as the PC cannot keep up with the rate the data is coming into the STM..

Given the UDP is not a guaranteed communication protocol, I would expect the losses would be acceptable.

user3629249
  • 16,402
  • 1
  • 16
  • 17