mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Merge pull request #7971 from JammuKekkonen/fix_softdevice_memory_reservation_for_nrf52dk
Fix memory reservation for Softdevice in NRF52_DKpull/8040/head
						commit
						76827c3704
					
				| 
						 | 
				
			
			@ -9,13 +9,13 @@
 | 
			
		|||
  #define MBED_APP_SIZE 0x80000
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* If app_start is 0, do not set aside space for the softdevice */
 | 
			
		||||
#if MBED_APP_START == 0
 | 
			
		||||
  #define MBED_RAM_START  0x20000000
 | 
			
		||||
  #define MBED_RAM_SIZE   0x10000
 | 
			
		||||
#else
 | 
			
		||||
/* If softdevice is present, set aside space for it */
 | 
			
		||||
#if defined(SOFTDEVICE_PRESENT)
 | 
			
		||||
  #define MBED_RAM_START  0x200031D0
 | 
			
		||||
  #define MBED_RAM_SIZE   0xCE30
 | 
			
		||||
#else
 | 
			
		||||
  #define MBED_RAM_START  0x20000000
 | 
			
		||||
  #define MBED_RAM_SIZE   0x10000
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define MBED_RAM0_START MBED_RAM_START
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,13 +25,13 @@
 | 
			
		|||
  #define MBED_APP_SIZE 0x80000
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* If app_start is 0, do not set aside space for the softdevice */
 | 
			
		||||
#if MBED_APP_START == 0
 | 
			
		||||
  #define MBED_RAM_START  0x20000000
 | 
			
		||||
  #define MBED_RAM_SIZE   0x10000
 | 
			
		||||
#else
 | 
			
		||||
/* If softdevice is present, set aside space for it */
 | 
			
		||||
#if defined(SOFTDEVICE_PRESENT)
 | 
			
		||||
  #define MBED_RAM_START  0x200031D0
 | 
			
		||||
  #define MBED_RAM_SIZE   0xCE30
 | 
			
		||||
#else
 | 
			
		||||
  #define MBED_RAM_START  0x20000000
 | 
			
		||||
  #define MBED_RAM_SIZE   0x10000
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define MBED_RAM0_START MBED_RAM_START
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,13 +11,13 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
 | 
			
		|||
    define symbol MBED_APP_SIZE = 0x80000;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* If app_start is 0, do not set aside space for the softdevice */
 | 
			
		||||
if (MBED_APP_START == 0) {
 | 
			
		||||
  define symbol MBED_RAM_START = 0x20000000;
 | 
			
		||||
  define symbol MBED_RAM_SIZE  = 0x10000;
 | 
			
		||||
} else {
 | 
			
		||||
/* If softdevice is present, set aside space for it */
 | 
			
		||||
if (isdefinedsymbol(SOFTDEVICE_PRESENT)) {
 | 
			
		||||
  define symbol MBED_RAM_START = 0x200031D0;
 | 
			
		||||
  define symbol MBED_RAM_SIZE  = 0xCE30;
 | 
			
		||||
} else {
 | 
			
		||||
  define symbol MBED_RAM_START = 0x20000000;
 | 
			
		||||
  define symbol MBED_RAM_SIZE  = 0x10000;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
define symbol MBED_RAM0_START = MBED_RAM_START;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -706,8 +706,8 @@ class mbedToolchain:
 | 
			
		|||
            self._add_defines_from_region(region)
 | 
			
		||||
            if region.active:
 | 
			
		||||
                for define in [
 | 
			
		||||
                        ("%s_START" % active_region_name, region.start),
 | 
			
		||||
                        ("%s_SIZE" % active_region_name, region.size)
 | 
			
		||||
                        ("%s_START" % active_region_name, "0x%x" % region.start),
 | 
			
		||||
                        ("%s_SIZE" % active_region_name, "0x%x" % region.size)
 | 
			
		||||
                ]:
 | 
			
		||||
                    define_string = self.make_ld_define(*define)
 | 
			
		||||
                    self.ld.append(define_string)
 | 
			
		||||
| 
						 | 
				
			
			@ -747,6 +747,11 @@ class mbedToolchain:
 | 
			
		|||
        self.config_data = config_data
 | 
			
		||||
        # new configuration data can change labels, so clear the cache
 | 
			
		||||
        self.labels = None
 | 
			
		||||
        # pass info about softdevice presence to linker (see NRF52)
 | 
			
		||||
        if "SOFTDEVICE_PRESENT" in config_data[1]:
 | 
			
		||||
            define_string = self.make_ld_define("SOFTDEVICE_PRESENT", config_data[1]["SOFTDEVICE_PRESENT"].macro_value)
 | 
			
		||||
            self.ld.append(define_string)
 | 
			
		||||
            self.flags["ld"].append(define_string)
 | 
			
		||||
        self.add_regions()
 | 
			
		||||
 | 
			
		||||
    # Creates the configuration header if needed:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -325,7 +325,7 @@ class ARM(mbedToolchain):
 | 
			
		|||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def make_ld_define(name, value):
 | 
			
		||||
        return "--predefine=\"-D%s=0x%x\"" % (name, value)
 | 
			
		||||
        return "--predefine=\"-D%s=%s\"" % (name, value)
 | 
			
		||||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def redirect_symbol(source, sync, build_dir):
 | 
			
		||||
| 
						 | 
				
			
			@ -426,7 +426,7 @@ class ARMC6(ARM_STD):
 | 
			
		|||
            self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
 | 
			
		||||
        # Add linking time preprocessor macro __DOMAIN_NS
 | 
			
		||||
        if target.core == "Cortex-M23-NS" or self.target.core == "Cortex-M33-NS":
 | 
			
		||||
            define_string = self.make_ld_define("__DOMAIN_NS", 1)
 | 
			
		||||
            define_string = self.make_ld_define("__DOMAIN_NS", "0x1")
 | 
			
		||||
            self.flags["ld"].append(define_string)
 | 
			
		||||
 | 
			
		||||
        asm_cpu = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -293,7 +293,7 @@ class GCC(mbedToolchain):
 | 
			
		|||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def make_ld_define(name, value):
 | 
			
		||||
        return "-D%s=0x%x" % (name, value)
 | 
			
		||||
        return "-D%s=%s" % (name, value)
 | 
			
		||||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def redirect_symbol(source, sync, build_dir):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -273,7 +273,7 @@ class IAR(mbedToolchain):
 | 
			
		|||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def make_ld_define(name, value):
 | 
			
		||||
        return "--config_def %s=0x%x" % (name, value)
 | 
			
		||||
        return "--config_def %s=%s" % (name, value)
 | 
			
		||||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def redirect_symbol(source, sync, build_dir):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue