Hi there,
I have some very (!) limited experience of using Keil uVision with an ST STM32 Nucleo-32 STM32L432KC development board. In the past I've written some "dummy" data, in the form of a series of decimal numbers, to a variable and then transmitted that using the UART Tx pin. That's more or less the extent of my experience.
What I'd like to do now is transmit a .txt file from one PC to another, via two of those microcontrollers and their serial pins:
1) read a .TXT file saved on a (Windows) PC that the Transmitting micro-controller is connected to.
2) transmit this data using the serial UART pin.
I guess steps 1) & 2) would require converting the ASCII characters to binary bits...
3) At the Receiver micro-controller, I'd like to read this serial data, convert it back into text and finally...
4) Save the received text as a .TXT file.
------ By the way, the .txt files could be relatively large (e.g. 5 Mb) so I may not be able to store all the received data in memory before dumping it to the .txt file.
Is this something that is possible to do using uVision? If so, would anyone be able to give some pointers on how to read and write .txt files?
Many thanks in advance and apologies if my question is too vague or off-topic for these forums.
Jonathan
You look to be tunneling a serial connection across several USART and a optical link. You'd need to manage the buffering, flow control, and integrity. You basically want to ensure the data you stuff in one end of the tunnel arrives unmolested at the other end. ie same data, same order, etc.
Familiarity with FILE IO using fopen/fread/fwrite/fseek/ftell/fclose? Data within the file is just collection of bytes, the OS doesn't care if they are ASCII, spreadsheets or executable code. On Windows boxes opening a COM port uses CreateFile, with data sent/received using WriteFile/ReadFile.
X-MODEM is frequently used for point-to-point transfer of files, sending ASCII data infers no size, and provides no integrity. The protocol provides a means of expressing a start and ending point, but does round the file size up to 128 or 1024 blocks. It is relatively simple to implement from scratch as it isn't that complicated. Y-MODEM provides file names and sizes.
Many Terminal applications implement it, and other protocols, for file transfers (think BBS from the 1990's).