RetroBSD

2.11BSD operating system for microcontrollers
It is currently Thu Oct 18, 2018 9:51 pm

All times are UTC




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Dec 17, 2015 7:25 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
(repost from Olimex blog)

New Product in stock: PIC32-RetroBSD Open Source Hardware Board running Unix like RetroBSD OS

Image

RetroBSD is a port of 2.11BSD Unix intended for embedded systems with fixed memory mapping. The current target is Microchip PIC32 microcontroller with 128 kbytes of RAM and 512 kbytes of Flash. PIC32 processor has MIPS M4K architecture, executable data memory and flexible RAM partitioning between user and kernel modes. The project is open source and hosted at RetroBSD.org

PIC32-Pinguino was used by RetroBSD developers since long time as it’s small and easy to use, but the Pinguino bords processor PIC32MX440 has not enough RAM to hold the RetroBSD, so we got number of requests to release PIC32-PINGUINO-MICRO with PIC32MX795F512H processor which is pin to pin compatible, so we run small batch of these boards and named them PIC32-RetroBSD, these surely can be used with Pinguino and MPIDE, but note that you must have additional PIC-KIT3 to re-flash the proper bootloader, as RetroBSD bootloader is different and we ship these boards with RetroBSD bootlaoder. Also you will need PIC32-RetroBSD-SD for the file system.

We are shipping today free PIC32-RetroBSD boards to the 9 RetroBSD developers.

(by OLIMEX Ltd)


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 2:24 pm 
Contributor

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

Serge, nice holiday gift.

I hope I am one of the lucky ones :).

Happy Holidays to all

Wiz


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 2:58 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
Well, it's one for Serge, and 8 for me - one for each of my personalities ;)

_________________
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 17, 2015 3:27 pm 

Joined: Mon Nov 24, 2014 1:07 pm
Posts: 58
Very nice board and well laid out, I'd love one of these but I guess I'll have to wait until after Christmas when my bank account isn't in it's usual December drought! :)


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 5:39 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Serge+Matt+Magnificent Seven
:)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 6:23 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
:)
Well, a few months ago I had sent private messages to everybody involved into RetroBSD project, asking about a wish to get and evaluate a new Olimex board. Eight people responded, plus myself, which makes nine of us. Here is a list: majenko, wiz, jaromir, chrisd, alexfru, robert.rozee, vak, DanTheMan, ibara.


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 8:41 pm 
Contributor

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

WOW! What an awesome holiday present :).

Gotta put Olimex on my favored supplier list !!

Wiz


Top
 Profile  
 
PostPosted: Tue Jan 12, 2016 2:34 pm 

Joined: Tue Sep 16, 2014 12:51 pm
Posts: 47
Location: christchurch, new zealand
mine arrived in the post quite unexpectedly last week. it is a seriously cool little device that i've been able to impress a few friends with.

the only problem i had initially getting it going was finding drivers for the USB - i'm running windows XP on most machines. it turns out the driver files are available on the microchip website, and are the same ones as used for the MCP2200:
http://www.microchip.com/wwwproducts/devices.aspx?dDocName=en546923
(under 'documentation and software')

on a friend's windows 7 machines the drivers were (eventually) found by windows automatically.

i'd be more than happy to help out in creating a 'getting started' tutorial, but would need a little direction from others. from what i read the bootloader isn't quite the right one, and a brief outline (bullet points) on the steps to upgrade that would be good. same for installing a kernel with the serial ports enabled. and someone mentioned that only 100mb of the SD card is used - can this be expanded to use the full physical space?

note that despite receiving a board, i am a retrobsd beginner!

i do have a pickit 2 here (and a 3, for what little use it is). plus a good collection of 'ascii ICSP' adapters that work with pic32prog. btw, the November 2015 issue of Silicon Chip magazine (an australian publication) contains my article on building a cheap arduino-based pic32 programmer that works with pic32prog.

cheers,
rob :-)


Top
 Profile  
 
PostPosted: Sun Jan 24, 2016 5:33 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
Hi Robert,

Thank you for the information about the Windows XP driver. I'll send it to Olimex, to put the link on the product's web page.

I'm glad to help you with the 'getting started' tutorial. Unfortunately, the early boards come with wrong bootloader (from Duinomite, another Olimex board). BUT key does not work as expected. To enter bootloader mode, a pin 14 (RD8) has to be connected to pin 20 (GND) of connector CON1 (and then press the RST button).

How to replace the bootloader:
Instructions on installation of the RetroBSD kernel you can find here: https://github.com/RetroBSD/retrobsd/blob/master/tools/build/skeleton/README.txt.

The default SD card image has only 100Mb allocated for root filesystem. This way, we keep the sdcard.img file small to simplify the installation process for the user. It's possible to increase the size of the root partitions: modify FS_MBYTES parameter in the top level Makefile and rebuild sdcard.img. An alternative way is to use a second partition.

Initially, we have three partitions preinstalled on SD card:
  • Partition 1 - /dev/sd0a - size 100Mbytes - a root filesystem
  • Partition 2 - /dev/sd0b - size 2Mbytes - swap space
  • Partition 3 - /dev/sd0c - size 100Mbytes - not formatted, presumably /u filesystem
The user can reallocate the third partition, or create a partition #4 and allocate the rest of space up to the end of physical disk.

How to format, check and mount partition 3 as /u directory:
Code:
# mkfs /dev/sd0c
Getting disk size for /dev/sd0c
Size: 102400 kbytes
Inodes: 6400
# fsck /dev/sd0c
** /dev/sd0c
File System:

** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Free List
2 files, 2 used, 101997 free
# mount /dev/sd0c /u
# df
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/sd0a      101999    12553    89446    12%    /
/dev/sd0c      101999        2   101997     0%    /u

Fdisk utility can be used to allocate partitions. I'm not sure it currently works as expected, though. I need to double-check.
Code:
# fdisk
Usage: fdisk -p /dev/rdX
          Print partition table

       fdisk -d /dev/rdX <num>
          Delete partition <num>

       fdisk [-w] -n /dev/rdX [<KB>]
          Add a new partition at the end of the
          partition table.  If size is specified
          creates it of that size, otherwise fills
          space to end of disk.  If you specify -w
          then the MBR is wiped before partition
          creation.
       fdisk -a /dev/rdX <num>
          Toggle active flag on partition
       fdisk -T -t <type> /dev/rdX <num>
          Set the type of a partition.
# fdisk -p /dev/sd0
/dev/sd0: 348160 blocks of 1KB
Nr    Start   Length Type
 1        1   102400 B7 *
 2   102401     2048 B8 
 3   104449   102400 B7

Thank you for your magnificent article about pic32prog!
Best wishes,
--Serge


Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 1:05 pm 

Joined: Tue Sep 16, 2014 12:51 pm
Posts: 47
Location: christchurch, new zealand
successfully uploaded the correct bootloader, using connections to PGED1 and PGEC1 on the two 20-way connectors. MCLR isn't brought out, so i just held a probe onto the correct end of the reset button.

i now have a happy board that flashes the two LEDs alternately.

next attached to my (windows) PC and get as far as the board being identified as an HID device with the default windows drivers loading automatically. at this point things start to go down hill.

the drivers here:
http://chipkit.net/forum/viewtopic.php?t=2289
do not match the VID/PID of the board. the board has VID=04D8, PID=003C. the drivers only list VID=0403, PID=A662. simply editing VID/PID did not work.

i have found various drivers with matching VID/PID for microchip and pinguino, but so far none of these have worked either. any suggestions for the next step.


cheers,
rob :-)

addendum: also tried drivers from here with no luck:
http://wiki.pinguino.cc/index.php/Windows_XP_Drivers
needed to edit PID, but didn't help.


Last edited by robert.rozee on Thu Jan 28, 2016 1:31 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 1: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
Have you installed the kernel yet?

_________________
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 Jan 28, 2016 1:32 pm 

Joined: Tue Sep 16, 2014 12:51 pm
Posts: 47
Location: christchurch, new zealand
only the bootloader so far. it is the kernel that i am attempting to install now.


Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 1:45 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
Then you don't need to worry about drivers. The bootloader runs in HID mode and pic32prog talks to it without drivers - you don't need drivers for raw HID.

Once the kernel is installed it will enumerate as a CDC/ACM device and you will most likely find it now has the right VID/PID for the drivers, since the drivers are for the CDC/ACM provided by the kernel not the HID provided by the bootloader.

_________________
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 Jan 28, 2016 1:58 pm 

Joined: Tue Sep 16, 2014 12:51 pm
Posts: 47
Location: christchurch, new zealand
ok, i've now removed all the drivers and am back to the windows defaults:
Attachment:
hid.gif
hid.gif [ 2.22 KiB | Viewed 15328 times ]

when i run pic32prog with the filename unix.hex passes to it as the only parameter, i get the following response:
Code:
Programmer for Microchip PIC32 microcontrollers, Version 2.0.186
    Copyright: (C) 2011-2015 Serge Vakulenko
hidboot: error -1 receiving packet


Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 2:15 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 think it's over to Serge now ;) It should be working just like that - I have never used any drivers in windows (however I haven't really used windows for a number of decades).

_________________
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 Jan 28, 2016 3:19 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
To enter bootloader mode, a pin 14 (RD8) has to be connected to pin 20 (GND) of connector CON1 (and then press the RST button).

or
viewtopic.php?f=7&t=37436&p=42681&hilit=usb+bootloader#p42684

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Feb 05, 2016 1:52 pm 

Joined: Tue Sep 16, 2014 12:51 pm
Posts: 47
Location: christchurch, new zealand
Pito wrote:
Quote:
To enter bootloader mode, a pin 14 (RD8) has to be connected to pin 20 (GND) of connector CON1 (and then press the RST button).



have tried connecting RD8 to ground, then pressing reset, but this makes no difference. i still get the following output from pic32prog:
Code:
Programmer for Microchip PIC32 microcontrollers, Version 2.0.186
    Copyright: (C) 2011-2015 Serge Vakulenko
hidboot: error -1 receiving packet


this is with the two LEDS (green and orange) flashing alternately. btw, the pic32 also runs pretty hot in this state, measured at 50 degrees C.

cheers,
rob :-)


Top
 Profile  
 
PostPosted: Fri Feb 05, 2016 2:05 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Robert,

I don't own the 'correct' Microchip programming stuff.

So I program VIA the jtag pins and an old Knoppix 3.6 box with a parallel port. As far as I know that will ALWAYS get the chip started. There are only two caveats. 1. The chip must have some sort of clock. This is needed for the JTAG stuff to be able to talk to the CPU. This is now documented. 2. The chip must not be 'burned out' or somehow defective.

I notice that the Olimex unit I received was 'cold' programmed VIA JTAG (you can see scratches on the PCB). Once programmed though, the Olimex startup code disables the JTAG pins.

You 'should' still be able to 'cold' program it VIA JTAG with CPU clock present and CPU reset active (grounded). That is a project I am working on right now. Having one PIC32 JTAG program another. It is pretty straightforward but a little tedious to write the actual code. It is known to work since I have similar stuff running on my Knoppix 3.6 box.

Somehow I always get stuck with the hardest problems when I start to use a new chip.

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Thu Feb 11, 2016 2:01 am 

Joined: Thu Feb 11, 2016 1:39 am
Posts: 1
I just got all the pieces needed to get my Olimex RetroBSD board working; thankfully, I was forewarned by this thread that there would need to be additional items. Has anyone informed Olimex that they put the wrong boot loader on these boards, so that other newcomers don't need to jump through these hoops?

* MicroUSB rather than MiniUSB -- that threw me for a loop, momentarily.
* Olimex's PIC-KIT3 -- to program the bootloader.
* Olimex's PIC-ICSP -- to connect the PIC-KIT3 above to the RetroBSD board
* Breadboard and jumper -- for connecting the pins to short and allow the boot loader to be loaded.

As I had a PIC-KIT3, I had to use the Microchip tools to program the boot loader rather than the pic32prog tool which appears to only support the PIC-KIT2?

One confusing aspect was the RetroBSD Console device on my Mac, which appears as
Code:
/dev/tty.usbmodem???
rather than as
Code:
/dev/ttyUSB???
.

Did you know that you can use `screen` as a serial console, like so:
Code:
screen /dev/tty.usbmodem1421 115200


I intend to port RawrCat, which is a concatenative language that is like a mix of Forth and Lisp, to a small platform like this. My reckoning is that if I can make it run well and fast on RetroBSD, it should be really fast elsewhere. :D

Has anyone looked at LLVM's MIPS backend for building binaries for RetroBSD or LiteBSD? I ask because I've hand-written a Forth in LLVM IR and wonder if it would work on this board.

Thanks for this project -- you would not believe the huge smile on my face when I saw 2.11 BSD boot messages scroll onto my terminal window.


Attachments:
File comment: Flashing the boot loader!
reprogram-bootloader.jpg
reprogram-bootloader.jpg [ 396.01 KiB | Viewed 14791 times ]
Top
 Profile  
 
PostPosted: Thu Feb 11, 2016 12:58 pm 

Joined: Tue Sep 16, 2014 12:51 pm
Posts: 47
Location: christchurch, new zealand
right, i am back up and running again.

it seems that the windows version of pic32prog will not talk to an STK500v2 bootloader when running under windows XP. i shall endevour to conduct tests under other windows versions.

i was able to run the linux32 version of pic32prog on a friends computer (running linux mint), and this worked fine, detecting the bootloader as a HID without any issues. i could then upload the unix.hex file and the board sprang back into life, with serial ports now enabled.

i've just tested some earlier versions of pic32prog (back to 1.98) and none of them will talk to the bootloader when running under XP. the response is as outlined before:
Code:
Programmer for Microchip PIC32 microcontrollers, Version 2.0.186
    Copyright: (C) 2011-2015 Serge Vakulenko
hidboot: error -1 receiving packet



cheers,
rob :-)


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