nRF5x: how to use UICR as your signature

board: nRF52832_xxac_s132/ SDK11

After developing a firmware, you can use UICR as a mark to use .
because UICR can not be erased by DFU-OTA

STEP 1
copy file “uicr_config.h” at:
C:\..\nRF5x_SDK_11.0.0\examples\peripheral\uicr_config
to your project file.

STEP 2
open your project in IDE
add this in main.c :

//power by Agatha Kuan
//add uicr

include “uicr_config.h”

then compile your project first.

STEP 3
open uicr_config.h
I add my family name like this:

// const uint32_t UICR_CLENR0 __attribute__((at(0x10001000))) __attribute__((used)) = 0xFFFFFFFF;
// const uint32_t UICR_RBPCONF __attribute__((at(0x10001004))) __attribute__((used)) = 0xFFFFFFFF;
// const uint32_t UICR_XTALFREQ __attribute__((at(0x10001008))) __attribute__((used)) = 0xFFFFFFFF;
const uint32_t UICR_ADDR_0x04 __attribute__((at(0x10001004))) __attribute__((used)) = 0x6e61754b;
//const uint32_t UICR_ADDR_0x80 __attribute__((at(0x1000108c))) __attribute__((used)) = 0x69617354;
//const uint32_t UICR_ADDR_0x84 __attribute__((at(0x10001084))) __attribute__((used)) = 0x6e656843;
//const uint32_t UICR_ADDR_0x88 __attribute__((at(0x10001090))) __attribute__((used)) = 0x53334955;
// const uint32_t UICR_ADDR_0x8C __attribute__((at(0x1000108C))) __attribute__((used)) = 0xFFFFFFFF;
// const uint32_t UICR_ADDR_0x90 __attribute__((at(0x10001090))) __attribute__((used)) = 0xFFFFFFFF;
// const uint32_t UICR_ADDR_0x94 __attribute__((at(0x10001094))) __attribute__((used)) = 0xFFFFFFFF;
// const uint32_t UICR_ADDR_0x98 __attribute__((at(0x10001098))) __attribute__((used)) = 0xFFFFF

then compile , program to your nRF52

STEP 4
open command line, type :

:: power by Agatha Kuan 2017.04.18

.\nrfjprog.exe –family NRF52 –memrd 0x10001004 –n 4

it shows:

be careful that the ascii shows in Little Endian
parameter “–n” write the length to read, “4” means 4 bytes.

Reference:
https://devzone.nordicsemi.com/documentation/nrf51/4.4.1/html/group__uicr__config__example.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值