Open Source for P3GO
C Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Open source project for P3GO supported by G-TEAM

The core of P3GO MCU is MIPS, so you need a cross compiler toolchain for your host system. You can download it from the link as blow. When you decompress compiler tools, you also need to add the installed path to your environment settings, like "export PATH=$PATH:~mips_compile/bin". 
Cygwin on Windows:

Directory structure
inc			--		common include directory
miniclib	    --	    small c library
mtv_50		--	    main project directory, there has already some payload projects, like hermes,kakroto,asbestos
release		--	    compile binary directory
soc_src		--	    some driver and system boot code
src		    --	ucos and mips header files

How to compile?
There is some example project in the mtv_50 directory; you can try to compile these by yourselves. 

  mtv_50/loader -- Hermers V4B payload
  mtv_50/loaderPL3  -- KaKaroto PL3 payload
  mtv_50/asbestos	--	WIP:porting asbestos loader

You can enter mtv_50/loader and "make build", then will generate homebrew.bin and update.bin in release directory if there is no error occured.

How to update your P3GO?
First you need update your P3GO to development version (please go to to download a development version update binary), then you can put you compiled update.bin to P3GO buildin disk not TF card disk, then re-plug your device to complete update. Note if you want to your custom firmware work, you must insert a TF card in the P3GO TF slot.

How to import a new project?
Simply you just only copy a loader or loaderPL3 project to a new directory, then import other open source project to the new project. Note by default, your code size is limited 512KB, if you want to use more memory, please referense "How to modify memory space".

How to modify memory space
By default, used memory address space range of your program is 0x80300000 - 0x807FFFFF. The P3GO buildin loader program will load your code to 0x80300000 when booting, and then jump in and run it. So in demo project, such as loader and loaderPL3, default code size is limited to 512KB by link.xn, i.e. your code address range is 0x80300000 - 0x80380000, and memory space above 0x80380000 is used as heap of ucos. 
In the Configrure.mak file, we also defined some macro to define several memory space size.
DRVMEMADDR := 0x80380000
		this is heap space for driver and os. you can call alloc/dealloc function to get a heap memory space in this memory space.
DRVMEMLEN := 0x40000
		driver heap size
APPMEMADDR := 0x803C0000
		this is module heap space for application. Demo project not use that space, but you can use it feel free.
So if you want to modify memory space setting, you need to change 2 files, link.xn and Configure.mak. In link.xn, you need to assign memory size for your program, and also need change the DRVMEMADDR setting in Configure.mak. Please careful, DRVMEMADDR must greater than your code size + 0x80300000.

Example setup steps on cygwin
	Download and install cygwin to c:\cygwin on your pc, specialy you must selected and installed the development packet.
	Download the mipsel-gcc4.1-cygwin-nopic.tar.bz2 from above link and extract to c:\cygwin\opt, and then "mipseltools-nopic" directory will be created in c:\cygwin\opt.

	#cd /opt
	#bzip2 -d mipsel-gcc4.1-cygwin-nopic.tar.bz2
	#tar xf mipsel-gcc4.1-cygwin-nopic.tar

	edit C:\cygwin\home\Administrator\.bashrc and add "export PATH=/opt/mipseltools-nopic/bin:$PATH" to last of the bashrc file.
	restart cygwin and enter your open-p3go directory and 
	#cd mtv_50/loader
	#make clean
	#make build
	then if no error occur, you will get a homebrew.bin and update.bin in open-p3go/release.