RetroBSD

2.11BSD operating system for microcontrollers
It is currently Fri Jul 19, 2019 9:23 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Sep 25, 2013 8:31 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
An year back I started a topic which has been finalized with a success - after a mutual effort of contributors Jaromir has produced a nice looking PCB with a PIC32MX and a 16MB SDRAM on it.

What needs to be done is to test the board in more detail, as we want to create a new board - PIC32MZ based one - most probably with a similar design - with an SDRAM.

As you maybe know the PIC32MZ does not support SDRAM (info based on the Chinese datasheet). The 100 and 124pin versions support 20addr bits (1MB), the 144pin version 24addr bits (16MB) of SRAM.

The idea I discussed with Jaromir during our recent short meeting in Las Vegas, is to follow the design we already have done - ie. 100pin PIC32MZ + SDRAM, or 144pin PIC32MZ + SDRAM , as that would be DIY feasible (the PSRAMs are all BGA).
PS: back in Monte Carlo - not sure the sdram is the best idea with MZ. Better to mess with BGA..

I would kindly ask our key contributors if I may - majenko, madscifi, Serge, etc. - to have a short look at this post from time to time, as we will need some advices with setting up a running system on the current PIC32MX + 16MB SDRAM version, most notably to get the swap and the filesystem working on the SDRAM.

The latest indication from Jaromir is the SDRAM driver works, a complete setup has not been provided yet, however..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Sep 26, 2013 8:08 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
So - can we confirm, the definitions for the "32MXSDRAM" board with UART console are correct, plz?

We want 2048kB swap on SDRAM ramdisk, 14000kB fs partition on SDRAM ramdisk, and 100MB OS system fs and 50MB user fs on the sdcard.

sys/pic32/32mxsdram-uart/32MXSDRAM-UART:

Code:
#
# 32MXSDRAM board PCB v1.0 with UART console
# ===========================================
#
# Console on UART3

core pic32mx7
linker bootloader-sdram
mapping generic

device kernel cpu_khz=80000 bus_khz=80000 led=A15
device console led=A14 device=tty2
device uart3 baud=115200
device rdisk led=C13 swap=C14

# sdcard's definition for the SPI port, sdcard's chipselect and high-side power switch
# because of a mod on the board we use power=B13, otherwise it shall be D12
device sd0 port=4 cs=F3 power=B13 mhz=20
# device sd1 port=4 cs=F8 power=D13

device adc
device oc
device gpio

# use SDRAM driver for the external ramdisk
device sdramp

# This defines the swap size and a fs partition size on the external ramdisk.
# When the sa@XXXX is larger than the SWAP_KBYTES, the system will use
# the swap located on the external ramdisk automatically.
# (sd@xxxx + fs@xxxx) <= ramdisk_size
option PARTITION=sdramp0:sa@2048,fs@14000

# set=pin means the pin will be set high during bootloading
# on this board B1 shall be grounded to enter the bootloader after reset
# leds "disk" and "swap" will blink during bootloading process
# device bootloader button=B1 user=0x1d005000 led=C13 led2=C14


and the top Makefile.user for 32MXSDRAM board:

Code:
FUBARINO-USBC-U2-SRAMC  = sys/pic32/fubarino/FUBARINO-USBCONS-UART2-SRAMC
FUBARINO-U2C-U4-SRAMC   = sys/pic32/fubarino/FUBARINO-UART2CONS-UART4-SRAMC
FUBARINO-U2C-SRAMC      = sys/pic32/fubarino/FUBARINO-UART2CONS-SRAMC
FUBARINO-U2C            = sys/pic32/fubarino/FUBARINO-UART2CONS
FUBARINO-USBC           = sys/pic32/fubarino/FUBARINO-USBCONS
UBW32-UART-SDRAM        = sys/pic32/ubw32-uart-sdram/UBW32-UART-SDRAM

# the new board
32MXSDRAM-UART          = sys/pic32/32mxsdram-uart/32MXSDRAM-UART

# Select target board
TARGET                  = $(32MXSDRAM-UART)

# Filesystem and swap sizes, when SWAP_KBYTES < sdramp0:sa@xxxx, the swap on
# the external ramdisk will be used automatically.
# U is the user space where you may place your files, if any.
# The size of the sdcard.rd image = FS_KBYTES + U_KBYTES + SWAP_KBYTES
FS_KBYTES       = 64000
U_KBYTES        = 20000
SWAP_KBYTES     = 1024

# Set this to the device name for your SD card.  With this
# enabled you can use "make installfs" to copy the filesys.img
# to the SD card.

SDCARD          = /dev/sdb



After the build I got following files:

Code:
sys/pic32/32mxsdram-uart/unix.hex
sys/pic32/32mxsdram-uart/bootloader.hex
retrobsd/sdcard.rd 113.3 MB
retrobsd/user.img 13.7 MB
retrobsd/filesys.img 97.7MB


So, in order to refresh my understanding:
1. we flash bootloader.hex to flash
2. we flash unix.hex via pic32prog to flash
3. we install with installfs the sdcard.rd to an Sdcard (under linux)
4. after the boot we need to make an fs on the sdcard's partition and mount ie. /tmp on it:
Code:
mkfs /dev/rd1b
mount /dev/rd1b /tmp

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Sep 26, 2013 10:16 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
filesys.img and user.img get combined into sdcard.rd. That is the file that gets installed into the SD card with installfs.

Other than that it looks like it should be fine (but I am a little rusty myself).

BTW: I have made a request with my MCHP contact to get some early engineering samples of the PIC32MZ, as I have a product on the horizon that really needs it. When that product is ready I'll work on porting RetroBSD to it. There'll be special drivers I'll need to write to support it, such as the TFT screen display driver, and the audio driver...

_________________
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 Sep 26, 2013 11:08 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
So:
1. we flash bootloader.hex to flash
2. we flash unix.hex via pic32prog to flash
3. we install the sdcard.rd onto an Sdcard (with installfs under linux)
4. after the boot we need to mount /u (do we need to edit rc somehow?)
What needs to be done after the boot? In past I had to edit some files under retrobsd after the boot in order to mount the /u. Is that done automatically today?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Sep 26, 2013 12:21 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
All mounting is controlled by /etc/fstab - that is a standard unix/linux system.

You really want the SDRAM filesystem mounted as /tmp not /u, and it would need formatting before use (you'd need to add that to /etc/rc or /etc/rc.local - not sure which would be best), and it would need to be mounted after that formatting has taken place, so the auto mounting from /etc/fstab won't work.

I can't actually remember off hand how it all meshes in together - I know I wrote it, but it's been too long and I have written too much code since to remember. It'll all come back to me when I start actively playing with it again though.

_________________
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 Sep 26, 2013 2:49 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
@majenko: thanks for the details you provided to me offline, I've updated the info above. I need to dig into the old topics how to set the auto mounting from /etc/fstab..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

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