The problem might be due to the fact that flash write operations should not be performed repetitiously in a loop. This is because, each write operation in flash will take some time. Also, some internal processes (like garbage collection) etc will be performed on each write. Hence, as the amount of data in the flash increases, each of these operations (garbage collection etc) will take more and more time.
Hence, as a precaution, you should subscribe to a timer after each call to adl_flhWrite () API and only in the timer handler should you write to the flash again. This will provide enough time to ADL library to perform internal stuff (like garbage collection etc).
When you use a loop to write to flash (instead of using a timer), your Open-AT application will issue adl_flhWrite () APIs to ADL library without any consideration for the time it takes to actually write into flash.
This might cause stack overflow (as now ADL internal functions are in process and your applicaiton still makes calls to adl_flhWrite ()) or may also cause watchdog reset (as OAT is not leaving the CPU).
Hence, it is best to write to flash using a timer when the number of flash objects to write is greater than 100.