mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 20:10:18 +03:00
Working - except when exiting from bootloader
Fixes the `Waiting for Data` problem in configurator when: - Clicking on `Save and Reboot` button - Clicking on `Flash Firmware` button When the system reboots after programming the new firmware it still needs a connect/disconnect cycle to work normal. This cannot be solved since the bootloader is a fixed program in ROM. Fix is for F1 targets and only tested on naze boards.
This commit is contained in:
parent
efc31f9d57
commit
c40db74e61
2 changed files with 11 additions and 6 deletions
|
@ -151,11 +151,19 @@ void systemInit(void)
|
||||||
cachedRccCsrValue = RCC->CSR;
|
cachedRccCsrValue = RCC->CSR;
|
||||||
RCC_ClearFlag();
|
RCC_ClearFlag();
|
||||||
|
|
||||||
|
|
||||||
enableGPIOPowerUsageAndNoiseReductions();
|
enableGPIOPowerUsageAndNoiseReductions();
|
||||||
|
|
||||||
|
|
||||||
#ifdef STM32F10X
|
#ifdef STM32F10X
|
||||||
|
// Set USART1 TX (PA9) to output and high state to prevent a rs232 break condition on reset.
|
||||||
|
// See issue https://github.com/cleanflight/cleanflight/issues/1433
|
||||||
|
gpio_config_t gpio;
|
||||||
|
|
||||||
|
gpio.mode = Mode_Out_PP;
|
||||||
|
gpio.speed = Speed_2MHz;
|
||||||
|
gpio.pin = Pin_9;
|
||||||
|
digitalHi(GPIOA, gpio.pin);
|
||||||
|
gpioInit(GPIOA, &gpio);
|
||||||
|
|
||||||
// Turn off JTAG port 'cause we're using the GPIO for leds
|
// Turn off JTAG port 'cause we're using the GPIO for leds
|
||||||
#define AFIO_MAPR_SWJ_CFG_NO_JTAG_SW (0x2 << 24)
|
#define AFIO_MAPR_SWJ_CFG_NO_JTAG_SW (0x2 << 24)
|
||||||
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_NO_JTAG_SW;
|
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_NO_JTAG_SW;
|
||||||
|
|
|
@ -1823,10 +1823,7 @@ void mspProcess(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRebootScheduled) {
|
if (isRebootScheduled) {
|
||||||
// pause a little while to allow response to be sent
|
waitForSerialPortToFinishTransmitting(candidatePort->port);
|
||||||
while (!isSerialTransmitBufferEmpty(candidatePort->port)) {
|
|
||||||
delay(50);
|
|
||||||
}
|
|
||||||
stopMotors();
|
stopMotors();
|
||||||
handleOneshotFeatureChangeOnRestart();
|
handleOneshotFeatureChangeOnRestart();
|
||||||
systemReset();
|
systemReset();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue