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

Using the Flash File System with microlib

I read through the documents that stated that the microlib doesn't support the Flash File System. I am curious if there's a work around for this. In the project, if I don't select the microlib checkbox, the code doesn't run correctly with RTX. I want to use the RTX OS but it seems like without the microlib, it doesn't jump to main when I started to debug. Any suggestions?

Thanks,
Tom

Parents
  • After I've included retarget.c, I get a bunch of unresolved symbols, i.e.,

    __fclose
    __flushbuf
    __fopen
    __getfsize
    __read
    ...
    ...

    Aren't these functions part of the C-library? Since I am not using the microlib than I thought it would default to the standard C-library. Is this true?

    Thanks,
    Tom

Reply
  • After I've included retarget.c, I get a bunch of unresolved symbols, i.e.,

    __fclose
    __flushbuf
    __fopen
    __getfsize
    __read
    ...
    ...

    Aren't these functions part of the C-library? Since I am not using the microlib than I thought it would default to the standard C-library. Is this true?

    Thanks,
    Tom

Children
  • Ok, after I fiddled around I got it to compile and link correctly and jump to main. Now, I got a situation where I use fopen to create a file and wrote a bunch of data and called fclose to flush the data to the flash. The file is created but it's empty. Is there something I am missing again? I followed the instructions for the RL-FlashFS but the result seems to be the same whatever I tried. Is the RL-FlashFS fully implemented? My main goal is to write some configuration data in the flash and have it read back upon reset.

    Thanks,
    Tom

  • Also, I found that it was not jumping to main because the startup file didn't specify an initial size for the heap. That was probably the main reason that it was not jumping to main.

    Thanks,
    Tom

  • The standard runtime library prints errors on _ttywrch() function. You can catch the errors if you install a buffer into this function and store characters there. If you have done that, you would see the printed message "Out of heap memory". This error would be printed from premain code.