URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
[/] [neorv32/] [trunk/] [sw/] [bootloader/] [bootloader.c] - Diff between revs 12 and 13
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 12 |
Rev 13 |
Line 240... |
Line 240... |
// ------------------------------------------------
|
// ------------------------------------------------
|
// Auto boot sequence
|
// Auto boot sequence
|
// ------------------------------------------------
|
// ------------------------------------------------
|
neorv32_uart_print("\n\nAutoboot in "xstr(AUTOBOOT_TIMEOUT)"s. Press key to abort.\n");
|
neorv32_uart_print("\n\nAutoboot in "xstr(AUTOBOOT_TIMEOUT)"s. Press key to abort.\n");
|
|
|
uint64_t timeout_time = (uint64_t)(AUTOBOOT_TIMEOUT * clock_speed);
|
uint64_t timeout_time = neorv32_mtime_get_time() + (uint64_t)(AUTOBOOT_TIMEOUT * clock_speed);
|
|
|
while ((UART_DATA & (1 << UART_DATA_AVAIL)) == 0) { // wait for any key to be pressed or timeout
|
while ((UART_DATA & (1 << UART_DATA_AVAIL)) == 0) { // wait for any key to be pressed or timeout
|
|
|
if (neorv32_mtime_get_time() >= timeout_time) { // timeout? start auto boot sequence
|
if (neorv32_mtime_get_time() >= timeout_time) { // timeout? start auto boot sequence
|
get_exe(EXE_STREAM_FLASH); // try loading from spi flash
|
get_exe(EXE_STREAM_FLASH); // try loading from spi flash
|
neorv32_uart_print("\n");
|
neorv32_uart_print("\n");
|
Line 572... |
Line 573... |
}
|
}
|
|
|
neorv32_cpu_dint(); // deactivate IRQs
|
neorv32_cpu_dint(); // deactivate IRQs
|
neorv32_gpio_port_set(1 << STATUS_LED); // permanently light up status LED
|
neorv32_gpio_port_set(1 << STATUS_LED); // permanently light up status LED
|
|
|
|
asm volatile ("wfi"); // power-down
|
while(1); // freeze
|
while(1); // freeze
|
}
|
}
|
|
|
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.