I want to work with the GLCD display on TMS570 MDK, and have tried to port "MCBTMS570 ConfTest" from Keil to CCS.
The aim is to rewrite MPU functions, listed in file "R4_MPU_Config.c":
__asm void Set_MPU_Region (unsigned int region,unsigned int base_addr, unsigned int access, unsigned int size) {
MCR p15, #0, r0, c6, c2, #0
MCR p15, #0, r1, c6, c1, #0
MCR p15, #0, r2, c6, c1, #4
MCR p15, #0, r3, c6, c1, #2
BX lr
}
__asm void Enable_MPU(void) {
MRC p15, #0, r1, c1, c0, #0
ORR r1, r1, #0x1
DMB
MCR p15, #0, r1, c1, c0, #0
ISB
BX lr
}
I have no experience with Keil.. but as I think, "__asm" prefix determines that function must be in asm code, so as I have decided the ported CCS functions can look like these:
void Set_MPU_Region(unsigned int region,unsigned int base_addr, unsigned int access, unsigned int size)
{
asm("MCR p15, #0, r0, c6, c2, #0");
asm("MCR p15, #0, r1, c6, c1, #0");
asm("MCR p15, #0, r2, c6, c1, #4");
asm("MCR p15, #0, r3, c6, c1, #2");
asm("BX lr");
}
void Enable_MPU(void)
{
asm("MRC p15, #0, r1, c1, c0, #0");
asm("ORR r1, r1, #0x1");
asm("DMB");
asm("MCR p15, #0, r1, c1, c0, #0");
asm("ISB");
asm("BX lr");
}
As a result of compilation I see some error message: [E0002] Illegal mnemonic specified.
Is it nessesary to write all asm functions for CCS in ".asm" files, or can the problem be something else?