-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2251 from jihlein/matek405
Matek405 Target
- Loading branch information
Showing
24 changed files
with
4,388 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/** | ||
****************************************************************************** | ||
* @addtogroup Bootloader Bootloaders | ||
* @{ | ||
* @addtogroup MATEK405 Matek MATEK405 | ||
* @{ | ||
* | ||
* @file matek405/bl/pios_board.c | ||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. | ||
* @author Tau Labs, http://taulabs.org, Copyright (C) 2012-2013 | ||
* @brief Board specific initialization for the bootloader | ||
* @see The GNU Public License (GPL) Version 3 | ||
* | ||
*****************************************************************************/ | ||
/* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, see <http://www.gnu.org/licenses/> | ||
*/ | ||
|
||
/* Pull in the board-specific static HW definitions. | ||
* Including .c files is a bit ugly but this allows all of | ||
* the HW definitions to be const and static to limit their | ||
* scope. | ||
* | ||
* NOTE: THIS IS THE ONLY PLACE THAT SHOULD EVER INCLUDE THIS FILE | ||
*/ | ||
#include "board_hw_defs.c" | ||
|
||
#include <pios_board_info.h> | ||
#include <pios.h> | ||
|
||
uintptr_t pios_com_telem_usb_id; | ||
|
||
void PIOS_Board_Init() { | ||
|
||
/* Delay system */ | ||
PIOS_DELAY_Init(); | ||
|
||
const struct pios_board_info * bdinfo = &pios_board_info_blob; | ||
|
||
#if defined(PIOS_INCLUDE_ANNUNC) | ||
const struct pios_annunc_cfg * led_cfg = PIOS_BOARD_HW_DEFS_GetLedCfg(bdinfo->board_rev); | ||
PIOS_Assert(led_cfg); | ||
PIOS_ANNUNC_Init(led_cfg); | ||
#endif /* PIOS_INCLUDE_ANNUNC */ | ||
|
||
PWR_BackupAccessCmd(ENABLE); | ||
RCC_LSEConfig(RCC_LSE_OFF); | ||
|
||
PIOS_ANNUNC_On(PIOS_LED_HEARTBEAT); | ||
PIOS_ANNUNC_On(PIOS_LED_ALARM); | ||
|
||
#if defined(PIOS_INCLUDE_FLASH) | ||
/* Initialize all flash drivers */ | ||
PIOS_Flash_Internal_Init(&pios_internal_flash_id, &flash_internal_cfg); | ||
|
||
/* Register the partition table */ | ||
PIOS_FLASH_register_partition_table(pios_flash_partition_table, NELEMENTS(pios_flash_partition_table)); | ||
#endif /* PIOS_INCLUDE_FLASH */ | ||
|
||
#if defined(PIOS_INCLUDE_USB) | ||
/* Initialize board specific USB data */ | ||
PIOS_USB_BOARD_DATA_Init(); | ||
|
||
/* Activate the HID-only USB configuration */ | ||
PIOS_USB_DESC_HID_ONLY_Init(); | ||
|
||
uintptr_t pios_usb_id; | ||
PIOS_USB_Init(&pios_usb_id, PIOS_BOARD_HW_DEFS_GetUsbCfg(bdinfo->board_rev)); | ||
|
||
#if defined(PIOS_INCLUDE_USB_HID) && defined(PIOS_INCLUDE_COM_MSG) | ||
uintptr_t pios_usb_hid_id; | ||
if (PIOS_USB_HID_Init(&pios_usb_hid_id, &pios_usb_hid_cfg, pios_usb_id)) { | ||
PIOS_Assert(0); | ||
} | ||
if (PIOS_COM_MSG_Init(&pios_com_telem_usb_id, &pios_usb_hid_com_driver, pios_usb_hid_id)) { | ||
PIOS_Assert(0); | ||
} | ||
#endif /* PIOS_INCLUDE_USB_HID && PIOS_INCLUDE_COM_MSG */ | ||
|
||
PIOS_USBHOOK_Activate(); | ||
|
||
#endif /* PIOS_INCLUDE_USB */ | ||
} | ||
|
||
/** | ||
* @} | ||
* @} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
****************************************************************************** | ||
* @addtogroup Bootloader Bootloaders | ||
* @{ | ||
* @addtogroup MATEK405 Matek MATEK405 | ||
* @{ | ||
* | ||
* @file matek405/bl/pios_config.h | ||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. | ||
* @author Tau Labs, http://taulabs.org, Copyright (C) 2012-2013 | ||
* @author dRonin, http://dRonin.org/, Copyright (C) 2015 | ||
* @brief Board specific bootloader configuration file for PiOS | ||
* @see The GNU Public License (GPL) Version 3 | ||
* | ||
*****************************************************************************/ | ||
/* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, see <http://www.gnu.org/licenses/> | ||
*/ | ||
|
||
#ifndef PIOS_CONFIG_H | ||
#define PIOS_CONFIG_H | ||
|
||
/* Enable/Disable PiOS Modules */ | ||
#define PIOS_INCLUDE_ANNUNC | ||
#define PIOS_INCLUDE_SPI | ||
#define PIOS_INCLUDE_SYS | ||
#define PIOS_INCLUDE_IAP | ||
#define PIOS_INCLUDE_USB | ||
#define PIOS_INCLUDE_USB_HID | ||
#define PIOS_INCLUDE_COM_MSG | ||
#define PIOS_INCLUDE_FLASH | ||
#define PIOS_INCLUDE_FLASH_INTERNAL | ||
#define PIOS_INCLUDE_FLASH_JEDEC | ||
|
||
#endif /* PIOS_CONFIG_H */ | ||
|
||
/** | ||
* @} | ||
* @} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
BOARD_TYPE := 0x95 | ||
BOARD_REVISION := 0x01 | ||
BOOTLOADER_VERSION := 0x88 | ||
HW_TYPE := 0x00 | ||
|
||
CHIP := STM32F405RGT6 | ||
BOARD := STM32F405 | ||
MODEL := HD | ||
MODEL_SUFFIX := | ||
|
||
USB_VEND := "Matek" | ||
USB_PROD := "Matek405" | ||
|
||
# Note: These must match the values in link_$(BOARD)_memory.ld | ||
BL_BANK_BASE := 0x08000000 # Start of bootloader flash | ||
BL_BANK_SIZE := 0x00008000 # Should include BD_INFO region (32kb) | ||
|
||
# Leave the remaining 16KB and 64KB sectors for other uses | ||
FW_BANK_BASE := 0x08020000 # Start of firmware flash (128kb) | ||
FW_BANK_SIZE := 0x00060000 # Should include FW_DESC_SIZE (384kb) | ||
|
||
FW_DESC_SIZE := 0x00000064 | ||
|
||
EE_BANK_BASE := 0x00000000 | ||
EE_BANK_SIZE := 0x00000000 | ||
|
||
EF_BANK_BASE := 0x08000000 # Start of entire flash image (usually start of bootloader as well) | ||
EF_BANK_SIZE := 0x00080000 # Size of the entire flash image (from bootloader until end of firmware) | ||
|
||
OSCILLATOR_FREQ := 8000000 | ||
SYSCLK_FREQ := 168000000 |
Oops, something went wrong.