RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sun Dec 08, 2019 1:01 am

All times are UTC




Post new topic Reply to topic  [ 205 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11  Next
Author Message
PostPosted: Mon Dec 24, 2012 9:26 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
I found out that RD12 is floating, despite its definition in config file. After manually keeping PMOS gate low, I got different error.
Code:
2.11 BSD Unix for PIC32, revision 859M build 9:
     Compiled 2012-12-24 by jarin@jarin:
     /home/jarin/retrobsd/sys/pic32/ubw32-uart-sdram
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: HS crystal, PLL div 1:3 mult x20
console: tty2 (5,2)
sd0: port SPI4, select pin F3
sdramp_preinit
PP Schema: (sdramp0:sa@2048,fs@14000)
Found partition on sdramp0 of type sa and size 2048
Found partition on sdramp0 of type fs and size 14000
No root filesystem available!
Please enter device to boot from (press ? to list): rd0

sd0: type I, size 124160 kbytes, speed 2 Mbit/sec
phys mem  = 128 kbytes
user mem  = 96 kbytes
root dev  = rd0 (0,0)
root size = 55555 kbytes
Please enter swap device (press ? to list):
rd0swap dev  = rd0 (0,0)
swap size = 124160 kbytes
panic: init died
syncing disks... done
halted

I'm asked to select boot and swap device with possibility of rd0 (SD card) and rd1 (still untested SDRAM). Is it OK to select the same device (rd0) for both?
Seems like a lot of changes were made since I build RetroBSD last time (revison ~ 450 or so).

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Mon Dec 24, 2012 11:34 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
If it is reading the SD card right (and you have written sdcard.rd to the disk, not filesys.img), then it should just boot, or at least offer you rd0a for the root, and rd0b for the swap.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Mon Dec 24, 2012 11:38 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
jaromir wrote:
This is my config file
Code:
#
# UBW32 board
# ===========
#
# Console on UART3

core pic32mx7
linker bootloader-sdram
mapping generic

device kernel led=A15
device console led=A14 device=tty2
device uart3
device rdisk led=C13 swap=C14
device sd0 port=4 cs=F3 power=D12
device sd1 port=4 cs=F8 power=D13
device sdramp

option PARTITION=sdramp0:sa@2048,fs@14000

device bootloader button=B1 user=0x1d005000 led=E3 led2=E2 set=E0 set2=E1

I'm using custom built bootlodader, derived from original UBW32 sources.

That config should build a working bootloader.hex file for you. The power system for the SD cards is untested - check in rd_sd.c for it.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Tue Dec 25, 2012 11:17 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Hallelujah :)
Code:
2.11 BSD Unix for PIC32, revision 859M build 12:
     Compiled 2012-12-24 by jarin@jarin:
     /home/jarin/retrobsd/sys/pic32/ubw32-uart-sdram
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: HS crystal, PLL div 1:3 mult x20
console: tty2 (5,2)
sd0: port SPI4, select pin F3
sdramp_preinit
PP Schema: (sdramp0:sa@2048,fs@14000)
Found partition on sdramp0 of type sa and size 2048
Found partition on sdramp0 of type fs and size 14000
sd0: type I, size 124160 kbytes, speed 2 Mbit/sec
phys mem  = 128 kbytes
user mem  = 96 kbytes
root dev  = rd0a (0,1)
root size = 32768 kbytes
swap dev  = rd0b (0,2)
swap size = 2048 kbytes
/dev/rd0a: 539 files, 8639 used, 24000 free
Starting daemons: update /var/cron: No such file or directory
/var/cron: created
tabs: No such file or directory
tabs: created
cron

2.11 BSD UNIX (pic32) (console)

login:


I needed to sleep a bit after 40hours up-time of my brain.
There were two problems:
1, I put filesys.img on SDcard, instead of sdcard.rd - that is my mistake, but documentation wiki/doku.php/doc/install should be corrected. When I played with retrobsd r450 or so, filesys.img was the correct file to dd on SD card.
2, RD12 is still floating. I grounded it temporarily as a workaround. I suspect a problem with SD power support.

Bootloader generated with build process has two flaws:
1, it expects 8MHz crystal and sets oscillator dividers (main and USB divider) to 2. How could I change it? I workarounded it with reading bootloader with ICD3 into MPLAB, manually changing config bits into correct values and writing back. Then it enumerated as HID bootloader. But,
2, sometimes (quite often) it locks up during update, in middle of process. It may be because my Linux is running in virtual machine, maybe - and USB operation in this is sometimes flaky in host-guest integration. My bootloader works better, though.

In fact, I don't like bootloaders at all. That's why I tried to build system to be loadable with PicKit or similar programmer.

Now, when it boots I need to examine SDRAM functionality and make familiar with system in general. It changed a lot in last few months.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Tue Dec 25, 2012 5:10 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
You can set all the crystal and divider settings as options in the configuration, I will post an example later.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Wed Dec 26, 2012 10:18 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
These are the settings I am using for my 4MHz crystal driven breakout board:
Code:
option crystal=4
option pllidiv=1
option pllmul=20
option upllidiv=1


I will look into the power issue.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Wed Dec 26, 2012 10:26 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
OK, I have committed a new rd_sd.c and associated bumph. It should fix the power control issue.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 1:02 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Seems like power issue is fixed, thanks.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 6:23 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
SDRAM disk is working now - at least first half of it works.
Code:
# disktool -b rd1 16384
Writing block 0 at address 000000.
Writing block 1 at address 000400.
Writing block 2 at address 000800.
Writing block 4 at address 001000.
Writing block 8 at address 002000.
Writing block 16 at address 004000.
Writing block 32 at address 008000.
Writing block 64 at address 010000.
Writing block 128 at address 020000.
Writing block 256 at address 040000.
Writing block 512 at address 080000.
Writing block 1024 at address 100000.
Writing block 2048 at address 200000.
Writing block 4096 at address 400000.
Writing block 8192 at address 800000.
Writing block 16384 at address 1000000.
Reading block 0 at address 000000.
Reading block 1 at address 000400.
Reading block 2 at address 000800.
Reading block 4 at address 001000.
Reading block 8 at address 002000.
Reading block 16 at address 004000.
Reading block 32 at address 008000.
Reading block 64 at address 010000.
Reading block 128 at address 020000.
Reading block 256 at address 040000.
Reading block 512 at address 080000.
Reading block 1024 at address 100000.
Reading block 2048 at address 200000.
Reading block 4096 at address 400000.
Reading block 8192 at address 800000.
Data error: offset 0 written 0E read 0F.
Data error: offset 1 written 0F read 10.
Data error: offset 2 written 10 read 11.
Data error: offset 3 written 11 read 12.
...
...
...
Data error: offset 1019 written 09 read 0A.
Data error: offset 1020 written 0A read 0B.
Data error: offset 1021 written 0B read 0C.
Data error: offset 1022 written 0C read 0D.
Data error: offset 1023 written 0D read 0E.
Reading block 16384 at address 1000000.
Done.
#

Seems like data read back are shifted by one.

Speed is quite OK, I think.
Code:
# rdprof -d rd1
RetroDisk Profiler
Testing read of rd1 from 0 to 16383 with 1024 byte blocks...
Time taken: 5.115000 seconds.  Speed: 3203.128174 KBytes/second
#



I found two mistakes on board.
1, SDRAM pads on board are small. Maybe OK for reflow soldering, but unsuitable for hand soldering. I had to write test program for PIC to exercise all data/address/control pins and probe pins, one by one, at SDRAM package to found bad solder joints. And then, rework it few times.
2, Terrible mistake around SD card buffer, preventing two card to operate on single retrobsd system. With single card everything is OK. I had to rethink it.
New revision of board is to come, I had to fix those two issues, as well as rethink bottom connector layout.

------------------------------------------------

If somebody is interested, I may send the board with few unusual components, like SDRAM, 12MHz crystal, resistor networks or whatever.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 8:37 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
2, Terrible mistake around SD card buffer

A bit more details, please?

Quote:
Seems like data read back are shifted by one.

Or, you are reading from the address+1 (or vice versa)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 9:26 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Pito wrote:
Quote:
Seems like data read back are shifted by one.
Or, you are reading from the address+1 (or vice versa)
Looks more like a timing mismatch with CLK or something.


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 9:34 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
Looks more like a timing mismatch with CLK or something.

an additional rd/wr edge somewhere.. thus the address+1..
or shorted A12 (highest) with an another address wire..

It uses a different counter pattern for each subsequent block, so maybe the 0E at offset 0 is ok (?).
Code:
Data error: offset 0 written 0E read 0F.
Data error: offset 1 written 0F read 10.


I would add a random data option to the disktool - set a seed, write the random data, set the same seed, read the data and compare with the same random sequence..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 11:33 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
That +1 reading is something that doesn't bother me that much...

I did more experiments around SDRAM driver and there is something wrong.
RetroBSD runs fine and stable if I leave SDRAM intact. I can play around with BASIC, adc demo or print calendars into files for hours. But if I touch SDRAM in some way - for example disktool on SDRAM device or mkfs, after a few minutes RetroBSD crashes in various ways. Like
Code:
# cd dev
# mkfs rd1a 2047
Size: 2047 kbytes
Inodes: 112
#
... leave system untouched for a few minutes here...
*** 0x00000000: bus error

or
Code:
# disktool -b rd1 16384
*** 0x7f00ae80: bad address 0xffff8a89
*** 0x7f00ae80: bad address 0xffff8a89
*** 0x7f00ae80: bad address 0xffff8a89
*** 0x7f00ae80: bad address 0xffff8a89
..
.. ...forever


Time between mkfs execution and bus error message is immediately to few minutes. Sometimes it doesn't happen. Sometimes it emits complete stack printout and crashes. Sometimes it emits bus error and then just echoes commands, but doesn't execute it... or prints bad address error in loop forever - until hard reset.
Swap is still on SD card, I just play around rd1 device.

I would be thankful for madscifi's input here, as he knows SDRAM driver very closely.

pito: the problem with SD card driver is connected output 1Y4 and 2Y4 at 74244. When both cards are powered, both drivers are selected, so both 1Y4 and 2Y4 OUTPUTS are active and fighting each other!
They should be active when not only power is on, but when power and CS is active. I think G inputs should be driven by respective CS signal OR-ed with power signal. Or just CS signal, with guarantee that CS signal is never brought low when power is off - easy to accomplish in software.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 12:16 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
This is a prototype run - my expectation would be the RetroBoard v1.0 (current) will prove rock stability with sdram and two sdcards (with power on/off)..

:)
I would definitely try to fix the sdcards issue on the existing board (ie cut the power on/off from /Gs and connect /Gs to some existing pins). Try to test a reliable operation of both sdcards.

SDram - you know my point, rock stable solution may require a lot of work..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 12:19 am 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
Could you check in your code? I'd like to look at some of the loader related values.

Also, which ram chip are you actually using?

What happens if you attempt to test with disktool using just the lower 1, 2 and/or 4M?

The other thing to try is to build a ram disk on just the lower 4M or so (don't partition, just build directly on rd1, just to simplify things a little).

The problem you are seeing with disktool does look like an addressing problem at the moment. I don't have any good ideas about the crashing problem.


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 12:32 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Alliance Memory AS4C8M16S-7TCN

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 12:42 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
pito: Cutting tracks under IC package (or bending pins and soldering thin wires to other pins in 0,6mm module) is not that trivial, but I can do it. If I'll deliver board for you, or other forum users, would they do that surgery too?
Honestly, two SD cards are secondary problem for me, unless we don't have proper device for swap.


madscifi:
If I use disktool at lower 8MB, there are no data verification problems. Running at 16MB, I get error you see. However, manually checking blocks one by one at upper half of memory (including that problematic one) brings positive results. I feel like I'll check the soldering again tomorrow, at proper daylight. What bugs me more are the crashes.
The exact chip name is AS4C8M16S-7TCN
I left your original code as is. I only changed configuration file to reflect SD card connection - it is different than on UBW board.
I think it would be best if you would receive another board and some components from me. I can populate it for you, if you want. You can contact me at jaromir(dot)sukuba(at)gmail(dot)com

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 12:48 am 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
That chip has 16 megs totol, so block number 16384 does not exist. The driver does not report an error and the driver would map it to block 8192, which matches what you are seeing.

Try running "disktool - b rd1 8192". That should stay within the bound so the device.


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 12:50 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
If I'll deliver board for you, or other forum users, would they do that surgery too?

I do not think this prototype board will be subject to an extreme demand from the community. It is a better breadboard for your experiments only. I would not start to draw a new board version unless this one will work reliably 24x7..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 1:00 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
madscifi:
Code:
# disktool -b rd1 8192
Writing block 0 at address 000000.
Writing block 1 at address 000400.
Writing block 2 at address 000800.
Writing block 4 at address 001000.
Writing block 8 at address 002000.
Writing block 16 at address 004000.
Writing block 32 at address 008000.
Writing block 64 at address 010000.
Writing block 128 at address 020000.
Writing block 256 at address 040000.
Writing block 512 at address 080000.
Writing block 1024 at address 100000.
Writing block 2048 at address 200000.
Writing block 4096 at address 400000.
Writing block 8192 at address 800000.
Reading block 0 at address 000000.
Reading block 1 at address 000400.
Reading block 2 at address 000800.
Reading block 4 at address 001000.
Reading block 8 at address 002000.
Reading block 16 at address 004000.
Reading block 32 at address 008000.
Reading block 64 at address 010000.
Reading block 128 at address 020000.
Reading block 256 at address 040000.
Reading block 512 at address 080000.
Reading block 1024 at address 100000.
Reading block 2048 at address 200000.
Reading block 4096 at address 400000.
Reading block 8192 at address 800000.
Done.
#

if we don't have block 16384, we should have 16383 and it seems we have it
Code:
# disktool -b rd1 16383
Writing block 0 at address 000000.
Writing block 1 at address 000400.
Writing block 2 at address 000800.
Writing block 4 at address 001000.
Writing block 8 at address 002000.
Writing block 16 at address 004000.
Writing block 32 at address 008000.
Writing block 64 at address 010000.
Writing block 128 at address 020000.
Writing block 256 at address 040000.
Writing block 512 at address 080000.
Writing block 1024 at address 100000.
Writing block 2048 at address 200000.
Writing block 4096 at address 400000.
Writing block 8192 at address 800000.
Writing block 16383 at address FFFC00.
Reading block 0 at address 000000.
Reading block 1 at address 000400.
Reading block 2 at address 000800.
Reading block 4 at address 001000.
Reading block 8 at address 002000.
Reading block 16 at address 004000.
Reading block 32 at address 008000.
Reading block 64 at address 010000.
Reading block 128 at address 020000.
Reading block 256 at address 040000.
Reading block 512 at address 080000.
Reading block 1024 at address 100000.
Reading block 2048 at address 200000.
Reading block 4096 at address 400000.
Reading block 8192 at address 800000.
Reading block 16383 at address FFFC00.
Done.
#

Anyway, using correct highest block number brings correct results. My fault - but overflowing address range should be indicated somehow.
That was easy. I hope bus crashes will be such as easy to solve :)

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 205 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission