Skip to content

Latest commit

 

History

History
168 lines (130 loc) · 5.59 KB

File metadata and controls

168 lines (130 loc) · 5.59 KB

DiscoBSD/pic32 - 2.11BSD-based OS for PIC32MX7 MIPS MCUs

Currently supported hardware

Build

A few packages are required to compile everything from source. Under Ubuntu installation can be done by the commands:

$ apt install bison byacc flex git groff-base libbsd-dev
$ apt install libelf-dev libfuse-dev sudo unzip zip

If a mips-elf-gcc compiler package is not available from the host distribution, then the compiler toolchain must be built following these instructions.

The desired filesystem size and swap area size can be changed, as required. Default is:

FS_MBYTES   = 200
U_MBYTES    = 200
SWAP_MBYTES = 2

To compile the kernel and build a filesystem image, run:

$ make MACHINE=pic32 MACHINE_ARCH=mips distribution

A resulting root filesystem image is in the file sdcard.img. Kernel files are named unix.hex and are in target board subdirectories.

Filesystem image

The file system image sdcard.img needs to be imaged onto an SD card.

On Windows host systems use a disk imaging utility such as Rufus.

On Unix-like host systems with dd run:

$ dd bs=1M if=sdcard.img of=/path/to/SD/card

The target installfs can be used to image the SD card on Unix-like systems. Provide the path to the SD card via the command line:

$ make MACHINE=pic32 SDCARD=/path/to/SD/card installfs

Install kernel

The kernel image must be written to the PIC32 flash memory. The specific procedure depends on the target development board.

PIC32-RETROBSD board:

Use the pic32prog utility and a USB cable to install the kernel:

$ pic32prog sys/arch/pic32/compile/PINGUINO_MICRO/unix.hex

Max32 board:

Use the pic32prog utility and a USB cable to install the kernel:

$ pic32prog -d /dev/ttyUSB0 sys/arch/pic32/compile/MAX32/unix.hex

UBW32 board:

Use the pic32prog utility and a USB cable to install the kernel:

$ pic32prog sys/arch/pic32/compile/UBW32/unix.hex

Maximite:

Use the bootload program for Windows, download links are available here: https://geoffg.net/MonoMaximite.html#Downloads

Explorer 16 board:

There is an auxiliary PIC18 chip on the Explorer 16 board, which can be used as a built-in programmer device. A PICkit 2 adapter is needed to install the required firmware, as described in this article in the section "Hack #2: Lose the PICkit 2, Save $35". This should be done only once.

Then, use the pic32prog utility and a USB cable to install the kernel:

$ pic32prog sys/arch/pic32/compile/EXPLORER16/unix.hex

PIC32 Starter Kit:

Use the PICkit 2 adapter and software to install a boot loader from the file starter-kit/bootloader.hex in the pic32-usb-bootloader repository. This should be done only once.

Then, use the pic32prog utility and a USB cable to install the kernel:

$ pic32prog sys/arch/pic32/compile/STARTER_KIT/unix.hex

Simulator

Use the VirtualMIPS MIPS32 simulator to develop and debug DiscoBSD/pic32 without the need for a hardware development board. By default, the simulator is configured to imitate a Max32 board. To build it:

$ cd tools/virtualmips
$ make

Run it:

$ ./pic32

Configuration of the simulated board is stored in the file pic32_max32.conf.