This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

store data in a file

hi sir, I am using stm32f103 for real time application .I want to store the output values in a file in PC that i am having in array .how to approach for this??

Parents
  • That's certainly one approach.

    You could use printf() on the target to format the data in a manner you want, and then use a terminal app to pipe that data for a file on the host pc.

    You could also transmit blocks of data using X/Y-Modem.

    You could also format your data into a structure/packet and transmit that.

    What kind of programming or computer science foundation do you have?

Reply
  • That's certainly one approach.

    You could use printf() on the target to format the data in a manner you want, and then use a terminal app to pipe that data for a file on the host pc.

    You could also transmit blocks of data using X/Y-Modem.

    You could also format your data into a structure/packet and transmit that.

    What kind of programming or computer science foundation do you have?

Children
  • thanks, i am using c coding in keil microvision4.sir,
    problem:-while using printf the program counter is not entering to the main() function . what is the purpose of retarget.c in blinky project of keil? Is it for file handling ?
    can't we do file handling here ?

  • I thought we went over that before. The primary purpose is to bind STDIO file streams to specific resources on board your using. The serial example binds to the USART hardware of the STM32. If your board permitted the connection of a keyboard, you could perhaps interface to that. Thus you now get the scanf(), printf() functionality you expect, and Keil C runtime libraries don't need to know anything about of oddities of your hardware, and are thus generic.

    It might permit other FILE based IO, but at that level you're basically adding another level of abstraction to the file system and mass storage drivers you are going to have to supply.

    There might be other semihosting features, but I can't sell systems that are tied to a debugger, and so haven't focused on them. The primary goal with this kind of embedded development is to build free standing systems, which have just enough OS and other resources to get the job done.