Permalink
Browse files

[grifo] 16GB card does not always load

Some 16GB SD Cards are taking too long to load and this is causing a
watchdog timeout during the loading of ELF files (primarily WIKI.APP).
A watchdog timeout simply powers off the unit.

Fix is to refresh the watchdog timer more frequently.

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
hxw committed May 25, 2012
1 parent 996d5b6 commit 627d3fc91a56d4a544683e57c557cbf8e340fd79
Showing with 4 additions and 0 deletions.
  1. +4 −0 samo-lib/grifo/src/elf32.c
@@ -25,6 +25,7 @@
#include "serial.h"
#include "file.h"
#include "elf32.h"
+#include "watchdog.h"
// 0 = no-debugging
// 1 = serious errors
@@ -116,6 +117,7 @@ ELF32_ErrorType ELF32_load(uint32_t *execution_address,
uint32_t *highest_free_address,
const char *filename)
{
+ Watchdog_KeepAlive(WATCHDOG_KEY);
int rc = ELF32_OK;
*highest_free_address = 0; // lowest possible address
@@ -167,6 +169,7 @@ ELF32_ErrorType ELF32_load(uint32_t *execution_address,
int i;
for (i = 0; i < hdr.e_shnum; i++) {
+ Watchdog_KeepAlive(WATCHDOG_KEY);
elf32_sec sec;
File_lseek(handle, hdr.e_shoff + sizeof(sec) * i);
n = File_read(handle, &sec, sizeof(sec));
@@ -230,6 +233,7 @@ ELF32_ErrorType ELF32_load(uint32_t *execution_address,
// make sure every thing is cleaned up if the load fails fail
abort_close:
File_close(handle);
+ Watchdog_KeepAlive(WATCHDOG_KEY);
return rc;
}

0 comments on commit 627d3fc

Please sign in to comment.