title: C file functions in embedded world
body: <p>I have a problem with an embedded system and one library.</p>
  
  <p>I am currently working with a device called Ambiq [3] which use a Cortex M-4 and I want to use the FANN (Fast artificial neural network) library [2] on it.
  I am able to compile and link everything, but the problem is that the FANN library requires 2 files to read when starting.</p>
  
  <p>Now, I have an embedded system, so I don't have any file system and neither a operating system.
  I'm quite sure that I can, in some way, write the content of that file inside the flash memory but I don't really know how can I link the first file address to the C file functions such as the "fopen" which require a file name as input. I only need some connection between the file name and the physical address of the file and I am done if it exits (or a C function that accept something different from a file name).</p>
  
  <p>One thing that I already tried is to hard-code the content of the file into a C-array using xxd -i [filename] [1] but I don't know how should I link the fopen that the FANN library use. I've also started some cleaver parser but it seems to be really time consuming.</p>
  
  <p>Please let me know if you can suggest me something.
  Thank you in advance.
  Best regards.
  Jaskirat</p>
  
  <p>Additional information:
  - Software used for compiling: Eclipse with makefile.
  - Compiler: eabi-none-gcc toolbox
  - I am compiling directly the FANN library source code with the Ambiq microcontroller application that should run on the Cortex M4.</p>
  
  <p>References:
  [1] <a href="https://stackoverflow.com/questions/19638557/read-a-file-into-a-string-at-compile-time">Read a file into a string at compile-time</a>
  [2] FANN LIBRARY UFFICIAL SITE <a href="http://leenissen.dk/fann/wp/" rel="nofollow noreferrer">http://leenissen.dk/fann/wp/</a>
  [3] AMBIQ MICRO: <a href="http://ambiqmicro.com/" rel="nofollow noreferrer">http://ambiqmicro.com/</a></p>