2.11BSD operating system for microcontrollers
It is currently Wed Dec 02, 2020 7:59 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Flash Kernel file
PostPosted: Mon Sep 14, 2015 8:00 am 

Joined: Wed Sep 09, 2015 3:46 pm
Posts: 6
Can we do directly flash the hex file of kernel on the pic32 micro controller using MPLAB IDE?
if not the what to do.please help me that i can run the os on my custom board.


 Post subject: Re: Flash Kernel file
PostPosted: Mon Sep 14, 2015 7:40 pm 
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Hi Fahim,

Direct flashing of the unix.hex into a custom board is possible, with two conditions:
  • The kernel is appropriately configured. This usually assumes a specific linker script (like ldscript "baremetal/script.ld"), and a file with DEVCFG values, which are highly board-dependent.
  • In case you use MPLAB IDE to re-flash the board, please make sure the DEVCFG settings are correct.

The linker script defines the memory layout of the kernel binary. You can easily make sure your kernel is configured properly by viewing the file unix.dis in the kernel build directory. Execution starts from 0x9fc00000. Usually a bootloader resides at this address, but in case of bare metal configuration you should see a reset vector here:
unix.elf:     file format elf32-tradlittlemips

Disassembly of section .boot:

9fc00000 <_reset_vector_>:
9fc00000:       00000821        move    at,zero
9fc00004:       00001021        move    v0,zero

DEVCFG values are important as they set up the clock source and frequencies. It depends on your board: you may have a oscillator installed, or use a crystal, or an internal RC oscillator etc. PLL divider and multiplier factors matter as well.

Here you can see an example of kernel configuration and DEVCFG values for a custom PIC32 board:

Best wishes,

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:

Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission