Other Parts Discussed in Thread: HALCOGEN
Hello,
I'm having issues performing F021 API flash writes. I initialize the flash banks clock successfully, set the active flash bank, enable the bank sectors all as described by the flash API, but when I get to performing the flash write, using Fapi_issueAsyncCommandWithAddress, the program gets stuck in prefetchEntry.
I'm suspecting it's related to the mode I'm in. I'm using HalCoGen generated code and based on my understanding it puts you into User mode after initialization. The flash API explicitly says that flash operations must be performed in Privileged mode, and I know you can set the mode through the CPSR register. The issue is that not so strong with assembly, and can't seem to find good TI examples on how to do that. All the responses I've seen so far point me to the ARM reference manual, which is not really helpful in my case. I saw CPSR Register and Interrupt Intrinsics section in the ARM Optimizing C/C++ Compiler v18.12.0.LTS User Guide, but I didn't see an intrinsic for setting the mode.
Could someone please show me an example on how to do it? Again, I'm just suspecting that this is the issue, so I'll take any pointers from anyone else here about what the issue could be.
Thanks!