mirror of
https://github.com/andreili/katapult.git
synced 2025-08-24 03:44:06 +02:00
lpc176x: Resync code with upstream Klipper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
da7cc967d0
commit
6f67a01a60
@ -41,6 +41,10 @@ config FLASH_SIZE
|
|||||||
hex
|
hex
|
||||||
default 0x80000
|
default 0x80000
|
||||||
|
|
||||||
|
config FLASH_BOOT_ADDRESS
|
||||||
|
hex
|
||||||
|
default 0x0
|
||||||
|
|
||||||
config RAM_START
|
config RAM_START
|
||||||
hex
|
hex
|
||||||
default 0x10000000
|
default 0x10000000
|
||||||
@ -53,13 +57,6 @@ config STACK_SIZE
|
|||||||
int
|
int
|
||||||
default 512
|
default 512
|
||||||
|
|
||||||
config FLASH_START
|
|
||||||
hex
|
|
||||||
default 0x0000
|
|
||||||
|
|
||||||
config FLASH_BOOT_ADDRESS
|
|
||||||
hex
|
|
||||||
default 0x0000
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Bootloader
|
# Bootloader
|
||||||
@ -67,15 +64,15 @@ config FLASH_BOOT_ADDRESS
|
|||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Build CanBoot deployment application"
|
prompt "Build CanBoot deployment application"
|
||||||
config LPC176X_FLASH_START_0000
|
config LPC_FLASH_START_0000
|
||||||
bool "Do not build"
|
bool "Do not build"
|
||||||
config LPC176X_FLASH_START_4000
|
config LPC_FLASH_START_4000
|
||||||
bool "16KiB bootloader"
|
bool "16KiB bootloader (Smoothieware bootloader)"
|
||||||
endchoice
|
endchoice
|
||||||
config FLASH_APPLICATION_ADDRESS
|
config FLASH_APPLICATION_ADDRESS
|
||||||
hex
|
hex
|
||||||
default 0x4000 if LPC176X_FLASH_START_4000
|
default 0x4000 if LPC_FLASH_START_4000
|
||||||
default 0
|
default 0x0000
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
@ -100,6 +97,10 @@ endchoice
|
|||||||
# Flash settings
|
# Flash settings
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
config FLASH_START
|
||||||
|
hex
|
||||||
|
default 0x0000
|
||||||
|
|
||||||
config LAUNCH_APP_ADDRESS
|
config LAUNCH_APP_ADDRESS
|
||||||
hex
|
hex
|
||||||
default 0x4000
|
default 0x4000
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
#include "autoconf.h" // CONFIG_CLOCK_FREQ
|
#include "autoconf.h" // CONFIG_CLOCK_FREQ
|
||||||
#include "board/armcm_boot.h" // armcm_main
|
#include "board/armcm_boot.h" // armcm_main
|
||||||
|
#include "board/armcm_reset.h" // try_request_canboot
|
||||||
|
#include "board/irq.h" // irq_disable
|
||||||
|
#include "board/misc.h" // bootloader_request
|
||||||
#include "internal.h" // enable_pclock
|
#include "internal.h" // enable_pclock
|
||||||
#include "sched.h" // sched_main
|
#include "sched.h" // sched_main
|
||||||
|
|
||||||
@ -37,6 +40,23 @@ DECL_INIT(watchdog_init);
|
|||||||
* misc functions
|
* misc functions
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
|
// Try to reboot into bootloader
|
||||||
|
void
|
||||||
|
bootloader_request(void)
|
||||||
|
{
|
||||||
|
if (!CONFIG_FLASH_APPLICATION_ADDRESS)
|
||||||
|
return;
|
||||||
|
try_request_canboot();
|
||||||
|
// Disable USB and pause for 5ms so host recognizes a disconnect
|
||||||
|
irq_disable();
|
||||||
|
if (CONFIG_USB)
|
||||||
|
usb_disconnect();
|
||||||
|
// The "LPC17xx-DFU-Bootloader" will enter the bootloader if the
|
||||||
|
// watchdog timeout flag is set.
|
||||||
|
LPC_WDT->WDMOD = 0x07;
|
||||||
|
NVIC_SystemReset();
|
||||||
|
}
|
||||||
|
|
||||||
// Check if a peripheral clock has been enabled
|
// Check if a peripheral clock has been enabled
|
||||||
int
|
int
|
||||||
is_enabled_pclock(uint32_t pclk)
|
is_enabled_pclock(uint32_t pclk)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user