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

Can't get RAM-based Secure Entry functions to work

I'm having trouble getting the Secure Entry gateway functions to work out of RAM. The nRF9160 datasheet has RAMNSC configurations, so it should be possible. We're able to get flash-based ones to work. Has anyone been able to have RAM-based Secure Entry functions?

I've confirmed the configuration of RAMNSC as well as RAMREGION in the SPU. It looks like the nRF9160 documentation has an error, however: it says the RAMNSC regions are 8K each, but there are only enough bits for 16K. Can anyone confirm if that's an error? Or perhaps it just doesn't support the full RAM range as NSC?

The only real difference I've noticed (beyond the annoying wrangling to get GCC to do what I want it to) is that there are "veneer" function calls for RAM functions that aren't used when calling the flash counterparts. In particular, it looks like the branch to the SG instruction in flash is a BL, while the branch to the SG instruction in RAM from the veneer is BX. I haven't been able to find any documentation on whether or not various branching methods work or don't work with TrustZone transitions. Is there any info on if BX will work?

Parents
  • Two updates:

    1) Looks like RAMNSC will hold more than 4 bits. I would assume the documentation (and the "mask" in nrf9160.h) is incorrect that it only holds 4 bits, but rather it holds 5 and is in increments of 8K still?

    2) I made a manual "veneer" RAM function that used BX to jump to the SG instruction in flash, but that succeeded, unlike when in RAM. So, it seems like there's no limitation on BL versus BX. Which means I've now run out of ideas as to what's going on.

    Hopefully either someone in the community or at least at Nordic has accomplished this at some point...

Reply
  • Two updates:

    1) Looks like RAMNSC will hold more than 4 bits. I would assume the documentation (and the "mask" in nrf9160.h) is incorrect that it only holds 4 bits, but rather it holds 5 and is in increments of 8K still?

    2) I made a manual "veneer" RAM function that used BX to jump to the SG instruction in flash, but that succeeded, unlike when in RAM. So, it seems like there's no limitation on BL versus BX. Which means I've now run out of ideas as to what's going on.

    Hopefully either someone in the community or at least at Nordic has accomplished this at some point...

Children
No Data
Related