Difference between revisions of "U-boot Watchdog"
Jump to navigation
Jump to search
(Created page with "==Required Items== * File:U-boot-imx6.zip ==Changing the source code to activate the watchdog== Extract the source code provided here and do the following: * Open /path_t...") |
|||
Line 18: | Line 18: | ||
} | } | ||
* Save and close this file. | * Save and close this file. | ||
+ | |||
==Compiling the source code== | ==Compiling the source code== | ||
In order to compile the source code, you have to run the following commands in the terminal: | In order to compile the source code, you have to run the following commands in the terminal: |
Latest revision as of 16:55, 12 December 2014
Required Items
Changing the source code to activate the watchdog
Extract the source code provided here and do the following:
- Open /path_to_source_code/drivers/watchdog/imx_watchdog.c;
- Delete #ifdef CONFIG_IMX_WATCHDOG from line 26, #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS from line 45, #endif from line 47 and #endif from line 53;
- Change the time interval from line 46 (default: #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000) to a value in miliseconds in the range 500 - 128000 with increments of 500;
BEWARE! DO NOT set this value to a small time interval that will not give you enough time to run the commands in the next section. This will brick your board and you will be unable to boot into linux or change the bootloader and an external programmer is needed to write another bootloader. If you can't even run the erase command until the watchdog kicks in, you will have to replace the NAND memory on the board.
- Save and close this file;
- Open /path_to_source_code/board/boundary/nitrogen6x/nitrogen6x.c
- Add the following line in the checkboard function (on line 928):
int checkboard(void) { ... hw_watchdog_init(); return 0; }
- Save and close this file.
Compiling the source code
In order to compile the source code, you have to run the following commands in the terminal:
cd /path_to_source_code/ export ARCH=arm export CROSS_COMPILE=arm-none-linux-gnueabi- make nitrogen6q_config make all
Writing the bootloader to the NAND memory
In order to write the bootloader to the NAND memory, you have to:
- Copy the u-boot.imx that was compiled in the previous section to the root of your linux sd card;
- Power up the board and press any key to stop autoboot
- Run the following commands in the u-boot terminal:
setenv mmcdev 0 mmc dev ${mmcdev} load mmc ${mmcdev}:1 0x10800000 u-boot.imx sf probe sf erase 0 0xc0000 sf write 0x10800000 0x400 ${filesize}
- Restart the board.