Skip to content

Commit a2fae4f

Browse files
PK Chanioannisg
authored andcommitted
samples: secure_services: added example to read FICR.
The example reads FICR.INFO.PART using spm_request_read(), and then prints it out. Signed-off-by: PK Chan <[email protected]>
1 parent 0989c67 commit a2fae4f

File tree

1 file changed

+11
-0
lines changed
  • samples/nrf9160/secure_services/src

1 file changed

+11
-0
lines changed

samples/nrf9160/secure_services/src/main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ void main(void)
7474
print_hex_number(buf, num_bytes_to_read);
7575
#endif
7676

77+
u32_t info_part = 0;
78+
u32_t ficr_addr = (u32_t)&NRF_FICR_S->INFO.PART;
79+
80+
printk("\nRead FICR, offset 0x20C (address 0x%08x):\n", ficr_addr);
81+
ret = spm_request_read(&info_part, ficr_addr, sizeof(u32_t));
82+
if (ret != 0) {
83+
printk("Could not read FICR (err: %d)\n", ret);
84+
} else {
85+
printk("FICR.INFO.PART (+0x20C) = 0x%08X\n", info_part);
86+
}
87+
7788
printk("\nReboot in %d seconds.\n", sleep_time_s);
7889
k_sleep(K_SECONDS(5));
7990

0 commit comments

Comments
 (0)