Tuesday, January 23rd 2018, 2:45am UTC+1

You are not logged in.

  • Login
  • Register

enricol

Beginner

Date of registration: Feb 26th 2008

Posts: 1

21

Thursday, February 28th 2008, 5:29pm

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/products/supp…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:

Source code

1
2
3
4
5
6
7
8
9
10
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:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
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; 
}


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:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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.


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.

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

22

Tuesday, March 4th 2008, 2:11pm

Hi,
i uploaded my example project for Yagarto here ! Everything is working excepting this interrupt problem. If it is not works at your pc, maybe theres a installation problem and your compiler use the wrong librarys during the colpilation. I think i had a similar problem because it came in conflict with a installation of an other software.
Regards.

EmbDev

Beginner

Date of registration: May 19th 2008

Posts: 4

23

Monday, May 19th 2008, 11:28am

Hi,

is this topic still active? I could help you to solve the problems (ST library and IRQs).

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

24

Monday, May 19th 2008, 6:18pm

I needed this things for my thesis, which is done by now. But i think it would be still a good thing to solve this problem and i'm also intersited to see the solution just to know how it works. So it will be nice if you can give some support.

EmbDev

Beginner

Date of registration: May 19th 2008

Posts: 4

25

Wednesday, May 21st 2008, 10:25am

Hi,

so if you want to use the ST library you have to add -mfpu=fpa to your compiler options. Then it should work (at least it was like this for me). The problem with the IRQs could be the same I had. From what i have seen you want to execute out of the RAM. The IRQ vectors have to be in ROM address 0x00000000. The RAM starts at address 0x04000000. Therefore the interrupt adresses are 0x04XXXXXX. The ARM normally supports jumps which are 24bit. That way it cannot jump from the interrupt vector table from the ROM into the RAM. It does it once or twice when stepping but then.... you know. The solution is to compile the startup code containing the IRQ vectors (or the whole project) with the option -mlong-calls. Then the ARM supports 32bit jumps which should do it.

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

26

Sunday, June 1st 2008, 11:09am

Sadly i have no equipment to try it yet out but thanks for your support.