I try to use RL-FlashFs read file from a SDcard
in a RL-rtx task.
It dosnot work.
Debug , Cannot go to main() .
RL-FlashFs Can work with RL-rtx?
Just a question: Where do you "park" your program when you do return from main()?
When main() returns:
http://www.keil.com/support/man/docs/armlib/armlib_chdegjfd.htm
__rt_entry
The symbol __rt_entry is the starting point for a program using the ARM C library. Control passes to __rt_entry after all scatter-load regions have been relocated to their execution addresses.
The default implementation of __rt_entry: 1. Sets up the heap and stack. 2. Initializes the C library, by calling __rt_lib_init. 3. Calls main(). 4. Shuts down the C library, by calling __rt_lib_shutdown. 5. Exits.
__rt_entry must end with a call to one of the following functions:
exit() Calls atexit()-registered functions and shuts down the library.
__rt_exit() Shuts down the library but does not call atexit() functions.
_sys_exit() Exits directly to the execution environment. It does not shut down the library and does not call atexit() functions. See _sys_exit().
Yes, that was a lot of text - but the interesting thing is what your processor will do if you end your program.
"Exits directly to the execution environment" sounds nice, but without a command line prompt or a GUI in the embedded system, it is normally best to write applications so they never leave main, or so that they get stuck in a busy-loop while waiting for the watchdog to restart.
Hi Per,
Many thanks.
As you may already noticed that, actually, I don't really understand the content of that url/documentation.
I have being curious about why are so many endless-loops there in the source code. Now I realize that, it is there for "waiting for the watchdog to restart".
But I still don't understand what does "shuts down the library" means?
We may only guess what it means to shut down the library. But let's assume that they mean that if you are using a flash file system, they will try to make sure that all changes are flushed to disk before your program dies. If you have the networking library, possibly send out information to close any remaining connections.