Other Parts Discussed in Thread: HALCOGEN
Hi :)
What is the correct approach for using HalCoGen generated drivers when MPU is enabled?
For example, when I try to use the SCI driver to receive some data using interrupts, I can call sciReceive() function. The normal unprivileged FreeRTOS task which calls sciReceive() function has only access to its own stack and additional task-specific memory regions if defined. The problem is that HalCoGen uses some static global structures that sciReceive() refers to (in this case g_sciTransfer) but that are outside of this default task's memory access permissions. Calling sciReceive() ends up with data abort. So either HalCoGen generated source code needs to be modified outside the USER CODE BEGIN - USER CODE END sections or some additional logic needs to be added to the user code, or the user needs to write his own sci driver that does not use HalCoGen global structures or it has to be a privileged task (the last option is not desired of course).
Cheers,
Adam