~/src/osmocom-bb/src/host/osmocon$ ./osmocon -p /dev/ttyUSB0 -m c123
../../target/firmware/board/compal_e88/layer1.compalram.bin
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 2f /
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 1b .
got 2 bytes from modem, data looks like: f6 02 ..
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 41 A
got 1 bytes from modem, data looks like: 01 .
got 1 bytes from modem, data looks like: 40 @
Received PROMPT1 from phone, responding with CMD
read_file(../../target/firmware/board/compal_e88/layer1.compalram.bin):
file_size=50932, hdr_len=4, dnload_len=50939
got 1 bytes from modem, data looks like: 1b .
got 1 bytes from modem, data looks like: f6 .
got 1 bytes from modem, data looks like: 02 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 41 A
got 1 bytes from modem, data looks like: 02 .
got 1 bytes from modem, data looks like: 43 C
Received PROMPT2 from phone, starting download
handle_write(): 4096 bytes (4096/50939)
handle_write(): 4096 bytes (8192/50939)
handle_write(): 4096 bytes (12288/50939)
handle_write(): 4096 bytes (16384/50939)
handle_write(): 4096 bytes (20480/50939)
handle_write(): 4096 bytes (24576/50939)
handle_write(): 4096 bytes (28672/50939)
handle_write(): 4096 bytes (32768/50939)
handle_write(): 4096 bytes (36864/50939)
handle_write(): 4096 bytes (40960/50939)
handle_write(): 4096 bytes (45056/50939)
handle_write(): 4096 bytes (49152/50939)
handle_write(): 1787 bytes (50939/50939)
handle_write(): finished
It stopped here for very long time, I have tried with XOR and without XOR
for many times! Please help me to verify this issue! thanks very much!
--
View this message in context: http://baseband-devel.722152.n3.nabble.com/Why-my-C118-can-t-send-DOWNLOAD-…
Sent from the baseband-devel mailing list archive at Nabble.com.
Hi,
at 27c3, I tested some toolchains with osmocom-bb and found a few
build-problems, even with the recommended gnuarm-3.4.3. I want to
document them here, so other people can find hints about it.
*** GNUARM 3.4.3 TOOLCHAIN
master branch
=============
../../src/rate_ctr.c:24:22: inttypes.h: No such file or directory
Holger suggested to manually remove this line. It is fixed upstream
in libosmocore and osmocom-bb needs to be synced to it. Please do :)
remotes/origin/steve-m/loader_sciphone
======================================
1) First problem is:
In file included from ../../include/osmocore/msgb.h:23,
from ../../src/msgb.c:27:
/home/wsa/Dev/osmocom-bb/src/target/firmware/include/stdint.h:13:25: stdint.h: No such file or directory
Cherry-picking e0a605819c39187a494e43cf591f2e79a9d9903f (stdint.h: Next attempt at making this work with various compilers) helps.
2) It then runs into the problem of the master branch.
3) After this is fixed, I get
../../../src/codec/gsm610.c:24:20: stdint.h: No such file or directory
../../../src/codec/gsm610.c:33: error: parse error before "gsm610_bitorder"
which needs 733c894c18c127ce5c023e39609b7d2b9e748e7e (build: Use absolute path in the CFLAGS for libosmocore target build) as a fix.
4) This then, leads to:
arm-elf-ld: address 0x400054d4 of board/mt62xx/loader.mtkram.elf section .text is not within region LRAM
which is sadly also present when you just cherry-pick the main patch
d04761d19c432201f7c0f10c72f788fb695d466a ([WIP] Modify loader for use as first stage bootloader on MT62xx devices)
on top of current master + its build fix. So, does it seem sensible to simply
rebase this branch to master which would eliminate the first three problems?
Or at least cherry-pick the above fixes?
Also, the workarounds for gcc3 do not look very sustainable (see custom stdint.h).
Is it a mid-term option to remove that stuff if a reliable pre-built gcc4 is
available? (I am working on that, see below).
BTW the linker error was not further worked on yet. I got a prebuilt binary now.
It is possibly helpful to put it on the G2-wikipage, so people wanting to
work on the Linux-support only are spared from the above hassle.
*** CUSTOM 4.3.2 TOOLCHAIN
every branch
============
The configure-stage of libosmocom already fails for the target with error
77. The config.log says in detail:
configure:3231: checking whether the C compiler works
configure:3253: arm-elf-gcc -Os -ffunction-sections -I/home/wsa/Dev/osmocom-bb/src/target/firmware/include conftest.c >&5
/home/opt/OSELAS.Toolchain-1.99.3/arm-elf/gcc-4.3.2-newlib-1.16.0-binutils-2.18/bin/../lib/gcc/arm-elf/4.3.2/../../../../arm-elf/lib/libc.a(lib_a-exit.o): In function `exit':
/home/mkl/himalia-pengutronix/toolchain/releases/OSELAS.Toolchain-1.99.3.6/platform-arm-elf-gcc-4.3.2-newlib-1.16.0-binutils-2.18/build-target/newlib-1.16.0/newlib/libc/stdlib/exit.c:65: undefined reference to `_exit'
/home/opt/OSELAS.Toolchain-1.99.3/arm-elf/gcc-4.3.2-newlib-1.16.0-binutils-2.18/bin/../lib/gcc/arm-elf/4.3.2/../../../../arm-elf/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
/home/mkl/himalia-pengutronix/toolchain/releases/OSELAS.Toolchain-1.99.3.6/platform-arm-elf-gcc-4.3.2-newlib-1.16.0-binutils-2.18/build-target/newlib-1.16.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
27c3 was too interesting ;) so I haven't fixed this yet. The Mac-toolchains
also throw this and I also have seen it on the list before, so I hope I
can work on it the next days.
So much for now. It would be nice if someone with write-access to the repo
could comment on my questions and/or fix the low-hanging fruits. I will
hopefully be able to send some updates soon, too (famous last words).
It was great to meet you all in person!
All the best,
Wolfram
Hi Lia,
I have tested another cable (USB <-> 2,5 jack, speacial for Compal
phones) - it is the same chip (Prolific) and I am able to load firmware
too. Although it is the same chip, there is a difference that this one
makes the osmocon printing those messages instantly when phone is not
connected:
got 1 bytes from modem, data looks like: f5 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: f5 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: f5 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: fd .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: f5 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: fd .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: ea .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: ea .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: ea .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: ea .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: fd .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: ea
If I connect phone, printing stops. Here is what happened when I tried
to load firmware without xor (-m c123) and pressed the button:
(This happened every attempt without xor flag)
Received PROMPT2 from phone, starting download
handle_write(): 1087 bytes (1087/50947)
got 1 bytes from modem, data looks like: 1b .
got 1 bytes from modem, data looks like: f6 .
got 1 bytes from modem, data looks like: 02 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 45 E
got 1 bytes from modem, data looks like: 53 S
got 1 bytes from modem, data looks like: 16 .
Received DOWNLOAD NACK from phone, something went wrong :(
got 1 bytes from modem, data looks like: 66 f
got 1 bytes from modem, data looks like: 74 t
got 1 bytes from modem, data looks like: 6d m
got 1 bytes from modem, data looks like: 74 t
got 1 bytes from modem, data looks like: 6f o
got 1 bytes from modem, data looks like: 6f o
got 1 bytes from modem, data looks like: 6c l
Received FTMTOOL from phone, ramloader has aborted
got 1 bytes from modem, data looks like: 65 e
got 1 bytes from modem, data looks like: 72 r
got 1 bytes from modem, data looks like: 72 r
got 1 bytes from modem, data looks like: 6f o
got 1 bytes from modem, data looks like: 72 r
got 1 bytes from modem, data looks like: 00 .
If you have USB adapter (I guess you have), you dont need to check
model, check 'lsusb'
[root@amilo osmocon]# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
*Bus 002 Device 017: ID 067b:2303 Prolific Technology, Inc. PL2303
Serial Port*
If you have Prolific, which is very common, I encourage you to use xor
flag. You can also try to switch on your phone to check if original
firmware boots. I experienced during my early tests, that phone crashed
(probably SRAM) and it was unable to boot even original fw. In case
phone is crashed, reconnect battery and it will fix itself.
Here is the ACK after hello world load:
handle_write(): 768 bytes (17919/19787)
handle_write(): 768 bytes (18687/19787)
handle_write(): 768 bytes (19455/19787)
handle_write(): 332 bytes (19787/19787)
handle_write(): finished
got 1 bytes from modem, data looks like: 1b .
got 1 bytes from modem, data looks like: f6 .
got 1 bytes from modem, data looks like: 02 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 41 A
got 1 bytes from modem, data looks like: 03 .
got 1 bytes from modem, data looks like: 42 B
Received DOWNLOAD ACK from phone, your code is running now!
OSMOCOM Hello World (revision osmocon_v0.0.0-754-gb5abcb6-modified)
======================================================================
Device ID code: 0xb4fb
Device Version code: 0x0000
ARM ID code: 0xfff3
cDSP ID code: 0x0128
Die ID code: efce3b1ce1001255
======================================================================
REG_DPLL=0x2413
CNTL_ARM_CLK=0xf0a1
CNTL_CLK=0xff91
CNTL_RST=0xfff3
CNTL_ARM_DIV=0xfff9
==============================================
Looking forward your response,
Tomas
> Hi Tomas,
>
> thanks for your feedback.
>
> Actually, I've tried both flags (woth/without xor extension), but hte
> result is the same.
>
> So, in your opinioni, the problem could depend on the cable?
>
> I don't have the cable model now, but I can send you this information
> Tuesday.
>
> Thanks again.
>
> cheers.
>
> lia
>
> ----Messaggio originale----
> Da: deacon(a)volny.cz
> Data: 16-gen-2011 4.26
> A: <list_mailing(a)libero.it>
> ubut Ogg: Re: C115 loader.compalram.bin
>
> Hello,
> I have C115 too and I use '-m c123xor' switch, the phone mostly
> boots on 1st button push (I never reacher full load with '-m c123').
>
> ./osmocon -p /dev/ttyUSB0 -m c123xor
> ../../target/firmware/board/compal_e88/hello_world.compalram.bin
> ./osmocon -p /dev/ttyUSB0 -m c123xor
> ../../target/firmware/board/compal_e88/loader.compalram.bin
> ./osmocon -p /dev/ttyUSB0 -m c123xor
> ../../target/firmware/board/compal_e88/layer1.compalram.bin
>
> I have FTDI USB<->RS232 + Calypso serial. When load fails (with
> xor), I have a feeling that it helps reconnection cable to the phone.
> (I have also Calypso USB cable which I haven't tested yet, will
> report later.)
>
> - Tomas
>
>
>>> Hello.
>>> I'm trying to load the loader.compalram.bin.
>>> The behaviour is very strange because sometimes the download is complete and
>>> successfull, sometimes; in particular, in this case, the download is complete,
>>> but any ACK is sent back from the mobile phone (see below).
>>> ./osmocon -p /dev/ttyUSB0 -m c123 ../..
>>> /target/firmware/board/compal_e99/loader.compalram.bin
>>> got 2 bytes from modem, data looks like: 2e c8 ..
>>> got 5 bytes from modem, data looks like: 1b f6 02 00 41 ....A
>>> got 1 bytes from modem, data looks like: 01 .
>>> got 1 bytes from modem, data looks like: 40 @
>>> Received PROMPT1 from phone, responding with CMD
>>> read_file(../../target/firmware/board/compal_e99/loader.compalram.bin):
>>> file_size=21752, hdr_len=4, dnload_len=21759
>>> got 1 bytes from modem, data looks like: 1b .
>>> got 1 bytes from modem, data looks like: f6 .
>>> got 1 bytes from modem, data looks like: 02 .
>>> got 1 bytes from modem, data looks like: 00 .
>>> got 1 bytes from modem, data looks like: 41 A
>>> got 1 bytes from modem, data looks like: 02 .
>>> got 1 bytes from modem, data looks like: 43 C
>>> Received PROMPT2 from phone, starting download
>>> handle_write(): 4096 bytes (4096/21759)
>>> handle_write(): 4096 bytes (8192/21759)
>>> handle_write(): 4096 bytes (12288/21759)
>>> handle_write(): 4096 bytes (16384/21759)
>>> handle_write(): 4096 bytes (20480/21759)
>>> handle_write(): 1279 bytes (21759/21759)
>>> handle_write(): finished
>>>
>>>
>>> The target phone is C115. I tried compal_exx and the result is the same :-(
>>>
>>> Please, can someone help me to understand the reasons?
>>> Thanks in advance.
>>>
>>>
>>>
>>>
>>
>
>
>
Several toolchains are missing syscalls provided by the libc used. For example,
if the newlib was build with the configure flag "--disable-newlib-supplied-syscalls".
To prevent the configure check for things like "_exit" in osmocom
the CFLAGS+="-nostartfiles -nodefaultlibs" helps a lot.
Signed-off-by: Michael Grzeschik <mgr(a)xviews.de>
Acked-by: Wolfram Sang <wolfram(a)the-dreams.de>
---
src/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index a0dea5d..b3594c1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -39,7 +39,7 @@ shared/libosmocore/build-target/Makefile: shared/libosmocore/configure shared/li
cd shared/libosmocore/build-target && ../configure \
--host=arm-elf-linux --disable-vty --enable-panic-infloop \
--disable-shared --disable-talloc --disable-tests \
- CC="$(CROSS_TOOL_PREFIX)gcc" CFLAGS="-Os -ffunction-sections -I$(TOPDIR)/target/firmware/include"
+ CC="$(CROSS_TOOL_PREFIX)gcc" CFLAGS="-Os -ffunction-sections -I$(TOPDIR)/target/firmware/include -nostartfiles -nodefaultlibs"
shared/libosmocore/build-target/src/.libs/libosmocore.a: shared/libosmocore/build-target/Makefile
cd shared/libosmocore/build-target && make
--
1.7.2.3
I was going to ask the same question because I have same problem with sim reader mode. However I haven't used Sylvain test. I will and come back with an update.
Hi,
I just started playing around with this great project and am ashamed to say I'm
stumped with an annoying error when compiling.
I'm compiling on a Backtrack 4 RC2 (*buntu based distro) and that may be why I'm
having problems.
Basically I downloaded the proper packages as per the instructions on the wiki,
exported the PATH and all that, but when I run make I get this error:
cd shared/libosmocore/build-target && ../configure \
--host=arm-elf-linux --disable-vty
--enable-panic-infloop \
--disable-shared --disable-talloc --disable-tests \
CC="arm-elf-gcc" CFLAGS="-Os -ffunction-sections
-I/root/GSM/osmocom-bb/src/target/firmware/include"
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
configure: error: cannot find install-sh or install.sh in ".." "../.."
"../../.."
make: *** [shared/libosmocore/build-target/Makefile] Error 1
Attached is my config.log and you can see the PATH are there.
The error can be seen on this line in the log "configure:1766: error: cannot
find install-sh or install.sh in ".." "../.." "../../.."
Now i've checked to see if I have autoconf and automake installed (I do, I have
autoconf 2.61 and automake 1.10) since my searches on the internet seem to
indicate that maybe the problem.
Now I usually do all my own leg work and I read and read before asking
questions, but I'm afraid I can't resolve this on my own. Before I spend another
afternoon searching for the solution, I remembered to ask here.
Anyone have any hints on what I'm doing wrong? Do I need different automake or
autoconf versions?
Thanks and keep up the great work. It's been fascinating to watch the evolution
of GSM hacking these last few years.
Hello everybody
I'm trying to run the "mobile" application on a C115 and a C118 phone. I
want to use the real sim, so I used "sim reader" in the config. Both
phones have the same behaviour:
<000e> sim.c:1206 init SIM client
<0005> gsm48_cc.c:61 init Call Control
<0001> gsm48_rr.c:4944 init Radio Ressource process
<0004> gsm48_mm.c:1220 init Mobility Management process
<0004> gsm48_mm.c:971 Selecting PLMN SEARCH state, because no SIM.
<0002> gsm322.c:3471 init PLMN process
<0003> gsm322.c:3472 init Cell Selection process
Mobile '1' initialized, please start phone now!
VTY available on port 4247.
<0004> subscriber.c:556 Requesting SIM file 0x2fe2
<000e> sim.c:209 got new job: SIM_JOB_READ_BINARY (handle=00000004)
<000e> sim.c:697 go MF
<000e> sim.c:241 SELECT (file=0x3f00)
<000e> sim.c:187 sending APDU (class 0xa0, ins 0xa4)
no more output beyond this point.
Phones work correctly with other softwares, sim works correctly. I get
no response from the sim. Is the card reader working on these phones? If
yes, does anyone have suggestions to solve this issue?
Thanks a lot to everybody.
Dario.
Hello.
I'm trying to load the loader.compalram.bin.
The behaviour is very strange because sometimes the download is complete and
successfull, sometimes; in particular, in this case, the download is complete,
but any ACK is sent back from the mobile phone (see below).
./osmocon -p /dev/ttyUSB0 -m c123 ../..
/target/firmware/board/compal_e99/loader.compalram.bin
got 2 bytes from modem, data looks like: 2e c8 ..
got 5 bytes from modem, data looks like: 1b f6 02 00 41 ....A
got 1 bytes from modem, data looks like: 01 .
got 1 bytes from modem, data looks like: 40 @
Received PROMPT1 from phone, responding with CMD
read_file(../../target/firmware/board/compal_e99/loader.compalram.bin):
file_size=21752, hdr_len=4, dnload_len=21759
got 1 bytes from modem, data looks like: 1b .
got 1 bytes from modem, data looks like: f6 .
got 1 bytes from modem, data looks like: 02 .
got 1 bytes from modem, data looks like: 00 .
got 1 bytes from modem, data looks like: 41 A
got 1 bytes from modem, data looks like: 02 .
got 1 bytes from modem, data looks like: 43 C
Received PROMPT2 from phone, starting download
handle_write(): 4096 bytes (4096/21759)
handle_write(): 4096 bytes (8192/21759)
handle_write(): 4096 bytes (12288/21759)
handle_write(): 4096 bytes (16384/21759)
handle_write(): 4096 bytes (20480/21759)
handle_write(): 1279 bytes (21759/21759)
handle_write(): finished
The target phone is C115. I tried compal_exx and the result is the same :-(
Please, can someone help me to understand the reasons?
Thanks in advance.