forked from NabuCasa/silabs-firmware-builder
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
279 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: ZGA008 Firmware Eraser | ||
device: EFR32MG21A020F1024IM32 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: ZB-GW04-1v1 Firmware Eraser | ||
device: EFR32MG21A020F768IM32 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: ZB-GW04-1v2 Firmware Eraser | ||
device: EFR32MG21A020F768IM32 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: SkyConnect Firmware Eraser | ||
device: EFR32MG21A020F512IM32 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: Yellow Firmware Eraser | ||
device: MGM210PA32JIA | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: SLZB-06M Firmware Eraser | ||
device: EFR32MG21A020F768IM32 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: SLZB-07Mg24 Firmware Eraser | ||
device: EFR32MG24A020F1024IM40 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: SLZB-07 Firmware Eraser | ||
device: EFR32MG21A020F768IM32 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: ZBDongle-E Firmware Eraser | ||
device: EFR32MG21A020F768IM32 | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: TubesZB MGM24 Firmware Eraser | ||
device: MGM240PA32VNN | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,9 @@ | ||
name: TubesZB MGM24PB Firmware Eraser | ||
device: MGM240PB32VNN | ||
base_project: src/firmware_eraser | ||
filename: "{manifest_name}_{sdk_version}" | ||
sdk: "simplicity_sdk:2024.6.2" | ||
toolchain: "12.2.1.20221205" | ||
|
||
gbl: | ||
fw_type: firmware_eraser |
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,58 @@ | ||
/***************************************************************************//** | ||
* @file | ||
* @brief Top level application functions | ||
******************************************************************************* | ||
* # License | ||
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b> | ||
******************************************************************************* | ||
* | ||
* The licensor of this software is Silicon Laboratories Inc. Your use of this | ||
* software is governed by the terms of Silicon Labs Master Software License | ||
* Agreement (MSLA) available at | ||
* www.silabs.com/about-us/legal/master-software-license-agreement. This | ||
* software is distributed to you in Source Code format and is governed by the | ||
* sections of the MSLA applicable to Source Code. | ||
* | ||
******************************************************************************/ | ||
#include <stdlib.h> | ||
|
||
#include <em_msc.h> | ||
#include <em_chip.h> | ||
|
||
#include <btl_interface.h> | ||
|
||
void bootloader_rebootAndInstall(void) | ||
{ | ||
// Set reset reason to bootloader entry | ||
BootloaderResetCause_t* resetCause = (BootloaderResetCause_t*) (SRAM_BASE); | ||
resetCause->reason = BOOTLOADER_RESET_REASON_BADAPP; | ||
resetCause->signature = BOOTLOADER_RESET_SIGNATURE_INVALID; | ||
#if defined(RMU_PRESENT) | ||
// Clear resetcause | ||
RMU->CMD = RMU_CMD_RCCLR; | ||
// Trigger a software system reset | ||
RMU->CTRL = (RMU->CTRL & ~_RMU_CTRL_SYSRMODE_MASK) | RMU_CTRL_SYSRMODE_FULL; | ||
#endif | ||
NVIC_SystemReset(); | ||
} | ||
|
||
/***************************************************************************//** | ||
* Initialize application. | ||
******************************************************************************/ | ||
void app_init(void) | ||
{ | ||
// This will set the program counter (startOfAppSpace + 4) to 0xFFFFFFFF, which | ||
// breaks the bootloader early with `BOOTLOADER_RESET_REASON_BADAPP`. | ||
MSC_Init(); | ||
MSC_ErasePage((uint32_t*)BTL_APPLICATION_BASE); | ||
MSC_Deinit(); | ||
|
||
bootloader_rebootAndInstall(); | ||
} | ||
|
||
/***************************************************************************//** | ||
* App ticking function. | ||
******************************************************************************/ | ||
void app_process_action(void) | ||
{ | ||
} |
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 @@ | ||
/***************************************************************************//** | ||
* @file | ||
* @brief Top level application functions | ||
******************************************************************************* | ||
* # License | ||
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b> | ||
******************************************************************************* | ||
* | ||
* The licensor of this software is Silicon Laboratories Inc. Your use of this | ||
* software is governed by the terms of Silicon Labs Master Software License | ||
* Agreement (MSLA) available at | ||
* www.silabs.com/about-us/legal/master-software-license-agreement. This | ||
* software is distributed to you in Source Code format and is governed by the | ||
* sections of the MSLA applicable to Source Code. | ||
* | ||
******************************************************************************/ | ||
|
||
#ifndef APP_H | ||
#define APP_H | ||
|
||
/***************************************************************************//** | ||
* Initialize application. | ||
******************************************************************************/ | ||
void app_init(void); | ||
|
||
/***************************************************************************//** | ||
* App ticking function. | ||
******************************************************************************/ | ||
void app_process_action(void); | ||
|
||
#endif // APP_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,33 @@ | ||
project_name: firmware_eraser | ||
package: platform | ||
quality: production | ||
label: Firmware Eraser | ||
description: Erase the firmware | ||
category: Example|Platform | ||
filter: | ||
- name: "Device Type" | ||
value: ["SoC"] | ||
- name: "MCU" | ||
value: ["32-bit MCU"] | ||
- name: "Project Difficulty" | ||
value: ["Beginner"] | ||
|
||
source: | ||
- path: app.cpp | ||
- path: main.cpp | ||
|
||
include: | ||
- path: . | ||
file_list: | ||
- path: app.h | ||
|
||
component: | ||
- id: sl_system | ||
- id: device_init | ||
- id: clock_manager | ||
- id: cpp_support | ||
- id: bootloader_app_properties | ||
- id: bootloader_interface | ||
|
||
define: | ||
- name: DEBUG_EFM |
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,58 @@ | ||
/***************************************************************************//** | ||
* @file main.cpp | ||
* @brief main() function. | ||
******************************************************************************* | ||
* # License | ||
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b> | ||
******************************************************************************* | ||
* | ||
* The licensor of this software is Silicon Laboratories Inc. Your use of this | ||
* software is governed by the terms of Silicon Labs Master Software License | ||
* Agreement (MSLA) available at | ||
* www.silabs.com/about-us/legal/master-software-license-agreement. This | ||
* software is distributed to you in Source Code format and is governed by the | ||
* sections of the MSLA applicable to Source Code. | ||
* | ||
******************************************************************************/ | ||
#include "sl_component_catalog.h" | ||
#include "sl_system_init.h" | ||
#include "app.h" | ||
#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) | ||
#include "sl_power_manager.h" | ||
#endif | ||
#if defined(SL_CATALOG_KERNEL_PRESENT) | ||
#include "sl_system_kernel.h" | ||
#else // SL_CATALOG_KERNEL_PRESENT | ||
#include "sl_system_process_action.h" | ||
#endif // SL_CATALOG_KERNEL_PRESENT | ||
|
||
int main(void) | ||
{ | ||
// Initialize Silicon Labs device, system, service(s) and protocol stack(s). | ||
// Note that if the kernel is present, processing task(s) will be created by | ||
// this call. | ||
sl_system_init(); | ||
|
||
// Initialize the application. For example, create periodic timer(s) or | ||
// task(s) if the kernel is present. | ||
app_init(); | ||
|
||
#if defined(SL_CATALOG_KERNEL_PRESENT) | ||
// Start the kernel. Task(s) created in app_init() will start running. | ||
sl_system_kernel_start(); | ||
#else // SL_CATALOG_KERNEL_PRESENT | ||
while (1) { | ||
// Do not remove this call: Silicon Labs components process action routine | ||
// must be called from the super loop. | ||
sl_system_process_action(); | ||
|
||
// Application process. | ||
app_process_action(); | ||
|
||
#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) | ||
// Let the CPU go to sleep if the system allows it. | ||
sl_power_manager_sleep(); | ||
#endif | ||
} | ||
#endif // SL_CATALOG_KERNEL_PRESENT | ||
} |