Skip to content

Commit 9bd7a66

Browse files
authored
Merge pull request #145 from tmobile/cfspdk-1202-dfu-modem-library
Cfspdk 1202/1203 DFU library
2 parents 22ae1d1 + 7598041 commit 9bd7a66

File tree

19 files changed

+1791
-1413
lines changed

19 files changed

+1791
-1413
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cmake_minimum_required(VERSION 3.20.0)
66

77
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
88

9-
add_subdirectory(dfu_gecko)
9+
add_subdirectory(libs)

Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
rsource "dfu_gecko/Kconfig.dfu_gecko"
2+
rsource "libs/dfu_gecko/Kconfig.dfu_gecko"

libs/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# libs/CMakeLists.txt
2+
3+
target_include_directories(app PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
4+
5+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dfu_gecko)
6+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dfu_murata_1sc)
7+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dfu_rs9116w)

libs/dfu_common.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2023 T-Mobile USA, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef __DFU_COMMON_H__
8+
#define __DFU_COMMON_H__
9+
10+
#define DFU_DESC_LEN 64
11+
#define DFU_FILE_LEN 64
12+
#define DFU_SHA1_LEN 20
13+
#define DFU_URL_LEN 256
14+
15+
struct dfu_file_t {
16+
char desc[DFU_DESC_LEN];
17+
char lfile[DFU_FILE_LEN];
18+
char rfile[DFU_FILE_LEN];
19+
char sha1[DFU_SHA1_LEN];
20+
};
21+
22+
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.

dfu_gecko/dfu_gecko_lib.h renamed to libs/dfu_gecko/dfu_gecko_lib.h

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,12 @@
77
#ifndef DFU_GECKO_H
88
#define DFU_GECKO_H
99

10-
#define DFU_IMAGE_HDR_LEN 32
10+
#include "dfu_common.h"
11+
12+
#define DFU_IMAGE_HDR_LEN 32
1113
#define DFU_SLOT0_FLASH_ADDR 0x10000
1214
#define DFU_SLOT1_FLASH_ADDR 0x80000
13-
#define DFU_IMAGE_MAGIC 0x96f3b83d
14-
15-
#ifndef __DFU_FILE__
16-
#define __DFU_FILE__
17-
18-
#define DFU_DESC_LEN 64
19-
#define DFU_FILE_LEN 64
20-
#define DFU_SHA1_LEN 20
21-
#define DFU_URL_LEN 256
22-
23-
struct dfu_file_t {
24-
char desc[DFU_DESC_LEN];
25-
char lfile[DFU_FILE_LEN];
26-
char rfile[DFU_FILE_LEN];
27-
char sha1[DFU_SHA1_LEN];
28-
};
29-
#endif /* __DFU_FILE__ */
15+
#define DFU_IMAGE_MAGIC 0x96f3b83d
3016

3117
#ifdef BOOT_SLOT
3218
int is_bootloader_running(void);

libs/dfu_murata_1sc/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target_sources(app PRIVATE dfu_murata_1sc.c)
2+
target_include_directories(app PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)