Monday, January 22nd 2018, 5:21pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

1

Monday, November 26th 2007, 1:24pm

J-Link, GDB and STR912

Hi,
i trying to use the J-Link with GDB-Server, J-Flash and Yagarto/GNU to program and debug my STR912FA44. I already compiled and downloaded something, but i still have problems to debug my application. Im not shure how to init and run the gdb particular for this processor (how to config e.g. from .gdbconfig or Eclipse Debug-Dialog). Somebody who already relised something in this combination?
Thanks and regards,
Thomas

marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

2

Monday, November 26th 2007, 7:40pm

Hi Thomas,

What are you exactly trying to do?
Do you want to program your application into flash and debug it with gdb/gdb-server?
If so, this will not work. The J-Link gdb-server does not support flash download.
Either you let your application in RAM (modify your linker file) or
you use an external tool to program the flash of the STR91x
and then use the gdb/gdb-server combo to debug your application.

Cheers,

marocprof

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

3

Monday, November 26th 2007, 9:19pm

Hi,
sorry for the unclear explanation. I use Yagarto as developement environment for my application and afterwards i download it to the controller with Segglers J-Flash. Now i would like to debug this application with gdb and gdb-server out of Eclipse, but i have no idea how to configure the gdb to initialize the str912 (the commands for the .gdbconfig file or the Eclipse Debuger-Panel, spezially for this type).
Regards,
Thomas

marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

4

Thursday, November 29th 2007, 3:00pm

Hi Thomas,

The initialization (or a gdb init file) is quite simple for the STR912.

The initialization (STR_912_J-Link.gdb) should only have these steps:

Source code

1
2
3
4
5
6
# connect to the J-Link gdb server
target remote localhost:2331
# set speed to JTAG speed to adaptive: STR912 is an ARM966E-S
monitor speed adaptive
# reset the target
reset 0


I think it would be best to do the first steps with makefile and arm-elf-insight (gdb + GUI front end).
If everything is working, the next steps would be to use the Yagarto stuff.
To integrate the debugger into Yagarto: I think it's quite well explained on the Yagarto website.
A good literature is the GNU-Based Software Development on AT91SAM Microcontrollers on the website.
Follow the step described in the manual except that you use the init steps that I have described above.

That's it.
Let me know if you need further help.
Regards,

marocprof

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

5

Thursday, November 29th 2007, 7:56pm

Thanks for your answers! I try it out in the next days and report the results :-)

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

6

Friday, November 30th 2007, 10:53am

I trying to use insight accordant to your description and i can connect to the device. But after connection i see only the assembler code and have no opportunity to set a breakpoint or something else. Thats the problem that i had all the time! I don't know if it's usefull but i use the adapted makefile that is used e.g. at the gnu/embos example for arm7 (avaiable at the Segger page), a adapted linker script based on a version of Keil and adapted for gnu by M. Thomas and startup-code based on a at91sam7s256 that is adapted for the str91x by someone. I don't know if there are any conditions. What's the problem??? Thanks for your help.

By the way, i already know the yagarto howto and the documentation of james p. lynch, there are both very helpful!!!

This post has been edited 1 times, last edit by "soundso" (Nov 30th 2007, 1:38pm)


marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

7

Friday, November 30th 2007, 2:20pm

Do you have a shortcut showing your problem?

Regards,

marocprof

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

8

Sunday, December 2nd 2007, 10:06pm

Sorry, what do you mean with shortcut? Screenshot???

marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

9

Monday, December 3rd 2007, 12:59pm

Sorry I meant screen shot.

Anyway, I took some time on the weekend and made a simple project for the STR912.
You can download it from
http://www.1webspace.biz/marocprof/index.html
It is a simple LED toggle project using GPIO6 as LED source.
The following make targets are available:
  • make ROM
    - builds a ROM version of the app.
  • make ROM
    - builds a RAM version of the app.
  • make all
    - builds both
  • make debug_rom
    - builds the ROM app and start arm-elf-insight
  • make debug_rom
    - builds the RAM app and start arm-elf-insight
  • make clean
    - cleans up.
Let me know if you can use that project and see source code instead of seeing only the assembler stuff.

Regards,

marocprof

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

10

Tuesday, December 4th 2007, 10:25am

Hi,
thanks, you really help me a lot!!! If i download and run your example with J-Flash (entering start-address 0x0) everything is fine and the led's are blinking. But if i try to debug it with Insight, doesn't matter with your make debug_rom or entering the commands to the Insight Command Window, i receive the warning "Program received signal SIGTRAP, Trace/brakepoint trap and Insight close. Ok, i know we tell the debuger to stop at the main function, but i can not continue runing the application. If i click "Run" oder "Next" or whatever, i see a warning at the GDB-Server (see screenshot) and Insight is switching to the Assembly view, telling me "Select function to disassemble". Sorry if i doing beginner's mistakes but i have no idea what's wrong :-S

(Ups, some webspace problems that i can not fix now. The screenshot is showing the warning at the gdb-server "Warning: Failed to read memory at address 0x8c010000)

This post has been edited 3 times, last edit by "soundso" (Dec 4th 2007, 2:57pm)


marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

11

Tuesday, December 4th 2007, 4:29pm

I do not have any problems with the project - I can program the flash and

use the arm-elf-insight to debug the application.

Just for verification:
Your J-Link gdb-server is set to little endian, isn't it?

marocprof

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

12

Tuesday, December 4th 2007, 4:40pm

Haaaaaaaaaaa, the gdb server was configurated for big endian!!! Thanks a lot. Thats at least a mention at the annex of my thesis for you :wacko: :wacko: :wacko:

marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

13

Tuesday, December 4th 2007, 5:16pm

:thumbsup: FANTASTIC NEWS :thumbsup:

I took a look into the J-Link gdb server manual and they have a command for setting the gdb server to little endian mode thru a monitor command. --> I have update the STR912.gdb file in my test project so that the gdb server is set to little endian mode.
If you're interested you can download it.

Have fun... :D

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

14

Tuesday, December 4th 2007, 6:23pm

I did the same modification after i saw it was just the endian problem. Your project was exaclty what i need. Now i try to understand what did and than i have a base to work with yagarto/gnu (iar's 32kb code limit is just to small with the time...) :D

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

15

Wednesday, December 5th 2007, 4:09pm

I have embeded your example in a Yagarto/Eclipse project and everythink works well. Now i can perfectly debug the application from the Eclipse IDE! Further i tryed to use the st software lib sources by adding the source folder to the project and adding the necessary source files at your "Source" file (e.g. SOURCES = ./leds.c ./source/91x_lib.c ...), but then you have to add some additional linke flags as well. I don't know exactly why, but it only works if --no-warn-mismatch is set, otherwise there is a error with the gcclib (... libgcc.a(_divsi3.o) uses FPA instructions, whereas leds_RAM.elf does not). If everything is working well, i also try to make my project public avaiable.

marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

16

Wednesday, December 5th 2007, 6:54pm

Looking forward to your project... :D

marocprof

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

17

Thursday, December 6th 2007, 2:28pm

Now everything is fine, but next problem are the interrupts. At the str91x software library you have a file 91x_it.c, where are handlers for all kinds of interrupts and you only have to implement the functionalitys for the configurated interrupts there. The connection between the handlers and the interrupts is automaticly done with the configuration in 91x_vic.c. But my handlers are not executed. I saw other versions of the startup_STR91x.s with a IRQ_Handler and i tryed to use this one but it works neither :-( What's your way to handle interrupts? You directly set the handler-address at the vic-register? It would be nice to use interrupts like as yet. But i still have my problems with this assembler startup. By the way, is there a good short introduction to this topic somewhere? Regards...

This post has been edited 1 times, last edit by "soundso" (Dec 6th 2007, 2:42pm)


marocprof

Beginner

Date of registration: Nov 19th 2007

Posts: 12

18

Tuesday, December 11th 2007, 8:19pm

HI Thomas,

I have been heavily busy since the last post.
But anyhow...Regarding the question you recently posted.
It is quite easily to implement.
I will check if I build a simple interrupt project that uses the ST library stuff.
More tomorrow.
BTW: We are drifting away from the initial problem.
I think it would be better to create a new thread in the "General" topic-folder.
What do you think? ?(

Cheers,

marocprof

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

19

Wednesday, December 12th 2007, 10:22am

Take it easy! I'm very happy for every help to any time. You already saved me years of time :-) But it would be nice if you also help me to solve that interrupt problem or you can give me some tips. Step by step i start to understand all this stuff, also the assembler startup, but not enouve detailed to make this cahnges. I can start a new topic in an other secction, but you don't thing it breaks the relation to the stuff that we have done already?

soundso

Beginner

Date of registration: Nov 26th 2007

Posts: 16

Location: Munich, Germany

Occupation: Student

20

Monday, January 7th 2008, 1:22pm

Happy new year! Is there a chance that we solve that interrupt-problem in 2008? :)
Regards.