Skip to content

Commit a8ef03d

Browse files
Adam-MaciugaRobertGalatNordic
authored andcommitted
logs: smsn and shield
Added a display of a used shield and smsn This will make it easier to identify the device and build config by logs Co-authored-by: Robert Gałat <[email protected]> Co-authored-by: Adam Maciuga <[email protected]> Signed-off-by: Robert Gałat <[email protected]>
1 parent 84720c5 commit a8ef03d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

subsys/sal/sid_pal/src/sid_mfg_storage.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static int sid_mfg_storage_secure_read(uint16_t *p_value, uint8_t *buffer, uint1
5151
#endif
5252
#endif /* DEV_ID_REG */
5353

54+
#define SID_SMSN_SIZE 32
55+
5456
static const struct device *flash_dev;
5557
static uint32_t sid_mfg_version = INVALID_VERSION;
5658
tlv_ctx tlv_flash;
@@ -161,6 +163,14 @@ void sid_pal_mfg_store_init(sid_pal_mfg_store_region_t mfg_store_region)
161163
LOG_ERR("Flash protect failed %d", err);
162164
}
163165
#endif // CONFIG_FPROTECT AND NOT CONFIG_SIDEWALK_MFG_STORAGE_DIAGNOSTIC
166+
167+
uint8_t smsn_buffer[SID_SMSN_SIZE] = { 0 };
168+
sid_pal_mfg_store_read(SID_PAL_MFG_STORE_SMSN, smsn_buffer, SID_SMSN_SIZE);
169+
if (memcmp(smsn_buffer, (const uint8_t[SID_SMSN_SIZE]){ 0 }, SID_SMSN_SIZE) == 0) {
170+
LOG_ERR("SMSN is not initialized");
171+
} else {
172+
LOG_HEXDUMP_DBG(smsn_buffer, SID_SMSN_SIZE, "Initialized with SMSN KEY: ");
173+
}
164174
}
165175

166176
void sid_pal_mfg_store_deinit(void)

utils/include/sidewalk_version.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99
#include <sid_sdk_version.h>
1010
#include <app_version.h>
1111

12+
#ifdef CONFIG_DT_HAS_SEMTECH_LR1110_ENABLED
13+
#define SHIELD_NAME "Semtech lr1110"
14+
#elif defined(CONFIG_DT_HAS_SEMTECH_SX1262_ENABLED)
15+
#define SHIELD_NAME "Semtech sx1262"
16+
#endif
17+
18+
#ifndef SHIELD_NAME
19+
#define SHIELD_NAME "none"
20+
#endif
21+
1222
#if defined(CONFIG_LOG)
1323
#define PRINT_SIDEWALK_VERSION() \
1424
LOG_PRINTK("----------------------------------------------------------------\n"); \
@@ -18,6 +28,7 @@
1828
LOG_PRINTK("APP_NAME = %s\n", CONFIG_SIDEWALK_APPLICATION_NAME); \
1929
LOG_PRINTK("build time = %s %s\n", __DATE__, __TIME__); \
2030
LOG_PRINTK("board = %s\n", CONFIG_BOARD_TARGET); \
31+
LOG_PRINTK("shield = %s\n",SHIELD_NAME); \
2132
LOG_PRINTK("----------------------------------------------------------------\n")
2233
#else
2334
#define PRINT_SIDEWALK_VERSION()

0 commit comments

Comments
 (0)