Can't find openocd.cfg

abhinav:
hi i have been trying to follow what u did on my desktop ans in the newlib stage when we do

make $PARALLEL CFLAGS_FOR_TARGET="-ffunction-sections \

-fdata-sections \

-DPREFER_SIZE_OVER_SPEED \

-D__OPTIMIZE_SIZE__ \

-Os \

-fomit-frame-pointer \

-mcpu=cortex-m3 \

-mthumb \

-D__thumb2__ \

-D__BUFSIZ__=256" \

CCASFLAGS=“-mcpu=cortex-m3 -mthumb -D__thumb2__”

the output ended with an error

make[2]: Leaving directory `/home/abhinav/stm32/newlib-1.17.0/build/arm-none-eabi/newlib’

make[1]: *** [all-target-newlib] Error 2

this was repeated several times.is it an error?or is it the way it should be behaving?i got a similar error for binutils.gcc configured and built without any error.

What was the actual build error?

/Johan

these are the last few lines of the output for binutils during make $PARALLEL

o …/bfd/libbfd.la …/libiberty/libiberty.a -lz

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -o cxxfilt cxxfilt.o bucomm.o version.o filemode.o …/bfd/.libs/libbfd.a …/libiberty/libiberty.a -lz

make[4]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/binutils’

make[3]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/binutils’

make[2]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/binutils’

make[1]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build’

make: *** [all] Error 2

and these are the last few lines during make install

…/…/gas/config/tc-arm.c:3473: error: format not a string literal and no format arguments

…/…/gas/config/tc-arm.c: In function ‘s_arm_unwind_save_mmxwcg’:

…/…/gas/config/tc-arm.c:3591: error: format not a string literal and no format arguments

…/…/gas/config/tc-arm.c:3606: error: format not a string literal and no format arguments

…/…/gas/config/tc-arm.c: In function ‘s_arm_unwind_movsp’:

…/…/gas/config/tc-arm.c:3712: error: format not a string literal and no format arguments

make[3]: *** [tc-arm.o] Error 1

make[3]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/gas’

make[2]: *** [install-recursive] Error 1

make[2]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/gas’

make[1]: *** [install-gas] Error 2

make[1]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build’

make: *** [install] Error 2

abhinav:
these are the last few lines of the output for binutils during make $PARALLEL

o …/bfd/libbfd.la …/libiberty/libiberty.a -lz

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -o cxxfilt cxxfilt.o bucomm.o version.o filemode.o …/bfd/.libs/libbfd.a …/libiberty/libiberty.a -lz

make[4]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/binutils’

make[3]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/binutils’

make[2]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build/binutils’

make[1]: Leaving directory `/home/abhinav/stm32/binutils-2.19/build’

make: *** [all] Error 2

Please note that every step on that page depends on the previous one,

so you can’t continue before it is ok.

Maybe you should start over and delete the content of ~/stm32/ and /usr/local/cross-cortex-m3/

And try to build binutils again.

And focus on what configure tells you, you may have some missing stuff in your build enviroment? (if so please tell me about it and I will update the documentation).

BR

Johan

wget http://fun-tech.se/stm32/gcc/binutils-2 … rm.c.patch

in binutils gave the error

abhinav@abhinav-desktop:~/stm32$ wget http://fun-tech.se/stm32/gcc/binutils-2 … rm.c.patch

–2009-10-27 12:19:23-- http://fun-tech.se/stm32/gcc/binutils-2 … rm.c.patch

Resolving fun-tech.se… 72.41.236.12

Connecting to fun-tech.se|72.41.236.12|:80… connected.

HTTP request sent, awaiting response… 404 Not Found

2009-10-27 12:19:24 ERROR 404: Not Found.

may be that caused the problem.is there a work around?

abhinav:
wget http://fun-tech.se/stm32/gcc/binutils-2 … rm.c.patch

in binutils gave the error

abhinav@abhinav-desktop:~/stm32$ wget http://fun-tech.se/stm32/gcc/binutils-2 … rm.c.patch

–2009-10-27 12:19:23-- http://fun-tech.se/stm32/gcc/binutils-2 … rm.c.patch

Resolving fun-tech.se… 72.41.236.12

Connecting to fun-tech.se|72.41.236.12|:80… connected.

HTTP request sent, awaiting response… 404 Not Found

2009-10-27 12:19:24 ERROR 404: Not Found.

may be that caused the problem.is there a work around?

Try again,

the patch file should be there now :roll:

/Johan

hi that worked.i could follow and get what u did.can u send me the documentation of what u did next i.e the getting something on to the board part.

also what we did is to compile a demo program using make file.how do we compile a c code from source without any make file?

abhinav:
hi that worked.i could follow and get what u did.can u send me the documentation of what u did next i.e the getting something on to the board part

Follow the links on the left side :wink:

A hint is to look at the “OpenOCD”-page and there you will

find a section called “Flash Olimex blinky example”.

That will show you how to flash the board :slight_smile:

BR

Johan

what abt compiling from source code part?

abhinav:
what abt compiling from source code part?

???

also what we did is to compile a demo program using make file.how do we compile a c code from source without any make file?

abhinav:
also what we did is to compile a demo program using make file.how do we compile a c code from source without any make file?

You should always use a Makefile,

it simplifies so much.

But if you look at the output from make:

cj@zap:~/stm32/projects/stm_h103$ make
.compiling
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb  main.c
main.c:76: warning: conflicting types for ‘myDelay’
main.c:61: warning: previous implicit declaration of ‘myDelay’ was here
main.c:90: warning: conflicting types for ‘Clk_Init’
main.c:43: warning: previous implicit declaration of ‘Clk_Init’ was here
.compil
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb  stm32f10x_rcc.c
.compili
arm-none-eabi-gcc -I./ -c -fno-common -O0 -g -mcpu=cortex-m3 -mthumb  stm32f10x_gpio.c
..linking
arm-none-eabi-ld -v -Tstm_h103_blink_rom.cmd -nostartfiles -o main.out  main.o stm32f10x_rcc.o stm32f10x_gpio.o
GNU ld (GNU Binutils) 2.19
...copying
arm-none-eabi-objcopy -Obinary main.out main.bin
arm-none-eabi-objdump -S main.out > main.list
cj@zap:~/stm32/projects/stm_h103$

You then can see all the steps needed to do it yourself.

  1. arm-none-eabi-gcc

  2. arm-none-eabi-ld

  3. arm-none-eabi-objcopy

/Johan

while doing the openocd part the command

flash write_bank 0 projects/stm_h103/main.bin 0 gave the error

flash write_bank 0 projects/stm_h103/main.bin 0

not enough working area available(requested 16384, free 8144)

wrote 4052 byte from file main.bin to flash bank 0 at offset 0x00000000 in 0.315007s (12.561725 kb/s)

how do i proceed?

abhinav:
while doing the openocd part the command

flash write_bank 0 projects/stm_h103/main.bin 0 gave the error

flash write_bank 0 projects/stm_h103/main.bin 0

not enough working area available(requested 16384, free 8144)

wrote 4052 byte from file main.bin to flash bank 0 at offset 0x00000000 in 0.315007s (12.561725 kb/s)

how do i proceed?

Don’t know,

but I did notice that there is a dir called

  • stm32/projects/stm_p103_blink_flash

You could try that one, and see what happens.

But this is strange since both the STM32-P103 and the STM32-H103 are based on STM32F103RBT6…

So you should not get this type of error???

BR

Johan

jsiei97:

abhinav:

flash write_bank 0 projects/stm_h103/main.bin 0

not enough working area available(requested 16384, free 8144)

wrote 4052 byte from file main.bin to flash bank 0 at offset 0x00000000 in 0.315007s (12.561725 kb/s)

how do i proceed?

Don’t know,

I got this error as well, yesterday…

but the strange thing is that everything seemed to work anyway.

So to ignore it could be a way forward…? :?

BR

Johan

ya me too.it worked anyway.but i thought there has to be a reason to avoid it and a method to overcome it if it repeats in future.anyway what are u working on now?i was trying to get hello world to run on the board so that i can check the output using gdb or openocd if possible.any tips?i am reading about writing the make file.sort of new to it.

abhinav:
ya me too.it worked anyway.but i thought there has to be a reason to avoid it and a method to overcome it if it repeats in future.anyway

True.

abhinav:
what are u working on now?i was trying to get hello world to run on the board so that i can check the output using gdb or openocd if possible.any tips?

I just got gdb working :smiley:

http://fun-tech.se/stm32/OpenOCD/gdb.php

Next step…? Don’t know.

Probably try to understand what those link scripts does and/or expand the blinky example with some timer interupts… but let’s see what happens :wink:

/Johan

k lets get clear on a few things first.i tried to understand what each does in google but it was very obscure.

correct me if i am wrong

1)to compile a code in c we use the toolchain we built.but exactly how?how do we launch or invoke it?

2)what exactly is difference between openocd and gdb?which one do we use to load programs?experience tells me we used openocd to load the flas program so do we use it to load any program?

3)what is gdb?i know its a debugger.but what does it exactly do?can we see the exact program in the board using it?in the starting of ur site u started off with installing them but did not mention what is what.so for beginners like me,its a problem to follow without knowing what it is.so if u can give a brief description or links whiv=ch dont use hifi computer language,it would be helpful to understand.

4)what exactly is eclipse?some sites say it is an inevitable tool for connecting to a board and working with it.but as we did things in the past we didnot use it for anything.so why would somebody want to use it?why why wouldnt somebody want to use it?these are all basic questions for a beginner.if u can include them in the beggning,ur link would become best from very good :stuck_out_tongue:

so please help

abhinav:
k lets get clear on a few things first.i tried to understand what each does in google but it was very obscure.

correct me if i am wrong

1)to compile a code in c we use the toolchain we built.but exactly how?how do we launch or invoke it?

gcc converts high level c-code into something the mcu can work with.

This must then be moved into the mcu:s memory,

for that we use the jtag.

abhinav:
2)what exactly is difference between openocd and gdb?which one do we use to load programs?experience tells me we used openocd to load the flas program so do we use it to load any program?

To control the jtag, we have some pc-software called OpenOCD

and that will flash/copy the code onto the mcu.

Then for debugging OpenOCD can control the inner parts and

change what is happening.

And this will be exposed thrue a gdb-server interface (that is part of OpenOCD).

abhinav:
3)what is gdb?i know its a debugger.but what does it exactly do?can we see the exact program in the board using it?in the starting of ur site u started off with installing them but did not mention what is what.so for beginners like me,its a problem to follow without knowing what it is.so if u can give a brief description or links whiv=ch dont use hifi computer language,it would be helpful to understand.

Then we use a gdb-client to connect to the gdb-server,

and that will let us control the mcu in a more human readable way.

abhinav:
4)what exactly is eclipse?some sites say it is an inevitable tool for connecting to a board and working with it.but as we did things in the past we didnot use it for anything.so why would somebody want to use it?why why wouldnt somebody want to use it?these are all basic questions for a beginner.if u can include them in the beggning,ur link would become best from very good :stuck_out_tongue:

so please help

Eclipse is a IDE/editor/gdb-client and more.

And most people like to have this kind of all-in-one tools,

since some things are easy to to there.

But the cost is that they usually hides some stuff from the user

(so it becomes more user friendly)

So if you like Eclipse or not is a matter of personal taste :wink:

(but you need to understand the lower layers even thou tools like Eclipse hide them from you…)

Hope this clears a little fog for you.

BR

Joahn

first let me tell u how much i appreciate all the pains taken by you to write reply for what all i asked.you must have been working with micro controllers for a long time.but any ideas how i can understand all the confusing lines of code and programs in gdb?you must have read many books and links when u were a beginner.can u point me in the right direction so that i can understand atleast an error msg …