This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/MSP432-RTOS: MSP-EXP432P401R

Part Number: MSP432-RTOS
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

I have an MSP-EXP432P401R ansd I am using CCS. Can I use the fatsd functions like fopen, fwrite, etc. in the main() fucntion and completely avoid using a task fucntion (taskfxn)?

  • Are you writing an application that will use TI-RTOS (SYS/BIOS)?

    If so then you should consider doing all of your "work" (such as file operations) in a Task thread. It will be much easier this way.

    But maybe you are trying to avoid using the RTOS ...?

    To answer your question, just calling the fopen, etc. functions in main won't work. This is because BIOS does some initialization of the FatFS module during BIOS' startup. This happens after the call to BIOS_start() in main(). Furthermore, the FatFS code relies on the BIOS Semaphore module, and calls Semaphore_pend() with a timeout > 0 (see syncsysbios.c in the fatfs folder). You can't call Semaphore_pend() from within main() unless the timeout is set to zero.

    I suppose you could try "hacking" this by doing this init stuff from within main() [see the ti_sysbios_fatfs_startup() function, it's generated in the "Debug" or "Release" folder of your project build in a *.c file, or you can look at the FatFS.xdt file which is used to generated it].

    The main thing that's done there is to call the codegen driver init function "add_device()". See the function for full details.

    But, it seems like it would be much easier just to use a Task thread and let SYS/BIOS do all of this initialization and set up for you.

    Also, if you do try to "hack" around the OS, then support will be limited here.

    Steve
  • Hi Steve.

    Thanks for your response. It helps a lot. Just to answer your question; I just want to use SD card with file management to store data. I am not sure if there is any other way to do it other than using RTOS. If I can avoid RTOS, I would prefer that. 

  • I had a quick look at the FatFS website.  I was hoping it might state specifically that it can be used without an operating system, but I didn't see anything mentioned.  I did see that it said it supports an RTOS.

    You might give their site a walk through and draw your own conclusion, or post a question to the FatFS user forum.

    Steve