Help with jtag + Flash bootloader

112 views
Skip to first unread message

Christian Faure

unread,
May 4, 2013, 11:02:56 PM5/4/13
to biffe...@googlegroups.com
Hi,

i'm new to Biffer board,
my board come from a little NAS server,
it show 
-==================================-
    Boot Loader [LOADER32 1.17]
    Press <ESC> to enter extra mode
-==================================-
on serial console at boot time, 
i think it is not the Biffboot bootloader.

i want to flash the Biffboot and load openwrt to this board,
i've build the jtag circuit, 
and found a jtag folder under tools at https://github.com/bifferos/bb
this is the correct software for flash bootloader?

When i try to run dump.py or reset.py, i get a segfault:

# ./dump.py 
Registering port 0x378
ioperm() == 0
Registering port 0x379
ioperm() == 0
Violación de segmento


Python: 2.7.3
Linux: OpenSuSe 12.2  x86_64 
kernel 3.4.11-2.16-desktop #1 SMP PREEMPT Wed Sep 26 17:05:00 UTC 2012 (259fc87) x86_64 x86_64 x86_64 GNU/Linux

Can someone help me to find what is wrong in my setup?
i've also tried to run python script step by step, but my eclipse setup seem wrong, it execute the script and ignore breakpoints...

Thanks

Christian Faure

unread,
May 5, 2013, 9:38:42 AM5/5/13
to biffe...@googlegroups.com
UPDATE:
i've enabled the debugger and see where it fail:
the first outb instruction.
ioperm seem return ok, program run as root...

Christian Faure

unread,
May 5, 2013, 1:24:04 PM5/5/13
to biffe...@googlegroups.com
UPDATE [SOLVED]:
i've replaced the custom asm instructions for inb and outb by calls to the C equivalents inb and outb (with a small shared library),
and have to change the Nasm function in RDC.py to 8 bytes instead of 4 (64bit OS vs 32bit OS)
 
Now, reset.py and dump.py seem working great on my machine.

i'will try to flash the Biffboot...

Christian Faure

unread,
May 5, 2013, 4:37:18 PM5/5/13
to biffe...@googlegroups.com
UPDATE [SOLVED]+[ERRATA]

Ok! now i've a biffboot on my board :-)
No Os yet...

But the correction about Nasm function in rdc.py is not changing size! this size is for Biffboard processor, it need to be 4!
But changing the format from "L" to "I" when using 64bit Os


Andrew Scheller

unread,
May 5, 2013, 7:38:56 PM5/5/13
to Bifferboard
> UPDATE [SOLVED]+[ERRATA]
> Ok! now i've a biffboot on my board :-)

Cool! Just out of interest, which was the "NAS board" you started with?

> i've replaced the custom asm instructions for inb and outb by calls to the C equivalents inb and outb (with a small shared library)

I guess there's also http://portio.inrim.it/ which I briefly looked at
when I was investigating this myself many moons ago, but never got
round to doing anything with ;-)

> But the correction about Nasm function in rdc.py is not changing size! this
> size is for Biffboard processor, it need to be 4!
> But changing the format from "L" to "I" when using 64bit Os

Checking the struct documentation
http://docs.python.org/2/library/struct.html#format-strings I guess
the correct fix would actually modify
https://github.com/bifferos/bb/blob/master/tools/jtag/rdc.py#L137
to replace the "L" (which uses native size and byte order) with "<L"
(force standard size and little-endian byte order). Biff tended to
write his code to only run on 32-bit x86 platforms (specifically
32-bit Slackware Linux IIRC) so you may find similar portability
issues with other scripts / utils in the repository.

Lurch

biff...@yahoo.co.uk

unread,
May 7, 2013, 5:55:40 AM5/7/13
to Bifferboard

On May 6, 12:38 am, Andrew Scheller <ya...@loowis.durge.org> wrote:
> (force standard size and little-endian byte order). Biff tended to
> write his code to only run on 32-bit x86 platforms (specifically
> 32-bit Slackware Linux IIRC) so you may find similar portability
> issues with other scripts / utils in the repository.

The only machine I have with a parallel port is 32-bit (a 586 machine)
who's only purpose in life is to test releases of that code :-). I
switched to 64-bit slackware for pretty much everything else so
hopefully that won't happen too often!

Christian: Don't forget when booting a Linux kernel if you have 16MB
ram on your NAS board, you must explicitly tell the kernel to only use
the bottom 16M with a kernel option. Biffboot tries to keep itself in
the lowest 16MB of DRAM in order to run on NAS dongles, but it doesn't
try to 'auto-detect' available ram, and always passes '32MB' to in the
Linux kernel parameter block, so this has to be overridden.

best regards,
Biff.

Christian Faure

unread,
May 7, 2013, 11:24:26 AM5/7/13
to biffe...@googlegroups.com, ya...@loowis.durge.org
Hi Andrew, Biff 
Thanks for your replies and helps,

The few problems i've found are due to my os at 64bits vs 32.

The  "NAS board" is labeled as: "WANSER-E" brand: "7-links", it seem to have only 1MB flash :-( 
Yes, it seem the portio.inrim.it is the simplest solution to replace the ASM code running on programmer machine. 
For format in Nasm function "<L" seem right, i've not tested "<L" only "=L" but my python refused it! so, i've changed to "I"
i've booted a linux, at uname it say:
Linux bifferboard 2.6.37.6-biff #6 Sun Jan 27 21:56:08 GMT 2013 i486 GNU/Linux
cat /proc/meminfo say 32M of RAM but but i do not know how to see the REAL RAM size?
Loading +Memtest86?

Best regards
Christian


biff...@yahoo.co.uk

unread,
May 7, 2013, 3:48:12 PM5/7/13
to Bifferboard
On May 7, 4:24 pm, Christian Faure <christian.faurebouv...@gmail.com>
wrote:
> Hi Andrew, Biff
> Thanks for your replies and helps,
>
> The few problems i've found are due to my os at 64bits vs 32.
>
> The  "NAS board" is labeled as: "WANSER-E" brand: "7-links", it seem to
> have only 1MB flash :-(

Here's where you're in luck, as I've done a *lot* of work to make
Linux fit in 1MB and still do something useful. See here:
https://github.com/bifferos/bb/tree/master/buildroot

> Yes, it seem the portio.inrim.it is the simplest solution to replace the
> ASM code running on programmer machine.
> For format in Nasm function "<L" seem right, i've not tested "<L" only "=L"
> but my python refused it! so, i've changed to "I"
> i've booted a linux, at uname it say:
> Linux bifferboard 2.6.37.6-biff #6 Sun Jan 27 21:56:08 GMT 2013 i486
> GNU/Linux
> cat /proc/meminfo say 32M of RAM but but i do not know how to see the REAL
> RAM size?

Look at the DRAM chip :-).

regards,
Biff.

Christian Faure

unread,
May 7, 2013, 6:48:56 PM5/7/13
to biffe...@googlegroups.com

Here's where you're in luck, as I've done a *lot* of work to make
Linux fit in 1MB and still do something useful.  See here:
https://github.com/bifferos/bb/tree/master/buildroot

Thanks for your great work! i will try it!
 

Look at the DRAM chip :-).

ofcourse! stupid question... 
Datasheets say:

Flash: 1MB
EN29LV800BB-70TCP - 8 Megabit (1024K x 8-bit / 512K x 16-bit) Flash Memory

Ram: 32MB
NT5SV16M16BS-75B
256Mb Synchronous DRAM

Best regards
Christian
Reply all
Reply to author
Forward
0 new messages