Current Server Time: 22:15 (Central Europe)

#apertus IRC Channel Logs

2014/06/25

Timezone: UTC


02:44
gwelkind
left the channel
02:46
gwelkind
joined the channel
02:59
gwelkind
left the channel
04:35
Bertl
off to bed now ... have a good one everyone!
07:14
wescotte
joined the channel
07:57
se6astian
joined the channel
07:58
se6astian
good morning
11:18
Bertl
morning folks!
13:30
sb0
left the channel
14:34
jucar1
left the channel
14:36
jucar
joined the channel
14:52
jucar
left the channel
15:05
jucar
joined the channel
15:24
se6astian
left the channel
17:13
se6astian
joined the channel
17:17
se6astian
left the channel
17:39
se6astian
joined the channel
17:52
skinkie
joined the channel
17:52
skinkie
Bertl: hi, are you currently around?
17:52
Bertl
yup, how's going?
17:53
skinkie
lets say I need help with the SDK
17:53
Bertl
okay :)
17:53
skinkie
I have managed to setup the SDK et al, also compiled my "own" gcc version which works on my platform and isn't 32bit
17:54
Bertl
okay, but you probably want a cross compiler :)
17:54
skinkie
with a few minor alterations (because of the changed *-gcc) to the Makefile I am manage to compile all libraries
17:54
skinkie
crosscompiler is there :)
17:54
skinkie
the Xilinx libraries that is
17:54
Bertl
okay
17:55
skinkie
But, from the Xilinx SDK GUI the number of errors flooding my screen makes me cry, from undefined __ctype_ptr__ (which was relatively easily solved)
17:55
skinkie
to Xil_out16 which is undefined
17:55
skinkie
I read that it might be related to a not specified Uart
17:56
skinkie
1) is it possible to compile zynq_fsbl_0.elf directly from the console?
17:56
skinkie
2) did you modify anything related to the standard build that might account for these curious errors?
17:57
skinkie
(so I have now: librsa.a, libxil.a. libxilffs.a)
17:57
Bertl
well, first, I built for the ZedBoard, and it was back then with rather old tools
17:57
Bertl
(so a number of things might have changed since)
17:58
skinkie
I did figure out how to get the errors on the console, so that already makes me happy
17:58
Bertl
but let me see if I can get my notes working with recent tools, what version do you use ATM?
17:59
skinkie
http://pastebin.com/czjAwRmi
17:59
skinkie
arm-xilinx-linux-gnueabi-gcc-4.8.3 (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3
18:12
Bertl
okay, I just tried what I did back then and this seems to work with 2014.2 as well
18:13
Bertl
which basically is to start the sdk (xsdk) and create a new Application Project named 'microzed_fsbl' and select FSBL for the microzed
18:14
skinkie
yup that is what i did
18:14
Bertl
then build the project and you end up with the microzed_fsbl.elf
18:14
skinkie
i don't mind to try it again
18:14
Bertl
there is a makefile there as well, which should work from commandline as well
18:14
skinkie
what do you choose as target software?
18:15
skinkie
C / standalone?
18:15
Bertl
I'll repeat the steps now and tell you what choices I made
18:16
Bertl
first, the workspace (any dir will do)
18:16
Bertl
then file/new/application project
18:17
Bertl
name 'microzed_fsbl' platform MicroZed_hw_platform
18:17
Bertl
target software is 'C', OS standalone, BSP Create new
18:18
skinkie
yes
18:18
Bertl
then 'next' and Zynq FSBL
18:18
skinkie
yes
18:19
Bertl
finish and project 'build all'
18:19
skinkie
that doesn't work because i cannot use the xilinx toolchain
18:19
Bertl
hmm, okay, what's the problem with that?
18:19
skinkie
its 32bit
18:19
Bertl
and you system doesn't execute 32bit binaries?
18:20
skinkie
(and i am not running multilib)
18:20
skinkie
exactly
18:20
Bertl
okay, well, maybe enabling that in the kernel would help :)
18:20
Bertl
anyway, the command executed is:
18:20
skinkie
it is unrelated to the kernel
18:20
Bertl
arm-xilinx-eabi-gcc -Wall -O0 -g3 -I"/var/opt/AXIOM/PROJ/MicroZed/workspace/MicroZed_hw_platform" -c -fmessage-length=0 -I../../microzed_fsbl_bsp/ps7_cortexa9_0/include -MMD -MP -MF"src/ps7_init.d" -MT"src/ps7_init.d" -o "src/ps7_init.o" "/opt/Xilinx/SDK/2014.2/data/embeddedsw/lib/hwplatform_templates/MicroZed_hw_platform/ps7_init.c"
18:20
skinkie
it is lacking glibc
18:20
Bertl
Finished building: /opt/Xilinx/SDK/2014.2/data/embeddedsw/lib/hwplatform_templates/MicroZed_hw_platform/ps7_init.c
18:21
Bertl
argh, copy paste
18:21
skinkie
anyway I am able to build my 'bertl_bsp'
18:21
skinkie
with some minor modifications
18:21
Bertl
arm-xilinx-eabi-gcc -L"/var/opt/AXIOM/PROJ/MicroZed/workspace/microzed_fsbl/src" -Wl,-T -Wl,../src/lscript.ld -L../../microzed_fsbl_bsp/ps7_cortexa9_0/lib -o "microzed_fsbl.elf" ./src/ddr_init.o ./src/fsbl_handoff.o ./src/fsbl_hooks.o ./src/image_mover.o ./src/main.o ./src/md5.o ./src/nand.o ./src/nor.o ./src/pcap.o ./src/ps7_init.o ./src/qspi.o ./src/rsa.o ./src/sd.o -lrsa -Wl,--start-group,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilffs,-lxil,-
18:23
skinkie
Running Make libs in ps7_cortexa9_0/libsrc/uartps_v2_1/src
18:23
skinkie
make -C ps7_cortexa9_0/libsrc/uartps_v2_1/src -s libs "SHELL=/bin/sh" "COMPILER=arm-xilinx-linux-gnueabi-gcc" "ARCHIVER=arm-xilinx-linux-gnueabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-g"
18:23
skinkie
Compiling uartps
18:23
skinkie
Finished building libraries
18:23
skinkie
that part works for me
18:23
skinkie
thats in "bertl_bsp"
18:24
Bertl
what about 'make microzed_fsbl.elf' ?
18:24
skinkie
Finished building: /home/skinkie/Sources/MicroZed_hw_platform/ps7_init.c
18:24
skinkie
that one too
18:24
Bertl
or in your case, bertl_bsp.elf I guess
18:25
skinkie
/tmp/cc4kxlXU.s:363: Error: selected processor does not support ARM mode `dsb'
18:25
skinkie
thats the first problem i am able to fix by the correct mcpu
18:26
skinkie
/home/skinkie/Sources/bertl_bsp/ps7_cortexa9_0/libsrc/standalone_v4_1/src/xil_printf.c:131: undefined reference to `__ctype_ptr__'
18:28
Bertl
-lgcc ?
18:29
Bertl
depending on the compiler you're using try adding the libraries in different places
18:29
Bertl
i.e. some gcc versions tend to drop libraries if they are not used right away
18:31
Bertl
but I'm a little confused to why the xilinx tools don't work for you, because if the kernel has 32bit support, the tools bring the libraries with them IIRC, so libraries shouldn't be a problem
18:34
Bertl
/opt/Xilinx/SDK/2014.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/libc/lib/libm.so.6 for example
18:35
skinkie
the problem is that the tools refer to /lib/ld-linux.so.2
18:35
skinkie
hence you need to have that
18:36
skinkie
bash: /mnt/usb/Xilinx/SDK/2014.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/bin/gcc: No such file or directory
18:36
skinkie
but anyway i am also able to resolve the ctype error
18:36
skinkie
but after that one i am stuck
18:39
skinkie
at least i was...
18:41
skinkie
brb
18:43
Bertl
did you try LD_LIBRARY_PATH=/opt/Xilinx/SDK/2014.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/libc/lib/ /opt/Xilinx/SDK/2014.2/gnu/arm/lin/bin/arm-xilinx-eabi-gcc
18:45
Bertl
or setting an LD_LIBRARY_PATH in general?
19:24
skinkie
just tried it, that doesn't work
19:24
skinkie
and to be extremely specific, my kernel does have IA32 emulatoin
19:25
skinkie
anyway if this all doesn't work out i'll copy this to another box with multilib support
19:25
skinkie
but this is kind of a showstopper for anyone with their own toolchain
19:26
Bertl
agreed, and I'm all for it if you can resolve it
19:26
Bertl
OTOH, we might be fine with uploading a precreated fsbl
19:27
Bertl
(if legal) or by providing a kvm environment to build in
19:27
Bertl
(after installing the tools of course)
19:28
skinkie
sure
19:28
skinkie
i think the best way would be to github the output of the xilinx package
19:28
skinkie
that can be compiled with any crosscompiled arm gcc
19:29
skinkie
but i am not at that stage yet ;)
19:54
Bertl
you'll get there :)
19:57
skinkie
/usr/libexec/gcc/arm-xilinx-linux-gnueabi/ld: error: required section '.got' not found in the linker script
19:57
skinkie
have you got a clue about that one?
20:04
Bertl
thats a metadata section it seems
20:05
skinkie
if you help me fix this one i have a working workaround for all the problems, and i know how to reproduce it ;)
20:06
Bertl
.got is global offset table
20:07
Bertl
it is used for dynamic linking and libraries
20:08
Bertl
http://www.skyfree.org/linux/references/ELF_Format.pdf
20:09
skinkie
-Wl,-T -Wl,../src/lscript.ld
20:09
skinkie
that does seem to define a 'got' section
20:10
Bertl
check if the linker (ld) is actually using that script
20:11
Bertl
(turn up the verbosity and/or use strace -fF :)
20:13
skinkie
it certainly does open it
20:16
skinkie
when i remove the .got from the linker script it complains about .rel.plt not being found
20:17
Bertl
ah, okay, maybe a syntax problem
20:17
Bertl
the linker script parser is not very smart
20:17
Bertl
i.e. look at maybe weird characters or strange newlines before that point
20:17
skinkie
so when i move .got above the .data section
20:17
skinkie
i get that
20:20
skinkie
. This tools doesn't support dynamic
20:20
skinkie
linkage for cortex-m
20:20
se6astian
left the channel
20:20
skinkie
it might be that problem
20:20
Bertl
ah, yes, indeed
20:21
skinkie
but given that we are running a cortex-a9
20:21
Bertl
but google says, no tools support that for cortex-m :)
20:21
Bertl
so, yes, wrong cpu type
20:23
skinkie
it isn't that simple as justing adding mcpu
20:24
Bertl
you probably need to add it to previous steps as well
20:24
Bertl
and ld might require something special
20:26
Bertl
If ld cannot find a matching library, it falls back to the default one. There is no error message.
20:26
Bertl
arm-none-eabi-gcc -print-multi-lib
20:27
Bertl
arm-none-eabi-gcc -print-multi-directory -mcpu=cortex-a9
20:27
Bertl
it seems, you might have _another_ multilib problem :)
20:31
skinkie
if i tell you i have an elf file now
20:31
skinkie
will you believe me
20:32
Bertl
of course :)
20:32
skinkie
Because I have absolutely no clue what I am doing, except solving problems
20:32
skinkie
I added a section .rel.plt
20:32
skinkie
and it magically worked
20:33
Bertl
ah, is there a .got.plt too?
20:33
skinkie
actually there was none
20:33
Bertl
hmm, interesting
20:34
skinkie
so given what i have build now, will probably not explode the board
20:34
skinkie
what can i do with this elf file to verify it does something?
20:35
skinkie
i can obviously follow the next sections of the wiki ;)
20:35
Bertl
simplest test would be to combine it with a bitstream which blinks the (only available) led
20:35
skinkie
is there an example to do so?
20:35
Bertl
or you can take a leap of faith and combine it with uboot
20:36
skinkie
thats deep ;)
20:36
Bertl
yes, sec, I'm sure I have a blink example
20:36
skinkie
btw the 'reent' code is the problem
20:36
skinkie
i removed that, skipped the errno with return NULL
20:37
Bertl
just keep track of the hacks :)
20:40
Bertl
http://vserver.13thfloor.at/Stuff/AXIOM/BETA/blink_done/
20:40
Bertl
I also uploaded the .bit file in the build.vivado dir
20:41
Bertl
try to upload it via jtag first to see if it works as expected
20:41
Bertl
you can convert the .bit to a .bin with promgen
20:42
Bertl
promgen -w -b -p bin -u 0 blink.bit -data_width 32
20:43
skinkie
and what provides promgen?
20:44
skinkie
it isn't between the SDK tools so to speak
20:45
Bertl
yeah, IIRC it is part of the ISE (i.e. the old tools)
20:46
Bertl
they are 'working' on a version for Vivado, but I'm not too optimistic they will finish soon
20:46
Bertl
and I'm pretty sure that tool will be 32bit as well, who has 64bit cpus anyway :)
20:47
skinkie
i am just waiting for the moment you will tell me how "Program FPGA works" ;)
20:47
skinkie
a BMM/MMI file
20:47
skinkie
that seems to be required as well?
20:48
Bertl
for what?
20:48
skinkie
I have a very nifty dialog
20:48
skinkie
which allows me to "program fpga"
20:48
Bertl
ah, no the promgen tool is actually a 64bit binary
20:49
Bertl
never used it ...
20:49
Bertl
no idea where you got it from :)
20:49
skinkie
the tool is called Xilinx SDK its very bloated ;)
20:49
Bertl
can it make omlette?
20:50
Bertl
*omelette even
20:50
skinkie
i guess you have to blink at a resonant frequency
20:50
skinkie
so if i just have a micro-usb cable this probaly won't work
20:55
Bertl
hmm, no, you need a jtag cable (like the one you asked me if it would work)
20:56
skinkie
mmm... ok... i recall that
20:56
Bertl
the microzed has no jtag via usb by default
20:56
skinkie
did not order it yet
20:56
skinkie
so uboot
20:56
Bertl
or you can still use the .bit/.bin for testing
20:57
Bertl
I'm pretty sure it worked last time I tested it
20:57
skinkie
if i put it on the microusb
20:58
Bertl
micro SD?
21:00
skinkie
yeah sorry
21:02
skinkie
I mean seriously... nothing works as promised here
21:02
skinkie
http://pastebin.com/rQ9ZtZcC
21:03
Bertl
yeah, it took me a week to get the first code working on the ZedBoard
21:03
skinkie
it took me a youtube movie to figure out that i was looking at the wrong tool...
21:03
Bertl
granted, I wanted to use the commandline which is not tested at all :)
21:05
Bertl
btw, I dropped the xilinx uboot version in favor of the digilent one
21:05
skinkie
thats very convient if it does not compile
21:06
Bertl
mostly because the xilinx uboot has a network stack which doesn't really work well and I was using tftp to upload stuff, so I ditched the xilinx version
21:06
skinkie
https://dev.openwrt.org/ticket/11876
21:07
Bertl
'git clone https://github.com/Digilent/u-boot-digilent.git
21:07
Bertl
I can upload the config I created for the zedboard, might save you a few days :)
21:08
skinkie
would be appreciated
21:11
Bertl
http://vserver.13thfloor.at/Stuff/AXIOM/ALPHA/u-boot-digilent.diff
21:11
skinkie
i just fixed the uboot code
21:12
skinkie
great so i have xilinx uboot as well now
21:13
Bertl
be careful not to overwrite the flash as long as you don't have a jtag cable
21:13
Bertl
(it might make u-boot unuseable)
21:14
skinkie
i will attempt just to use the microsd
21:15
Bertl
okay, have to get some stuff done before EHSM, if you have further questions, just post them here or via email, I'll read up and answer periodically
21:16
skinkie
i will need to go to bed early tomorrow a 24h marathon at Intelligent Transport Systems The Netherlands
21:17
skinkie
so i'll probe how far i can push this in the next 30min :)
21:17
Bertl
good drop me a success note then :)
21:25
danieel
left the channel
21:25
danieel
joined the channel
21:29
skinkie
FATAL: Exception: Multiple executable program sections in fsbl.elf
21:29
skinkie
fsbl was our 'properly' compiled bertl.elf...
21:30
skinkie
i give up for today more luck in the weekend i hope
21:30
Bertl
okay, fair enough! have fun!
21:30
skinkie
thanks
23:39
Bertl
off to bed now ... have a good one everyone!
00:15
FergusL
left the channel