RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Oct 15, 2019 11:08 am

All times are UTC




Post new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Sat Oct 04, 2014 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
Brilliant! I may have to try and persuade the chipKIT guys to replace avrdude :)

_________________
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 Oct 04, 2014 10: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
Is there an option to set the baud rate?

_________________
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 Oct 04, 2014 9:34 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
cts wrote:
@vak: Great, great news! Where will I be able to find the howto on, well, how to use it once it's done? If you have "bits" of info I'd be glad to help documenting it.
Hi Cristian,

In case you have a regular Fubarino SD with bootloader preinstalled, the programming is trivial:
Code:
$ pic32prog -d /dev/tty.usbmodemfa131 unix.hex
Programmer for Microchip PIC32 microcontrollers, Version 1.101M
    Copyright: (C) 2011-2014 Serge Vakulenko
      Adapter: STK500v2 Bootloader
 Program area: 1d000000-1d07ffff
    Processor: Bootloader
 Flash memory: 512 kbytes
         Data: 153100 bytes
Program flash: ###################################### done
 Verify flash: ###################################### done
Rate: 41244 bytes per second
You will need to figure out the name of bootloader's serial device on your machine and provide it to pic32prog with -d option. On my MacOSX it's /dev/tty.usbmodemfa131; on Linux it would be something like /dev/ttyACM0 or /dev/ttyUSB0.

Recently I've modified the RetroBSD configuration script for Fubarino SD to use Arduino-compatible bootloader. It makes sense to update your git snapshot.

I use one of the very early Fubarino boards. No standard bootloader has been available for it, so I adapted one of HID variants. But when reprogrammed with recent chipKIT bootloader, it became 100% Fubarino SD compatible, and now works perfectly with pic32prog via stk500v2 protocol.


Top
 Profile  
 
PostPosted: Tue Oct 07, 2014 9:00 am 

Joined: Thu May 01, 2014 7:17 am
Posts: 8
It works perfectly.

Thank you very much!!

As promised, I have written a rather extensive "From naked virtual machine to Fubarino with RetroBSD" walkthrough, think of it as an extended version if the Installation you have on the wiki. I'd like to send you the dokuwiki source for the page, how would I do that?

One more question remains - I have enabled two UARTS in
Code:
sys/pic32/fubarino/FUBARINO
by adding
Quote:
device uart1 baud=115200
device uart2 baud=115200


On which ports will I find those UARTS? Are they 3.3V or 5V? In the end I'm trying to acquire one or better two original VT100 dumb terminals to connect to those UARTS - I can't think of a more retro way of accessing RetroBSD ;)


Top
 Profile  
 
PostPosted: Wed Oct 08, 2014 8:18 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Uarts are 3.3V on Fubarino SD.
The pins marking - go to chipkit site there is Fubarino SD schematics - be aware the Fubarino may have 795H or 430H chips installed, take the schematics with 795.
http://www.chipkit.net/forum/viewtopic.php?f=24&t=2814

FYI - This is a setup with 2 uarts and 2x8MB ramdisks (2MB swap + 6MB \tmp0 + 8MB \tmp1) I've been using:
Code:
# Fubarino SD with UART2 console, UART1 enabled and with 2xSRAMC disk
#
core pic32mx7

# ! pin numbers here are the pin n. printed out on the Fubarino board (ie. 12, 23)
mapping fubarino

linker bootloader

# 4MB CPLD sram ramdisk, BitBang driver, swap and filesystem
# ! nmount=3 (rootfs+swap+tmpfs)
#option PARTITION=sramc0:sa@1500,fs@2572
#option PARTITION=sramc0:sa@1024,fs@3000
#device sramc data=16 lda=5 rd=15 wr=14

# 8MB CPLD sram ramdisk, PMP bus, swap and filesystem
# ! nmount=4 (rootfs+swap+tmp0+tmp1)
# change the sramc-size in rd_sramc.c as well
# no pins defs required - using PMP bus, PMA0 (disk0) and PMA10 (disk1)
# are the PMP /CS addresses
option PARTITION=sramc0:sa@2048,fs@6144 sramc1:fs@8192

# you must create /tmp0 and tmp1 on the root manualy
# mkdir /tmp0, mkdir /tmp1, mount -a
device sramc0
device sramc1

option nmount=4

# let us try with 120MHz clock
device kernel cpu_khz=120000 bus_khz=120000 led=21

# Console UART2, tty = UART - 1
device console device=tty1
device uart2 baud=115200

# Additional UART1
device uart1 baud=115200

# SDcard
device sd0 port=2 cs=SS mhz=20

# NPROC=25 MAX
option nproc=25
option hz=1000
option nbuf=8

# additional drivers loaded
device adc
device spi
device oc
device gpio

# Bootloader section (pic32prog):
device bootloader led=21 button=23 crystal=8 jump=0x9d000000

# Bootloader clock coefs calcs:
# clock = crystal / pllidiv * pllmul
# usb == 48MHz = crystal / upllidiv * 12

# Bootloader: for 40MHz clock:
# option crystal=8
# option pllidiv=3
# option pllmul=15
# option upllidiv=2

# Bootloader: for 80MHz clock:
# option crystal=8
# option pllidiv=2
# option pllmul=20
# option upllidiv=2

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

# Bootloader: for 120MHz clock:
option crystal=8
option pllidiv=1
option pllmul=15
option upllidiv=2

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Oct 21, 2014 10:24 pm 

Joined: Wed Oct 08, 2014 11:03 am
Posts: 71
hi

vak wrote:
In case you have a regular Fubarino SD with bootloader preinstalled, the programming is trivial:
Code:
$ pic32prog -d /dev/tty.usbmodemfa131 unix.hex
Programmer for Microchip PIC32 microcontrollers, Version 1.101M
    Copyright: (C) 2011-2014 Serge Vakulenko
      Adapter: STK500v2 Bootloader
 Program area: 1d000000-1d07ffff
    Processor: Bootloader
 Flash memory: 512 kbytes
         Data: 153100 bytes
Program flash: ###################################### done
 Verify flash: ###################################### done
Rate: 41244 bytes per second



There is a small error in the STK500v2 driver which stops it working with my
UARTs. The following patch demonstrates a solution.

--- adapter-stk500v2.c (revision 117)
+++ adapter-stk500v2.c (working copy)
@@ -550,8 +550,8 @@
new_mode.c_lflag = 0;
new_mode.c_cc[VTIME] = 0;
new_mode.c_cc[VMIN] = 1;
- cfsetispeed (&new_mode, 115200);
- cfsetospeed (&new_mode, 115200);
+ cfsetispeed (&new_mode, B115200);
+ cfsetospeed (&new_mode, B115200);
tcflush (a->fd, TCIFLUSH);
tcsetattr (a->fd, TCSANOW, &new_mode);

bye.


Top
 Profile  
 
PostPosted: Wed Oct 22, 2014 6:24 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Fixed - thank you for the patch!


Top
 Profile  
 
PostPosted: Sun Dec 14, 2014 2:42 pm 

Joined: Wed Oct 08, 2014 11:03 am
Posts: 71
hi there, sorry to append here but it may get noticed.

i have a feature request for stk500v2 mode.

i would like chip erase and boot flash support added so i
can utilise pic32prog as a front-end for a PIC32 programmer
using this protocol.

a patch is here:
http://hg.kewl.org/pub/nanunanu/file/49 ... 0v2.c.diff

i consider this patch worthy of testing right now and my own
tests against the chipKit bootloader demonstrated no ill effect.

i can test against the bootloader for the SDXL later but don't really
foresee a problem... over confident perhaps? :-)

FYI, the chipKITpi bootloader just locks if you send it something
in the boot flash area.

if you are worried about this feature then maybe it can be optional
and change the mode of the stk500v2 driver from bootloader mode
to perhaps programmer mode?

thanks, bye bye

EDIT: updated link to patch which was actually wrong,sorry


Top
 Profile  
 
PostPosted: Mon Dec 15, 2014 2:47 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Pictures with Fubarino SD with 2x8MB ramdisk modules, a BT serial module, and an RTC module put on a solderless board :)
In this setup it works @120MHz, the access to the ramdrives is slower, set by PMP params.
Code:
# df -i
Filesystem  1K-blocks     Used    Avail Capacity iused   ifree  %iused  Mounted on
/dev/rd0a      127499    16891   110608    13%     611    7389     7%   /
/dev/rd0c       19920        2    19918     0%       4    1260     0%   /u
/dev/rd1b        6119        2     6117     0%       3     381     0%   /tmp0
/dev/rd2a        8159        2     8157     0%       3     509     0%   /tmp1
#


Attachments:
20141214_150540.jpg
20141214_150540.jpg [ 1.22 MiB | Viewed 17004 times ]
20141214_150412.jpg
20141214_150412.jpg [ 1.26 MiB | Viewed 17004 times ]
20141214_150352.jpg
20141214_150352.jpg [ 1.27 MiB | Viewed 17004 times ]
20141214_150335.jpg
20141214_150335.jpg [ 1.22 MiB | Viewed 17004 times ]

_________________
Pukao Hats Cleaning Services Ltd.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3

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