This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F2812 stack in secure memory

I'm looking into enabling the Code Security Module for my application which is running on an F2812. The code uses a custom scheduler, not the TI BIOS. Stack is currently 0x1000 words and is located in L0_SARAM (0x8000-0x9000). We also relocate executable code from flash into H0_SARAM at runtime for speed.

My question is, since H0_SARAM is unsecure memory, and L0_SARAM is secure memory, can functions executing from H0_SARAM make use of the stack which is in secure memory? Is the stack pointer exempt from secure memory access restrictions?

 

Thanks,

Ashish.

  • Ashish,

    Sorry the stack pointer is not exempt from security restrictions. So you will not be able to use secure memory as stack unless you are running code from secure memory.

    Regards,
    Dave Foley

     

  • Hi David,

    Thanks for replying. So are my only solutions either

      1. reduce the stack size and move it into M0/1 SARAM

      2. do not relocate code to H0 SARAM

    I'm currently at about 70% stack usage, so go down the first route is not a quick solution. The second one is not attractive either because this is a real time motor control application and we need to squeeze all the performance we can out of the code running from H0 SARAM.

    Is there any alternate solution you can think of?

     

    Thanks,

    Ashish.

  • Ashish,

    That is alot of stack. I cannot think of any good options. I think you could set the stack pointer to external memory, but that would slow things down as well. The only other alternative I can think of is to not use the security feature. However, that may not be attractive to you either. Sorry.

    Regards,
    Dave Foley

     

  • David,

    I was afraid you'd say that. I know it's a lot of stack, but it Simulink generated code and it tends to be quite 'stack happy'. I can get it to moves things off to global variables instead but the .ebss is currently on an external SRAM chip mapped to XINTF Zone 2 and this is not zero wait state. Similarly, we have other things mapped to Zones 0/1, so the stack cannot be moved off chip either. Looks like my only option is to continue without using code security.

     

    Thanks for all your help,

    Ashish.