25#if (BOOT_COP_HOOKS_ENABLE > 0)
49class BlinkyThread :
public chibios_rt::BaseStaticThread<256> {
51 void main(
void)
override {
55 Gpio red = LED_CRITICAL_ERROR_BRAIN_PIN;
71#ifdef BOOTLOADER_ENABLE_OUTPUT_PIN
74 uint8_t en_pin =
getHwPin(
"blt-en-pin", BOOTLOADER_ENABLE_OUTPUT_PIN);
75 palSetPadMode(en_port, en_pin, PAL_MODE_OUTPUT_PUSHPULL);
76 palWritePad(en_port, en_pin, 1);
80#ifdef BOOTLOADER_ENABLE_OUTPUT_PIN2
83 uint8_t en_pin =
getHwPin(
"blt-en-pin2", BOOTLOADER_ENABLE_OUTPUT_PIN2);
84 palSetPadMode(en_port, en_pin, PAL_MODE_OUTPUT_PUSHPULL);
85 palWritePad(en_port, en_pin, 1);
89#ifdef BOOTLOADER_DISABLE_GREEN_LED
94 palSetPad(yellowPort, yellowPin);
97 palSetPad(bluePort, bluePin);
100 palSetPad(greenPort, greenPin);
104 palClearPad(redPort, redPin);
106 palSetPad(redPort, redPin);
112 palTogglePad(yellowPort, yellowPin);
115 palTogglePad(bluePort, bluePin);
118 palTogglePad(greenPort, greenPin);
121 palTogglePad(redPort, redPin);
134 uint8_t value = 0x00;
144 uint8_t wd_counter = 0;
175 blinky.start(NORMALPRIO + 10);
187 if (ComIsConnected() == BLT_TRUE) {
189 wasConnected = BLT_TRUE;
194#if (BOOT_BACKDOOR_ENTRY_TIMEOUT_MS > 0)
195 blt_bool isTimeout = (TIME_I2MS(chVTGetSystemTime()) >= BOOT_BACKDOOR_ENTRY_TIMEOUT_MS);
199 if (isTimeout == BLT_TRUE) {
215 palSetPadMode(port,
pin, mode);
Reset_Cause_t getMCUResetCause()
static blt_bool checkIfRebootIntoOpenBltRequested(void)
static blt_bool checkIfResetLoop(void)
blt_bool stayInBootloader
static const uint8_t maxWdRebootCounter
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
PUBLIC_API_WEAK bool OpenBltIsBoardOk()
static blt_bool rebootLoop
static blt_bool waitedLongerThanTimeout
void CopServiceHook(void)
static BlinkyThread blinky
ioportid_t getHwPort(const char *msg, brain_pin_e brainPin)
ioportmask_t getHwPin(const char *msg, brain_pin_e brainPin)
blt_bool isFlashDualBank(void)
uint32_t ioportmask_t
Digital I/O port sized unsigned type.
GPIO_TypeDef * ioportid_t
Port Identifier.
uint32_t iomode_t
Digital I/O modes.
void CpuStartUserProgram(void)
int getBrainPinIndex(Gpio brainPin)
ioportid_t getBrainPinPort(brain_pin_e brainPin)
bool SharedParamsWriteByIndex(uint32_t idx, uint8_t value)
Writes a data byte to the shared parameter buffer at the specified index.
void SharedParamsInit(void)
Initializes the shared RAM parameters module.
bool SharedParamsReadByIndex(uint32_t idx, uint8_t *value)
Reads a data byte from the shared parameter buffer at the specified index.
static const volatile Reset_Cause_t resetCause