Non-secure callable (NSC) region definition in flash

nRF5340 Product Specification

SPU provides support for the definition of non-secure callable (NSC) sub-regions to allow non-secure to secure function calls.

A non-secure callable sub-region can only exist within an existing secure region and its definition is done using the following registers:

  • FLASHNSC[n].REGION, used to select the secure region that will contain the NSC sub-region
  • FLASHNSC[n].SIZE, used to define the size of the NSC sub-region within the secure region

The NSC sub-region will be defined starting with the highest address in that region and descending. The following figure illustrates the NSC sub-regions and the registers used for their definition.

Figure 3. Non-secure callable region definition in the flash memory space
Page-1 Sheet.6 Sheet.7 Sheet.8 FLASHREGION[0].PERM FLASHREGION[0].PERM Sheet.9 FLASHNSC[0].REGION == n FLASHNSC[0].REGION == n Sheet.10 Sheet.11 Access control Access control Sheet.13 Sheet.14 FLASHREGION[n].PERM FLASHREGION[n].PERM Sheet.15 Sheet.16 Sheet.17 SPU registers SPU registers Dynamic connector Sheet.19 Region #n (secure) Region #n (secure) Sheet.21 NSC subregion 0 NSC subregion 0 Sheet.22 Sheet.24 Region size Region size Sheet.25 Sheet.26 Sheet.27 Flash address space Flash address space Sheet.28 Sheet.29 Sheet.30 Region #n-1 Region #n-1 Sheet.31 Region #n+1 Region #n+1 Dynamic connector.132 Sheet.33 2(m+4) bytes 2(m+4) bytes Nordic Blue FLASHNSC[0].SIZE == m m !=0 FLASHNSC[0].SIZE == m m !=0

The NSC sub-region will only be defined when the following are true:

  • FLASHNSC[i].SIZE value is non zero
  • FLASHNSC[i].REGION defines a secure region

If FLASHNSC[i].REGION and FLASHNSCj].REGION have the same value, there is only one sub-region defined as NSC, with the size given by the maximum of FLASHNSC[i].SIZE and FLASHNSC[j].SIZE.

If FLASHNSC[i].REGION defines a non-secure region, then there is no non-secure callable region defined and the selected region stays non-secure.