This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use uicr_config.h in SEGGER EMBEDED STUDIO

Hi, Nordic Team:

 I am working with nrf52840 chip now,I want to use VDD output 3.3v. I have read the UICR Config Example and it's work fine when i use Keil to comp & download on chip.

But I am work with mesh and manage my code with SES , my code is below( include .h in main.c , add code in uicr_config.h):

/* Vdd */
#include "nrf.h"
#include "uicr_config.h"
 

const uint32_t UICR_ADDR_EXTSUPPLY  __attribute__((at(0x10001300))) __attribute__((used)) = 0xFFFFFFFF;  // Enabled
const uint32_t UICR_ADDR_REGOUT0    __attribute__((at(0x10001304))) __attribute__((used)) = 0xFFFFFFF5;    // 3.3V

Complie has 2 warnings;

1> include/uicr_config.h:75:1: warning: 'at' attribute directive ignored [-Wattributes]
1> include/uicr_config.h:76:1: warning: 'at' attribute directive ignored [-Wattributes]

donwload into 52840 chip it is 1.8v output ,seems like the config didn't download into chip. On keil i can choose programming algorithm:nRF52xxx_UICR ,

but use SES i can't find how to config downloading.

Parents
  • To elaborate on   answer,

    You need to change your declared C variable to the following:

    const uint32_t UICR_ADDR_0x20C __attribute__((section(".UICR_0x20C"))) = 0xFFFFFFE;

    .UICR_0x20C is the name of my section in the flash_placement.xml. See end of message for flash_placement snippet.

    This will tell the linker to put your C variable into the section declared in the placement xml file.

    Also, not proud to say, but I spent all day trying to get this to work, and the most critical part for me was changing the build setting's memory segments to "UICR RWX 0x10001000 0x210". (This is slightly different than Andreas's answer because I'm using a size of 0x210 - NRF52832)

    Another advice note: I was checking the output .map file to verify the method worked.

    Good luck reader!

    <MemorySegment name="UICR" start="0x10001000" size="0x210">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".UICR_0x20C" start="0x1000120C"/>
    </MemorySegment>

Reply
  • To elaborate on   answer,

    You need to change your declared C variable to the following:

    const uint32_t UICR_ADDR_0x20C __attribute__((section(".UICR_0x20C"))) = 0xFFFFFFE;

    .UICR_0x20C is the name of my section in the flash_placement.xml. See end of message for flash_placement snippet.

    This will tell the linker to put your C variable into the section declared in the placement xml file.

    Also, not proud to say, but I spent all day trying to get this to work, and the most critical part for me was changing the build setting's memory segments to "UICR RWX 0x10001000 0x210". (This is slightly different than Andreas's answer because I'm using a size of 0x210 - NRF52832)

    Another advice note: I was checking the output .map file to verify the method worked.

    Good luck reader!

    <MemorySegment name="UICR" start="0x10001000" size="0x210">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".UICR_0x20C" start="0x1000120C"/>
    </MemorySegment>

Children
No Data
Related