[quote user="ReinierC"]I seem to run into problems when I exit in SECUREWITHSK mode (as configured in the INI file). For starters I simply created DSP/BIOS task which toggles a LED in a while(1) loop, using TSK_sleep(). When I exit in NONSECURE mode, this simple application executes perfectly, but as soon as I exit with SECUREWITHSK mode, the application seems to cause a UTL_halt().[/quote]
Hi Reinier,
I am not familiar with these modes associated with "exit" and an INI file. I know secure kernel code and its architecture, its C (or asm, really) interface and DSP/BIOS integration. What do you mean when you say something like "problems when I exit in SECUREWITHSK mode"? What is this mode and what is "exiting"?
[quote user="ReinierC"]
I am aware that the hardware should be enabled in the INI file with the PSCCONFIG, MPUCONFIG and IOPUCONFIG commands. I believe I am doing this correct, since I am using the example INI files which were supplied to me.
[/quote]
Again this is all unfamiliar terminology to me, are you using SK and DSP/BIOS with some overlying package?
I'm getting the sense that this "exit" mode has to do with the transition from secure kernel bootup to non-secure kernel code. DSP/BIOS should be executing in NONSECURE mode, as dictated from a security standpoint, and the problem may well occur because the DSP/BIOS app is placed in non-secure memory (again, as it should be). If you wanted it to run your DSP/BIOS application in secure mode (which is what I assume would be happening when the "exit" mode is SECUREWITHSK) then you would have to modify SK to give secure permission to the code memory and/or data memory that the DSP/BIOS application uses. However, from what I know about DSP/BIOS-with-SK customers, the DSP/BIOS application runs in NONSECURE mode.
[quote user="ReinierC"]
I have a suspicion that my problem somehow lies in the context switching with the secure stack. If I put the LED toggling functionality in the main() function (not using TSK_sleep(), just for-loops for crude delays), it works fine, but as soon as I move it to a task, it does not work anymore.
[/quote]
Please be aware that, as far as secure kernel is concerned, a DSP/BIOS application is just some non-secure caller/user of the SK APIs, and as such secure kernel knows nothing of DSP/BIOS TSKs and their associated stacks and stack switching. There is no "OS" associated with DSP/BIOS, i.e., within the DSP/BIOS application there is no different modes such as user/supervisor or secure/nonsecure. DSP/BIOS is mostly a real-time toolkit where all code (including all DSP/BIOS library code) executes at the same level.
You may be mixing up DSP/BIOS task switching with the secure kernel stack contexts. When a secure kernel API is invoked through the SWE asm instruction mechanism, the secure kernel knows that it needs to save the existing non-secure stack pointer, switch to a secure stack, run the API, and then switch back to the non-secure stack. It doesn't know that DSP/BIOS switches the stack between tasks, nor does it care.
Regards,
- Rob