RetroBSD

2.11BSD operating system for microcontrollers
It is currently Thu Dec 13, 2018 5:51 am

All times are UTC




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Porting to the MX470
PostPosted: Sun May 11, 2014 3:34 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
I am having a tinker with the '470 chips...

I have crafted myself a USB bootloader, and have the chip running at 96MHz, the most sensible speed I can come up with right now due to the limitations of the USB clock system (it requires 96Mhz after its PLL), so I'm using an 8MHz crystal.

Here's what I have so far:
Code:
2.11 BSD Unix for PIC32, revision G63 build 7:
     Compiled 2014-05-11 by matt@dell:
     /home/matt/git/retrobsd/sys/pic32/mx470
cpu: 470F512L 96 MHz, bus 96 MHz
oscillator: HS crystal, PLL div 1:2 mult x24
console: ttyUSB0 (5,0)
sd0: port SPI2, select pin D1
sd0: no SD/MMC card detected
sd0: no SD/MMC card detected
No root filesystem available!
Please enter device to boot from (press ? to list):

I don't have an SD card connected up to this breakout board yet; I'm just glad to get it to load ;)

_________________
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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 3:53 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
it requires 96Mhz after its PLL

48MHz I guess.. There is div2 after the 96MHz, 96MHz is not used for FCPU..
# Bootloader: for 160MHz clock:
option crystal=8
option pllidiv=1
option pllmul=20
option upllidiv=2

# Bootloader: for 192MHz clock:
option crystal=8
option pllidiv=1
option pllmul=24
option upllidiv=2

There is FPLLODIV - hopefully set to 0b000.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 4:13 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
Yeah, I didn't want to try overclocking so soon - just trying to get it to run was enough. Yes, there's a /2 after the USB PLL, but I count that as part of the USB module, not the PLL module, since the 96MHz from the USB PLL can be used for other things (like the REFCLK).

I'll see about tweaking my bootloader (it's not the retrobsd one, but one I derived from it for my own products) and try some other frequencies. Should be interesting...

_________________
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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 4:16 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
It will run 160, maybe 192 too (provided the same fab process as the MZ one)..
When not, then you need to add flash waitstates, and it will :)

CHECON: PFMWS<2:0>: PFM Access Time Defined in Terms of SYSLK Wait States bits

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 4:22 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
It really doesn't like the 8MHz input. Even trying /1 x15 /1 for 112MHz it fails.

It looks like 96MHz is your lot if you want USB. You could get the full 100MHz without USB I guess.

_________________
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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 4:31 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
Even trying /1 x15 /1 for 112MHz it fails.

That is 120MHz.. Just the lower end :)
The F_USB=48MHz is independent of the F_CPU.

Code:
# Bootloader: for 120MHz clock:
option crystal=8  <<< this is related to USB
option pllidiv=1
option pllmul=15
option upllidiv=2  <<< this is related to USB

F_USB [MHz] = crystal / upllidiv * 12 = 8 / 2 * 12 = 48
F_CPU [MHz] = crystal / pllidiv * pllmul = 8 / 1 * 15 = 120


PS: maybe you need to apply the clock stabilization patch at the very beginning..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:07 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
I can get blinking happening at 144MHz. Now to try and get USB working with 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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:10 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
It will run 160-192..
You may try to use the retrobsd master fubarinobig bootloader straight.. Just set up the dividers in the bootloader section as depicted above.. There is the clock patch applied already..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:23 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
Even with the clock start-up patch (which is already in my bootloader :P ) it's failing.

It doesn't run reliably at higher speeds. I get USB registering, then it drops off immediately as it crashes.

At 144MHz:
Code:
[28550.647918] hid-generic 0003:04D8:003C.001B: hiddev0,hidraw5: USB HID v1.11 Device [Majenko Technologies UniPIC-470] on usb-0000:00:1a.7-1.4.1/input0
[28579.268060] usb 1-1.4.1: USB disconnect, device number 68


At 120MHz:
Code:
[28751.681276] usb 1-1.4.1: new full-speed USB device number 69 using ehci-pci
[28756.751165] usb 1-1.4.1: device descriptor read/64, error -32


The register set is so different between the MX795 and the MX470 that there is no way in hell you can just drop in a bootloader compiled for an MX795. It's more akin to the MX250 chips than the MX795. Most of today was spent crafting a header file with all the registers in it at the right locations.

_________________
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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:26 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
..that is matter of the compiler, isn't it?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:30 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
Pito wrote:
..that is matter of the compiler, isn't it?

What is?

_________________
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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:31 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
Most of today was spent crafting a header file with all the registers in it at the right locations

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:37 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
And how is the compiler supposed to magically know what the registers are, and where they are...?

_________________
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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:43 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
from the header file for specific mcu..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Sun May 11, 2014 5:46 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
Exactly.

And with RetroBSD, what CPU header files are available, given that we use NO include files provided by the compiler - EVER? We don't even tell the compiler what the chip is, only that it's mips32r2.

The answer: only one - the pic32mx.h file, which is geared towards the 795.

I needed to create a 470 specific copy of that file to use. And that's only the beginning. Yes, it compiles, yes it loads the kernel, but it's going to take a few more weeks work to get it even ready to look for an SD card...

_________________
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  
 
 Post subject: Re: Porting to the MX470
PostPosted: Tue Oct 06, 2015 8:50 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
15 months after.. Any news in the 470 effort? Is that chip so different?
Would be great to refresh the retrobsd chipset options :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Tue Oct 06, 2015 9:16 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
The chip is quite different.
As all uart and spi pins are remappable, the drivers and kernel configs should be extended to handle it.
I still don't see much boards based on mx470 family.
Looks like it's not as popular as it might be.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Wed Oct 07, 2015 5:13 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Micromite folk likes it much..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Wed Oct 07, 2015 5:39 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
I would better focus on MZ EF.


Top
 Profile  
 
 Post subject: Re: Porting to the MX470
PostPosted: Wed Oct 07, 2015 6:22 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hard to get today, 16w delivery..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  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