This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF51822_xxAC, split RAM into 2 regions

Hi

I'm doing some S/W based on nRF51822_xxAC. I want to split RAM into 2 regions, as following:

+-------------+ 0x20008000
|__ __ _ __ |
|APP ZONE2 |
+-------------+ 0x20004000
|
__ _ _ _ _ |
| STACK |stack size=0x1000
|
_ __ _ __ __|
| HEAP |heap size=0
+-------------+
|APP ZONE1 |
+-------------+0x20002000
| S110 8.0.0 |
+-------------+0x20000000

Please see if the correct? Safe for stack overflow or hardhalt?

  • Hi Zhiqun,

    there are no safety mechanisms in our SoftDevices/SKDs so how "safe" the configuration is against stack overflow will depend on how much RAM your application uses and how often the SoftDevice is invoked. Remember that the SoftDevice and the application shares the stack.

    Are you using Keil or GCC to compile your application?

    Is there a specific reason to why you need to split the RAM into two application sections?

    Bjørn

  • Hi, Bjom

    Thanks for your answer.

    Yesterday, I found some global variable of APP ZONE 2 is not to be inited to ZERO. Then I redefine the scatter file as follow(IRAM2) to cover the failure:

    LR_IROM1 0x00020100 0x00008000  {    ; load region size_region
    	ER_IROM1 0x00020100 0x00008000  {  ; load address = execution address
    		*.o (descriptor, +First)
    		.ANY (+RO)
    	}
    	RW_IRAM1 0x20003900 0x00002000  {  ; RW data
    		.ANY (+RW +ZI)
    	}
    	RW_IRAM2 0x20005E00 0x00000100
    	{
    		ff.o (+RW +ZI)
    	}
    }
    

    I use Keil.

    I split the RAM into two application sections, so I can put my factory codes into ZONE1 and custom-defined code into ZONE2.

  • Are you using the S110 v8.0.0 SoftDevice? If so, then I think the IROM1 start address should be 0x00018000 and not 0x00020100. The IRAM2 section is the one for factory settings, since its only 256bytes right?

  • Yes, I'm using S110 v8. I split the whole RAM into two regions. The first region APP_ZONE1's start address is 0x00018000, the second region APP_ZONE2's scatter file is as the above.

    APP_ZONE2 will be used for customer's self-defined codes ram. For example, after power-up and some init codes of main() in APP_ZONE1, software will jump to 0x20100 to run customer's self-defined codes.

  • Ok, do you have any issues with this setup`?

Related