Current Server Time: 01:48 (Central Europe)

#apertus IRC Channel Logs

2014/06/25

Timezone: UTC


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