J-Link, GDB and STR912

  • 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:

    Code
    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:


    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:


    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.

  • 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.

  • 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.

  • 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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!