- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hi,
I try to read the cntfreq register in arria V evaluation board , ds-5 arm compiler 5.
I use the following line:
__asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)));
compilation failed with #18: expected a ")"
whar am I dong wrong?
thanks
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hi,
compiler v7 can have the single line syntax like below-
__asm("[;]");
__asm{[;]}
for reading CNTFREQ, assign global variable with volatile.
And try to run again,
volatile unsigned int freq=0;
void printReg()
{
__asm
{
mrc p15, 0, freq, c14, c0, 0
}
printf("freq=0x%X", freq);
}
let me know if you have any query on this.
Regards
Jeetesh
Link copiato
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hi,
Its seems error in the syntax used-
remove the one closing ) from the syntax.
Regards
Tiwari
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
I apologies, I wrote it here wrong.
I encountered two issues:
1. I tried to use "regular" syntax which I saw in other places as well and it didn't work.
(1.png)
I don't know what is wrong with this syntax.
2. I tried another syntax (2.png). now the code compiles but I have two problems:
- There is no volatile statement
- When I execute this asm code via debugger it halts when it reaches the asm code and that's it (I don't see the print value and can't continue to next step or running the debugger)
Thank you
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hi,
Can you try changing your first syntax by below-
__asm__ volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (freq));
Regards
Tiwari
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
this is not working as well (the syntax).
is it valid to arm compiler v5?
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hi,
If you have any other question on the matter, please let me know.
Regards
Jeetesh
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
I replied to your previous message above. Thank you for your help
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hi,
compiler v7 can have the single line syntax like below-
__asm("[;]");
__asm{[;]}
for reading CNTFREQ, assign global variable with volatile.
And try to run again,
volatile unsigned int freq=0;
void printReg()
{
__asm
{
mrc p15, 0, freq, c14, c0, 0
}
printf("freq=0x%X", freq);
}
let me know if you have any query on this.
Regards
Jeetesh

- Iscriversi a feed RSS
- Contrassegnare la discussione come nuova
- Contrassegnare la discussione come letta
- Sposta questo Discussione per l'utente corrente
- Preferito
- Iscriversi
- Pagina in versione di stampa