Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport backup register #8953

Merged
merged 3 commits into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/drivers/boards/common/stm32/board_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <px4_config.h>
#include <errno.h>
#include <stm32_pwr.h>
#include <stm32_rtc.h>
#include <nuttx/board.h>


Expand All @@ -61,7 +62,13 @@ int board_set_bootload_mode(board_reset_e mode)
}

stm32_pwr_enablebkp(true);

// Check if we can to use the new register definition
#ifndef STM32_RTC_BK0R
*(uint32_t *)STM32_BKP_BASE = regvalue;
#else
*(uint32_t *)STM32_RTC_BK0R = regvalue;
#endif
stm32_pwr_enablebkp(false);
return OK;
}
Expand Down
1 change: 1 addition & 0 deletions src/platforms/px4_micro_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ __BEGIN_DECLS

# if defined(CONFIG_ARCH_CHIP_STM32F7)
# include <chip.h>
# include <up_internal.h> //include up_systemreset() which is included on stm32.h
# include <stm32_bbsram.h>
# define PX4_BBSRAM_SIZE STM32F7_BBSRAM_SIZE
# define PX4_BBSRAM_GETDESC_IOCTL STM32F7_BBSRAM_GETDESC_IOCTL
Expand Down