Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
mcu_arch.c File Reference

Microcontroller initialization function for ChibiOS. More...

#include <string.h>
#include "ch.h"
#include "hal.h"
#include "mcu.h"
#include "mcu_periph/ram_arch.h"
Include dependency graph for mcu_arch.c:

Go to the source code of this file.

Enumerations

enum  rtc_boot_magic {
  RTC_BOOT_OFF = 0 , RTC_BOOT_HOLD = 0xb0070001 , RTC_BOOT_FAST = 0xb0070002 , RTC_BOOT_CANBL = 0xb0080000 ,
  RTC_BOOT_FWOK = 0xb0093a26
}
 RTC backup register values. More...

Functions

static void mcu_deep_sleep (void)
 Put MCU into deep sleep mode.
void mcu_arch_init (void)
 Initialize the specific archittecture functions.
void mcu_reboot (enum reboot_state_t reboot_state)
 Reboot the MCU.
void mcu_energy_save (void)
 Save energy for performing operations on shutdown Used for example to shutdown SD-card logging.
uint8_t mcu_get_uid (uint8_t *uid, uint8_t max_len)
 Get the 96-bit unique device ID of the STM32.

Detailed Description

Microcontroller initialization function for ChibiOS.

ChibiOS initialized peripherals by itself, only interrupt vector has to be relocated for Luftboot

Definition in file mcu_arch.c.

Enumeration Type Documentation

◆ rtc_boot_magic

RTC backup register values.

Enumerator
RTC_BOOT_OFF 

Normal boot.

RTC_BOOT_HOLD 

Hold in bootloader, do not boot application.

RTC_BOOT_FAST 

No timeout in bootloader.

RTC_BOOT_CANBL 

CAN bootloader, ORd with 8 bit local node ID.

RTC_BOOT_FWOK 

indicates FW ran for 30s

Definition at line 140 of file mcu_arch.c.

Function Documentation

◆ mcu_arch_init()

void mcu_arch_init ( void )

Initialize the specific archittecture functions.

Definition at line 157 of file mcu_arch.c.

Referenced by mcu_init().

Here is the caller graph for this function:

◆ mcu_deep_sleep()

void mcu_deep_sleep ( void )
static

Put MCU into deep sleep mode.

This can be used when closing the SD log files right after a power down to save the remaining energy for the SD card internal MCU

Never call this during flight!

Definition at line 273 of file mcu_arch.c.

Referenced by mcu_reboot().

Here is the caller graph for this function: