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

no init in RAM area question

 Hello.

I am using nrf51822/SD-130/SDK-12.3 now.

In order to preserve values ​​after reset, no init was set in the IRAM area.

The setting area is Start: 0x20007B80 / size: 0x480.

 

For testing, NVIC_SystemReset() is executed at regular intervals, and the value of the relevant area is checked using RTTviewer.

The results appear different in the two circumstances.

1. Softdevice download / keil rebuild and debugging condition

 - Here, the value is preserved after reset.

2. Hex file download – made using build batch file (softdevice + application + bootloader)

 - Here, the value is erased after reset.

 - There was no special problem with the build batch file.

 - I attach my batch file.

 

I'm looking for which problem is.

Would you give me some advice?

 Thanks.

 


build_IG8008.zip

  • Hello,

    Have you allocated the same ".no_init" region in both the bootloader and the application, and do you see the same if you only program the Softdevice+application without the bootloader?

    Thanks,

    Vidar

  •  Hello,

    I modified the area in the *.ld file as below.

    I solved it quickly thanks to your advice.

    Thank you.

      /** RAM Region for bootloader. This setting is suitable when used with s110, s120, s130, s310. */
      /* RAM (rwx) :  ORIGIN = 0x20002C00, LENGTH = 0x5380 */
      /* RAM (rwx) :  ORIGIN = 0x200025e0, LENGTH = 0x59A0 ---> old area */
      RAM (rwx) :  ORIGIN = 0x200025e0, LENGTH = 0x55A0
    
      /** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
       *  from application to bootloader when using buttonluss DFU OTA.
       */
      /* NOINIT (rwx) :  ORIGIN = 0x20007F80, LENGTH = 0x80 --> old area */
      NOINIT (rwx) :  ORIGIN = 0x20007B80, LENGTH = 0x480

  •  Hello,

    I want to ask more.

    I made 2 FW ver using 2 RAM address map and tested Case 1 / 2.

    I don’t know why the new bootloader configuration is not reflected in Case 2.

    I’m reviewing and hope your help.

     

    Thanks.

    ********************************************************************

    * FW ver 1 configuration

     - application

     - bootloader

      /** RAM Region for bootloader. This setting is suitable when used with s110, s120, s130, s310. */
      /* RAM (rwx) :  ORIGIN = 0x20002C00, LENGTH = 0x5380 */
      RAM (rwx) :  ORIGIN = 0x200025e0, LENGTH = 0x59A0
    
      /** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
       *  from application to bootloader when using buttonluss DFU OTA.
       */
      NOINIT (rwx) :  ORIGIN = 0x20007F80, LENGTH = 0x80

    * FW ver 2 configuration

     - application

     - bootloader

      /** RAM Region for bootloader. This setting is suitable when used with s110, s120, s130, s310. */
      /* RAM (rwx) :  ORIGIN = 0x20002C00, LENGTH = 0x5380 */
      RAM (rwx) :  ORIGIN = 0x200025e0, LENGTH = 0x55A0
    
      /** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
       *  from application to bootloader when using buttonluss DFU OTA.
       */
      NOINIT (rwx) :  ORIGIN = 0x20007B80, LENGTH = 0x480

    ********************************************************************

        * test *

    * Case 1 : FW ver 2

    1. Ver 2 writing using nrfutil.
    2. Writing some data to no init RAM area
    3. Ver 2 DFU
    4. No init RAM area has data I wrote before DFU
    5. Writing some data to no init RAM area
    6. Soft reset using debugger and nrfutil with power maintained
    7. No init RAM area has data I wrote before soft reset

     * Case 2 : FW Ver 1 -> ver 2

    1. Ver 1 writing using nrfutil.
    2. Ver 2 DFU
    3. Writing some data to no init RAM area
    4. Soft reset using debugger and nrfutil with power maintained
    5. No init RAM area has erased

     

  • It looks like you have done it correctly. I suggest that you review the *.map file for the bootloader and application to check if there is anything overlapping with your "no init" section.

Related