GP32 Chatrboard.. Spiv, Which Compiler? Issue?


skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,063
Website
www.codejedi.com
I see this:

void installIRQ( int num, void (*irq)(void) ) {
asm volatile(""
"stmdb sp!,{lr} \n"
"mov r0,%[_num] \n"
"mov r1,%[_irq] \n"
"swi #0x09 \n"
"ldmia sp!,{lr}"
:
: [_num] "r"(num), [_irq] "r"(irq)
: "r0","r1");
}

gcc spits out:

gp32kbd/kbdrv.c: In function `installIRQ':
gp32kbd/kbdrv.c:194: parse error before '[' token
gp32kbd/kbdrv.c: In function `removeIRQ':
gp32kbd/kbdrv.c:209: parse error before '[' token

I need to look up the syuntax for embedding asm into gcc code again and figure out whats up; anyone have a quick comment while I bang on chatboard support? :)

jeff
 
Ah crap, I think the aliasing of register names is in 3.1 or later; I'musing 3.0.2 compiler right now, so can't use the aliasing.. guess I'll have to sort them out with %1, %2 etc.. :/

jeff
 
OKay, fixed up the aliasing (only 3 changes in kbdrv.c needed.. let me know if you want me to paste the revised code, anyone).

It depends on the clock speed to fire up.. lets see if you can change the clock speed after init'ing the chatboard and see if it still works?

Otherwise need to make kbdrv.c take clockspeed or pclk speed in its param list, so that we can use chatboard without hacking kbdrv...

hmm..

jeff
 
Any trick to getting it to work at alternate clockrates?

#define PCLK 40000000
//#define PCLK 132000000


GpClockSpeedChange (PCLK, 0x48013, 0 );
GpLcdDisable();
GpGraphicModeSet(GPC_DFLAG_8BPP,NULL);
GpLcdSurfaceGet(&gpDraw[0], 0);
GpRectFill(NULL, &gpDraw[0], 0, 0, gpDraw[0].buf_w, gpDraw[0].buf_h, 0x00);
GpSurfaceSet(&gpDraw[0]); //gpDraw primary surface setting


if ( (n = preInitKbd(9600,PCLK)) == 1 ) {
TextOut (0, &gpDraw[0], 0, 10, "Press SMS key", 1);

Using PCLK of 40Mhz and it works. Swap #define's to use 132MHz and its a nogo.

The preInitKbd() seems to do things sensibly.. divides the pclk by the baud*mult, so in theory it should work. I suppose I should check with pllset to make sure thats actually the pclk I'm talking about..

jeff
 
Your GpClockSpeedChange line is borked. You need to put the right hex value in the second parameter for it to work. I actually don't think that just changing the clock speed number actually changes the clock speed at all.

Check out this topic, there's some good information in there.
 
Last edited by a moderator:
yeah, my brain was off actually. My main GpClockSpeed routine is correct; when I butchered this one here (in the chatboard-setup) I forgot to set the second param right, so I'll have to fiddle with that; still, as I was trying a few things quick. it didnm't matter if the line was correct or no (I normally set the clock elsehwere in the code where it was right ;) .. so I'll have to check the other settingsin the uart, etc..

Gotta run but wanted to reply quick :)

jeff
 
Back
Top