mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-04 05:05:19 +08:00
boards: cube orange fully clear any existing MPU configuration as soon as possible
This commit is contained in:
committed by
Lorenz Meier
parent
7925787f62
commit
a819a7b7c4
@@ -60,6 +60,8 @@
|
|||||||
#include <px4_platform/gpio.h>
|
#include <px4_platform/gpio.h>
|
||||||
#include <px4_platform/board_dma_alloc.h>
|
#include <px4_platform/board_dma_alloc.h>
|
||||||
|
|
||||||
|
#include <mpu.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
extern void led_init(void);
|
extern void led_init(void);
|
||||||
extern void led_on(int led);
|
extern void led_on(int led);
|
||||||
@@ -118,6 +120,16 @@ __EXPORT void board_on_reset(int status)
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
__EXPORT void stm32_boardinitialize(void)
|
__EXPORT void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
|
// clear all existing MPU configuration from bootloader
|
||||||
|
for (int region = 0; region < CONFIG_ARM_MPU_NREGIONS; region++) {
|
||||||
|
putreg32(region, MPU_RNR);
|
||||||
|
putreg32(0, MPU_RBAR);
|
||||||
|
putreg32(0, MPU_RASR);
|
||||||
|
|
||||||
|
// save
|
||||||
|
putreg32(0, MPU_CTRL);
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset PWM first thing */
|
/* Reset PWM first thing */
|
||||||
board_on_reset(-1);
|
board_on_reset(-1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user