Hi marocprof and soundso,
First of all, thank you both for sharing your str9 projects in here. I finally got my STR9 dongle working using the Yagarto/GNU/J-Link combo.
So I moved on and tried to port the ST library (downloaded from the link below) into my Eclipse project.
http://www.st.com/stonline/produ…iles/um0233.zip
However, I got a whole series of errors during compilation. When I imported the 91x_scu.c file specifically, I got the following error when I built:
make all
arm-elf-gcc -mcpu=arm966e-s -c -g -gdwarf-2 91x_scu.c -o 91x_scu.o -I. -Ilibrary/inc
arm-elf-gcc -mcpu=arm966e-s -S 91x_scu.c -I. -Ilibrary/inc
arm-elf-gcc -mcpu=arm966e-s -nostartfiles -o skeleton_RAM.elf -T STR91xx44_RAM.ld startup_STR91x.o 91x_scu.o main.o --no-warn-mismatch
c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe: ERROR: c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2\libgcc.a(_divsi3.o) uses FPA instructions, whereas skeleton_RAM.elf does not
c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2\libgcc.a(_divsi3.o)
c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe: ERROR: c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2\libgcc.a(_dvmd_tls.o) uses FPA instructions, whereas skeleton_RAM.elf does not
c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file c:/apps2/yagarto/bin/../lib/gcc/arm-elf/4.2.2\libgcc.a(_dvmd_tls.o)
collect2: ld returned 1 exit status
make: *** [RAM] Error 1
As you may already notice, I've already added the --no-warn-mismatch flag, but the problem still persisted.
Next, I examined the 91x_scu.c line by line and I found out the problem resided in the following function:
u32 SCU_GetPLLFreqValue(void)
{
u8 PLL_M;
u8 PLL_N;
u8 PLL_P;
PLL_M = SCU->PLLCONF&0xFF;
PLL_N = (SCU->PLLCONF&0xFF00)>>8;
PLL_P = (SCU->PLLCONF&0x70000)>>16;
if ((PLL_M>0)&&(PLL_N>0))
//return (u32)(((_Main_Crystal*2)*PLL_N)/(PLL_M<<PLL_P));
return 1;
else return 0;
}
Display More
The compilation error will disappear after I commented the line above (since I didn't call this function anyways). I wonder why?! @_@
Now that I could compile successfully, I turned on J-Link GDB Server and tried to debug my project into RAM. I got the following error:
No source file named skeleton_RAM.elf.
source .gdbinit
target remote localhost:2331
0x00000160 in ?? ()
Cannot access memory at address 0xe24dd010
monitor endian little
Target endianess set to "little endian"
monitor speed adaptive
Select adaptive clocking instead of fixed JTAG speed
monitor reset 0
Resetting target (halt after reset)
break main
Breakpoint 1 at 0x4001180: file main.c, line 62.
load
Loading section .text, size 0x11f0 lma 0x4000000
Remote communication error: Bad file descriptor.
continue
putpkt: write failed: No error.
Display More
I am totally stuck. All I want to do is to make use of the ST library in my project. Any help/guidance would be greatly appreciated!
Regards,
PS: soundso, did you get your VIC working already? I will eventually need interrupts in my project too.