We've developed our product for the electrical domain, in our produced we've used LPC2468 microcontroller with ARM7 architecture. In our product we are using Keil RTX operating system and its flash file system. We are having the 4MB external NOR flash memory, in that flash file system has ported for store the files. In our source code, we are not able to see the source code of flash file system, it is in the form of library it seems. Recently we are facing issue that, microcontroller rebooting during the flash file system, when source invoke the finit() API system is getting reboot. We are not able to fix this issue because it is in the form of library, so please let us know how to fix this issue? and what would be the reason for reboot during the flash file system?.
It is hard to give you hints because I don't know your application. When I understand you correctly, you see a reboot of your target system when you call the finit() library function. Does that happen every time? In most applications, finit() is only called once when the application starts. Is this the case in your application as well or do you initialize the Flash filesystem multiple times in your application before you write data to the file system?
Since there are no standard ways to perform a reset in an application, our libraries cannot cause a reset. There are only a few possible scenarios:
Do you see this issue also in a debug session? If yes, you could track where this issue comes from by setting breakpoints in the startup code or in exception handlers.
Thanks for your reply.
1) In our application, we've enabled the watchdog timer. In our code in the critical areas we are feeding the watchdog timer.
2) When we invoke the finit() function, it is giving me an watchdog reset. After disable the watchdog, simply it is going into the hanging state.
Since we are using the library of flash file system(FS_ARM_L.lib), so we are not able to see what is happening inside the finit() function. But this issue is happening only in particular devices, not all the device. From our end, we've completely erase the NOR flash chip using EraseChip() function, but still it is resetting or hanging during the file system initialization. So please help us to diagnosis the root cause of the issue.
OK, good to know that the reset is caused by the watchdog timer. Now you should try to find out why the application waits in an endless loop.
You wrote: "Since we are using the library of flash file system(FS_ARM_L.lib), so we are not able to see what is happening inside the finit() function". I already mentioned in an email to you and your colleagues that your company purchased the source code of the Flash file system many years ago. So why don't you use it?On the other hand, I doubt that there is an endless loop in the library that does not call functions of the Flash driver functions. Even if your application hangs somewhere in the function finit(), you should see calls to functions in the module File_lib.c and also other Flash driver functions. If you stop the application in the debugger, you should see in what endless loop your application is caught (in the disassembly window), and I'm pretty sure that with some single steps, you reach some Flash driver functions which check the status of your Flash. Then you have an indication of what status causes this issue.