This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Specifying and using a specific area of memory to store configuration/calibration parameters

Hello,

I have a few configurable parameters in our application that I would like to store in a specific area of memory that can be reflashed at end of line to customer specification. We are using the RM48L952PGE MCU.

At present the application uses simple #defines for each parameter. To affect the end of line procedure I envisage the following

1. Declare the configuration parameters in a specific area of memory

2. Write a simple tool to write required values to the relevant addresses as determined from the linker map file.

3. I expect that I will have to recalculate the ECC values at end of line and flash them too.

I have followed the methods of some forum posts on this subject using the SET_DATA_SECTION or DATA_SECTION pragma directives. However I always get an error in the debugger if I try to read or view the memory address. The debugger error is

CortexR4: Trouble Reading Memory Block at 0x2ff000 on Page 0 of Length 0xd8: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.1.73.0)


The code I have declares the variable uni_test_param to a specific section UNI_CONFIGS:


#pragma DATA_SECTION(uni_test_param,".UNI_CONFIGS");

const unsigned int uni_test_param[6] =
{
0xC67E816B,
0x4BFBE2FB,
0x54F6BDDF,
0x7C1CE187,
0x01BF31DE,
0x56720F47
};

My memory configuration is a follows:


    VECTORS         (X)        : origin=0x00000000 length=0x00000020
    KERNEL          (RX)    : origin=0x00000020 length=0x00008000
    FLASH0          (RX)    : origin=0x00008020 length=0x0017FFE0
    FLASH1          (RX)    : origin=0x00188000 length=0x00177000
    UNI_CONF_SEC    (RW)    : origin=0x002FF000 length=0x00001000
    STACKS          (RW)    : origin=0x08000000 length=0x00003500
    KRAM             (RW)    : origin=0x08003500 length=0x00000800
    /* RAM = 256KB - STACKS - KRAM */
    RAM     (RW)   : origin=(0x08003500+0x00000800) length=0x0003AE00

 .intvecs : {} > VECTORS
    /* FreeRTOS Kernel in protected region of Flash */
    .kernelTEXT   : { sys_startup.obj(.const)
                      os_tasks.obj (.const:.string)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<auto_init.obj> (.text)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<copy_decompress_rle.obj> (*)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<cpy_tbl.obj> (*)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<copy_zero_init.obj> (*)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<copy_decompress_none.obj> (*)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<icall32.obj> (.text)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<memset32.obj> (.text)
                      -l=rtsv7R4_T_le_v3D16_eabi.lib<memcpy32.obj> (.text)
                    } > KERNEL
    .UNI_CONFIGS  : {} > UNI_CONF_SEC
    .cinit        : {} > KERNEL
    .pinit        : {} > KERNEL
    /* Rest of code to user mode flash region */
    .text         : {} > FLASH0 | FLASH1
    .const        : {} > FLASH0 | FLASH1
    /* FreeRTOS Kernel data in protected region of RAM */
    .kernelBSS    : {} > KRAM
    .kernelHEAP   : {} > RAM
    .bss          : {} > RAM
    .data         : {} > RAM


Any advice is much appreciated, alternative approaches to meeting this requirement would also be appreciated.


Jamie