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

Need information about Keil UV2

Dear all, I am using the keil UV2 for one of my application. In this application, I need to include files concept. For this, I write the program as follows,
#include <stdio.h>
int main()
{ FILE *fp; fp = fopen("c:\\RTC_Configuration.txt", "r");
} After compiling this program, it was showing the following error,

error c202: 'FILE' : undefined identifier
error c202: 'fp' : undefined identifier

Exactly, what is this error? how can I removed from the application? Whether keil UV2 will support files concept or not?

Regards,
Vijay

Parents
  • Right now, you are programming a PC program.

    But you have specified C51 as compiler, i.e. that you are using a 8051 processor.

    The 8051 is not mounted in a PC.
    There are no harddrive (HDD or SSD).
    There are no flppy drive.
    There are no operating system (OS) like MS-DOS or Windows XP.

    If you want your programs to use files, then you must either buy, write or download code that implements a file system. And this file system implementation must interface with some memory accessible by your processor for actually storing this file data.

    If the specific processor have flash sectors in the code area that can be reprogrammed by the application (IAP = In Application Programming), then that is sometimes used to just store configuration data directly. So no file system is used. The program just specifies the address in the memory, where the data is stored.

    With chips that have an internal EEPROM, that is often used for storing configuration - in this case you can instead normally reprogram the data byte-by-byte.

    With chips without IAP-capable flash and without internal EEPROM, you would normally have to design a system with external memory. Probably EEPROM or F-RAM connected using I2C or SPI together with a utility code to perform the actual memory accesses.

    But the first thing you must realize is that you can not think "PC" when you write programs for embedded systems. They just don't have the required PC capabilities to run programs written like that.

Reply
  • Right now, you are programming a PC program.

    But you have specified C51 as compiler, i.e. that you are using a 8051 processor.

    The 8051 is not mounted in a PC.
    There are no harddrive (HDD or SSD).
    There are no flppy drive.
    There are no operating system (OS) like MS-DOS or Windows XP.

    If you want your programs to use files, then you must either buy, write or download code that implements a file system. And this file system implementation must interface with some memory accessible by your processor for actually storing this file data.

    If the specific processor have flash sectors in the code area that can be reprogrammed by the application (IAP = In Application Programming), then that is sometimes used to just store configuration data directly. So no file system is used. The program just specifies the address in the memory, where the data is stored.

    With chips that have an internal EEPROM, that is often used for storing configuration - in this case you can instead normally reprogram the data byte-by-byte.

    With chips without IAP-capable flash and without internal EEPROM, you would normally have to design a system with external memory. Probably EEPROM or F-RAM connected using I2C or SPI together with a utility code to perform the actual memory accesses.

    But the first thing you must realize is that you can not think "PC" when you write programs for embedded systems. They just don't have the required PC capabilities to run programs written like that.

Children
No data