RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sat Aug 08, 2020 2:24 pm

All times are UTC




Post new topic Reply to topic  [ 192 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  Next
Author Message
PostPosted: Sun Dec 28, 2014 1:11 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Very good. I hope, this board will be eventually available at your Ebay store.

USB bootloader for MZ is a critical point for now. It would be great to have Microchip USB stack available under BSD (or Apache) license - we could reuse it for RetroBSD as well.

External FT232 adapter is OK for me. Another useful peripheral would be an RTC clock (like PCF8563).

I've contacted Microchip, and they kindly donated an elaborated board (https://github.com/sergev/LiteBSD/wiki/ ... B-II-board) for a support of 4.4bsd project. It has Ethernet port and Wi-Fi module, and a lot of other interesting peripherals. I doubt we can utilize LCD display, as it would require too much dedicated RAM, but other functions seem quite usable (audio, camera, accelerometer, temperature sensor, external SRAM and serial Flash memory).

I'm now working on Ethernet driver.


Top
 Profile  
 
PostPosted: Sun Dec 28, 2014 5:21 am 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
I gotta get an Ethernet one...Love the Wi-Fire I have...but Ethernet will likely come sooner. ;)

EDIT: If http://www.microchip.com/DevelopmentToo ... AC320004-3 is compatible I'll just buy one of these (LAN7820A)


Top
 Profile  
 
PostPosted: Sun Dec 28, 2014 5:57 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Yes, the driver will assume LAN7820A as a PHY. Probably other generic PHYs should work as well, like RTL8201, as all the driver is pretty generic.

I started with Ethernet driver, as it seems much simpler. All the Wi-Fi layer looks quite complicated. I expect to have Ethernet working somewhere in a month.


Top
 Profile  
 
PostPosted: Sun Dec 28, 2014 3:02 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Serge and all,

Most impressive :) !!!

Wiz


Top
 Profile  
 
PostPosted: Sat Jan 03, 2015 8:30 pm 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
vak wrote:
Yes, the driver will assume LAN7820A as a PHY. Probably other generic PHYs should work as well, like RTL8201, as all the driver is pretty generic.


Just ordered one of those, eagerly await the ability to test.

Quote:
I started with Ethernet driver, as it seems much simpler. All the Wi-Fi layer looks quite complicated. I expect to have Ethernet working somewhere in a month.


Yeah...a wireless stack is NOT exactly trivial! Might point a friend towards this...he does embedded for a living and has RF skills.


Top
 Profile  
 
PostPosted: Tue Jan 06, 2015 10:04 pm 

Joined: Sun Dec 07, 2014 1:47 am
Posts: 22
Okay...seems I ordered the wrong module.

This one...is smaller than I realised...the entire module is about the size of the wifi shield on the Wi-Fire.


Top
 Profile  
 
PostPosted: Fri Jan 09, 2015 4:14 am 

Joined: Mon Nov 24, 2014 6:12 am
Posts: 13
Location: Australia
vak wrote:
Yes, the driver will assume LAN7820A as a PHY. Probably other generic PHYs should work as well, like RTL8201, as all the driver is pretty generic.

I started with Ethernet driver, as it seems much simpler. All the Wi-Fi layer looks quite complicated. I expect to have Ethernet working somewhere in a month.


That's the dyslexic version of the LAN8720A ? :) My other question that you have already answered ( I think ) is what RTC would be preferred. PCF8563?

Still thinking about what features are essential on a MZ board.

Ray


Top
 Profile  
 
PostPosted: Sat Jan 10, 2015 8:57 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The PCF8563 has the lowest backup current consumption - 200nA, but requires 2 diodes for the backup and an external resonator with tuning cap. You do tune it with the cap or cap trimmer.
The DS3231 and friends need much more backup current (800-1500nA), but include resonator and backup switching, so you do not need any external stuff. They are quite precise and with more features.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Jan 10, 2015 4:35 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
OK... so I have my prototype boards for my SDZL now. I have just built one up, but I am failing completely to boot.

It took me some time to try and even get a bootloader on there - there seems to be a problem using pic32prog with a pickit2 on a PIC32MZ2048ECG064. Once I switched to my PK3 the bootloader installed and worked perfectly.

So I made a config for it, and after a few corrections got it to give me the console. But it can't find the SD card, and I can't work out why.
Code:
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.

4.4BSD-Lite build 5 compiled 2015-01-10
    matt@dell:LiteBSD/sys/compile/SDZL.pic32
cpu: PIC32MZ2048ECG064 rev A5, 200 MHz
oscillator: system PLL div 1:6 mult x50
cache: 16/4 kbytes
real mem = 512 kbytes
avail mem = 348 kbytes
using 18 buffers containing 73728 bytes of memory
spi1 at pins sdi=D14/sdo=C1/sck=D1
spi2 at pins sdi=G7/sdo=G8/sck=G6
spi3 at pins sdi=B10/sdo=C4/sck=B14
spi4 at pins sdi=F5/sdo=G0/sck=D10
uart1 at pins rx=D2/tx=D3, interrupts 112/113/114
uart2 at pins rx=B7/tx=B6, interrupts 145/146/147, console
sd0 at port spi2, pin cs=G9
sd0: no SD card detected
sd0: no SD card detected
bpf: lo0 attached
sd0: no SD card detected
ufs_mountroot failed: 19
panic: cannot mount root
syncing disks... done
sd0: no SD card detected

dumping to dev 2, offset 8
dump device bad

The config for the SD is:
Code:
controller      spi2    flags 0x7778    # pins sdi=RG7,  sdo=RG8  - SD card
disk            sd0     at spi2 drive 0 flags 0x79      # select pin RG9  - logical 27
options         "SD_LED=0x57"                           # LED4 is RE7
options         "SD_KHZ=10000"                          # 10MHz clock

As you can see I have tried slowing it down to 10MHz to try and get it to work. I just don't get it.

I'm seeing the SCK, SDO and SS coming out of the chip fine. I'm even seeing the SDI coming back from the SD card. But it's just not detecting the card at all. The whole layout of that portion of the board hasn't changed since the SDXL board it's based on. The same RG6/7/8/9 pins going to the same places in the same way.

Any clues...?

I guess my next step will be to shove loads of debugging into the SPI comms to see what's going on...

_________________
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: Sat Jan 10, 2015 6:00 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
Ok, problem solved.

We need to clear ANSELx.y for the SDI pin or it doesn't work. It seems ANSEL overrides everything, not just GPIO.

I have added that functionality to the SPI device and the SD works better, but I'm still not booting:

Code:
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.

4.4BSD-Lite build 8 compiled 2015-01-10
    matt@dell:LiteBSD/sys/compile/SDZL.pic32
cpu: PIC32MZ2048ECG064 rev A5, 200 MHz
oscillator: system PLL div 1:6 mult x50
cache: 16/4 kbytes
real mem = 512 kbytes
avail mem = 348 kbytes
using 18 buffers containing 73728 bytes of memory
spi1 at pins sdi=D14/sdo=C1/sck=D1
spi2 at pins sdi=G7/sdo=G8/sck=G6
spi3 at pins sdi=B10/sdo=C4/sck=B14
spi4 at pins sdi=F5/sdo=G0/sck=D10
uart1 at pins rx=D2/tx=D3, interrupts 112/113/114
uart2 at pins rx=B7/tx=B6, interrupts 145/146/147, console
sd0 at port spi2, pin cs=G9
sd0: type II, size 1934336 kbytes, speed 10 Mbit/sec
sd0a: partition type b7, sector 2, size 204800 kbytes
sd0b: partition type b8, sector 409602, size 32768 kbytes
sd0c: partition type b7, sector 475138, size 102400 kbytes
bpf: lo0 attached
WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!
panic: setrunqueue
syncing disks... done

dumping to dev 2, offset 64512
dump device bad


... investigations continue ...

Serge & Pito - send me your postal addresses and I'll send you one to play with (I have 2 spare MZ chips at the moment).

_________________
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: Sat Jan 10, 2015 6:46 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
@majenko - pm me your postal addr too, I'll send you the 8MB ramdisk module.. Hopefully your board supports PMP bus :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Jan 10, 2015 6:57 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
That'd be cool. The pinout is almost the same as the SDXL board (and nearly the same as the Fubarino SD), so the PMP should work well. Maybe even use the EIB in some way...?

_________________
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: Sat Jan 10, 2015 7:06 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The 8MB ramdisk driver for MX in retrobsd works fine, the only thing you have to do is to change a few PMP parameters there such it match 200MHz clock (provided MZ's PMP works in the same way..) .

Code:
https://github.com/RetroBSD/retrobsd/blob/master/sys/pic32/rd_sramc.c

// for 120MHz clock, 70ns PSRAM, Ramdisk v.1.1.
#define ADR_PULSE 1
#define WR_PULSE 5
#define RD_PULSE 11

So I would try

// for 200MHz clock, 70ns PSRAM, Ramdisk v.1.1.
#define ADR_PULSE 2
#define WR_PULSE 9
#define RD_PULSE 20

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Jan 10, 2015 9:30 pm 

Joined: Tue Aug 19, 2014 2:27 pm
Posts: 10
Just read through the entire thread, this is looking really cool!

Are there any plans to port 4.4 to a pic32mx? Or keep 2.11 for pic32mx and 4.4 for pic32mz?


Top
 Profile  
 
PostPosted: Sat Jan 10, 2015 9:38 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
There is absolutely zero chance of 4.4BSD ever working on an MX. Not only does it lack the memory, but it also lacks the MMU that 4.4BSD needs. We'll never be able to progress beyond 2.11BSD on the MX.

_________________
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: Sun Jan 11, 2015 10:46 am 
Contributor

Joined: Mon Apr 29, 2013 1:56 am
Posts: 196
majenko wrote:
There is absolutely zero chance of 4.4BSD ever working on an MX. Not only does it lack the memory, but it also lacks the MMU that 4.4BSD needs. We'll never be able to progress beyond 2.11BSD on the MX.


The MX is too good. You need the AVR:
https://www.youtube.com/watch?v=nm0POwEtiqE
:)


Top
 Profile  
 
PostPosted: Sun Jan 11, 2015 11:28 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
LOL!!!! That's hillarious!!!

A 1.7MB Linux kernel in an AVR chip... !!! :lol:

And I didn't know an AVR had 288 IRQs...!

Could that be a Raspberry Pi Compute Node in the board next to the AVR chip maybe...?

_________________
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: Sun Jan 11, 2015 3:10 pm 

Joined: Tue Aug 19, 2014 2:27 pm
Posts: 10
majenko wrote:
There is absolutely zero chance of 4.4BSD ever working on an MX. Not only does it lack the memory, but it also lacks the MMU that 4.4BSD needs. We'll never be able to progress beyond 2.11BSD on the MX.


What's different about the MMU on the MZ series vs the MX series? Also, what do you mean in terms of 'memory' - RAM or flash?


Top
 Profile  
 
PostPosted: Sun Jan 11, 2015 3:12 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
rmiddleton wrote:
majenko wrote:
There is absolutely zero chance of 4.4BSD ever working on an MX. Not only does it lack the memory, but it also lacks the MMU that 4.4BSD needs. We'll never be able to progress beyond 2.11BSD on the MX.


What's different about the MMU on the MZ series vs the MX series? Also, what do you mean in terms of 'memory' - RAM or flash?

The difference? The MZ has one, the MX doesn't. The MX has static memory maps, the MZ has a real MMU.

And both flash and RAM. I guess the kernel could be squashed a little, but as it stands it's about 512K in size, and that's the limit of the MX chips. RAM though is the critical one.

_________________
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: Sun Jan 11, 2015 6:38 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi RMiddleton,

The one real feature that makes life much easier is the MMU.

Translated to English is called in DECese VMS (Virtual Memory System).

Basically user code is compiled to run in a VERY large virtual memory and pieces of program and data are swapped in and out by the operating system as needed. The programmer just writes code :) !!

The user writes a program of "any" size and it "just runs". Once running it can be made to run much faster by careful optimization when such efforts make sense.

Hope that helps?

Hopefully the MZ can really do this? Seeing is believing. There are so many places that various bugs and missed features can kill the whole feature!

Consider that RetroBSD for the MX has yet to add even the kernel loadable module feature that at least in my humble opinion is required for real use.

Happy 2015 to all.

Wiz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 192 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  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