Hello, I am using HALcogen to generate my code, but whenever I use _coreEnableFlashEcc_() function provided by HALcogen it causes a prefetch exception.
Here is the coded provided by HALcogen:
_coreEnableFlashEcc_ stmfd sp!, {r0} mrc p15, #0x00, r0, c1, c0, #0x01 orr r0, r0, #0x02000000 dmb mcr p15, #0x00, r0, c1, c0, #0x01 ldmfd sp!, {r0} bx lr .endasmfunc
the instructions up to ldmfd are doing their job properly.
When this instruction is executed in THIS function, it causes a prefecth abort exception, even though all other functions that use the same mechanism don't cause it.
Any ideas aso to why this is happening?
EDIT:
Everything works fine when I remove it by generating a new code with HALcogen.
EDIT2:
If I remove the internal code that is enabling the flash ECC, ATCMPCEN bit, it works fine, excepth for the code that checks the fucntionality for flash ECC, as excepted.
EDIT3:
I just finished installing CCS5.4, using compiler version TI 5.0.4, instead of TI 5.1.1 and noticed that it worked perfectly. Suggestions as to why it isn't working?