CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
mcu.h
Go to the documentation of this file.
1
31#ifndef _MCU_H
32#define _MCU_H
33
34// Dependencies
35#include "boot_config.h"
36#include "os_port.h"
37
38#include <stdint.h>
39
40#ifndef BOOT_CUSTOM_DEINIT_SUPPORT
41#define BOOT_CUSTOM_DEINIT_SUPPORT DISABLED
42#elif ((BOOT_CUSTOM_DEINIT_SUPPORT != ENABLED) && (BOOT_CUSTOM_DEINIT_SUPPORT != DISABLED))
43#error BOOT_CUSTOM_DEINIT_SUPPORT parameter is not valid!
44#endif
45
46// CycloneBOOT MCU Driver Major version
47#define MCU_DRIVER_VERSION_MAJOR 0x01
48// CycloneBOOT MCU Driver Minor version
49#define MCU_DRIVER_VERSION_MINOR 0x00
50// CycloneBOOT MCU Driver Revision version
51#define MCU_DRIVER_VERSION_PATCH 0x00
52// CycloneBOOT MCU Driver version
53#define MCU_DRIVER_VERSION \
54 (uint32_t)(((MCU_DRIVER_VERSION_MAJOR & 0xFF) << 16) | \
55 ((MCU_DRIVER_VERSION_MINOR & 0xFF) << 8) | (MCU_DRIVER_VERSION_PATCH & 0xFF))
56
57// C++ guard
58#ifdef __cplusplus
59extern "C"
60{
61#endif
62
67typedef enum
68{
69 RESET_CAUSE_UNKNOWN = 0,
70 RESET_CAUSE_POWER_ON,
71 RESET_CAUSE_PIN,
72 RESET_CAUSE_SOFTWARE,
73 RESET_CAUSE_WATCHDOG,
74 RESET_CAUSE_LOW_POWER
76
77// CycloneBOOT mcu layer related functions
78extern uint32_t mcuGetVtorOffset(void);
79extern void mcuSystemReset(void);
80extern ResetCause mcuGetResetCause(void);
81
82#if defined(__CC_ARM)
83void mcuJumpToApplication(uint32_t address) __attribute__((section(".code_in_ram")));
84#elif (defined(__GNUC__) && defined(__MINGW32__)) || (defined(__GNUC__) && defined(__MINGW64__))
85void mcuJumpToApplication(uint32_t address) __attribute__((section(".code_in_ram")));
86#elif defined(__GNUC__)
87void mcuJumpToApplication(uint32_t address) __attribute__((section(".code_in_ram")));
88#elif defined(_MSC_VER)
89extern void mcuJumpToApplication(uint32_t address);
90#endif
91
92// C++ guard
93#ifdef __cplusplus
94}
95#endif
96#endif
ResetCause mcuGetResetCause(void)
Get the cause of the last reset.
Definition sam_ed_5x_mcu_driver.c:68
uint32_t mcuGetVtorOffset(void)
Return mcu vector table offset.
Definition sam_ed_5x_mcu_driver.c:51
void mcuSystemReset(void)
Reset MCU system.
Definition sam_ed_5x_mcu_driver.c:59
ResetCause
MCU reset cause.
Definition mcu.h:68
void mcuJumpToApplication(uint32_t address)
Jump to the application at the given address.
Definition sam_ed_5x_mcu_driver.c:80