Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 13:30 01 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : mm+ and the source code for 470 chip....

Author Message
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 03:52pm 24 Jan 2016
Copy link to clipboard 
Print this post

i know you need full ( payed) compiler for the 170 chip and mmbasic .
but can i compile with the "open" version for mm+ and the 470 chip?

 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 04:37pm 24 Jan 2016
Copy link to clipboard 
Print this post

Yes, you can.

Change the optimisation for gcc to -O1 (level 1).

You will also need to go through the source and delete the qualifier __attribute__((mips16)) which is placed in front of some functions. A global search and replace should do it for you.

When the source is compiled with a lower optimisation it might not fit in the available flash and in that case you will have to reduce the amount of flash allocated to the BASIC program. You do this by adjusting the value assigned to PROG_FLASH_SIZE which is defined in Flash.h

GeoffEdited by Geoffg 2016-01-26
Geoff Graham - http://geoffg.net
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 11:18pm 24 Jan 2016
Copy link to clipboard 
Print this post

You might be able to use gcc and even keep the attributes.

Not having the (MMBasic) source I've not tried it.

John
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 11:43pm 24 Jan 2016
Copy link to clipboard 
Print this post

  Quote  You might be able to use gcc and even keep the attributes


As I understand GCC MIPS does not compile for PIC32, has issues.

I know of another open source controller/language platform that are not supporting PIC32 because they can't compile with GCC and they don't want to use crappy and costly microchip compiler with optimization.
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 11:58pm 24 Jan 2016
Copy link to clipboard 
Print this post

You can use GCC for the PIC32/MIPS, that is what ChipKit uses.

  JohnL said  As I understand GCC MIPS does not compile for PIC32, has issues.


Take a look at this:

A guide to build GCC for MIPS / PIC32

I have not personally tried it yet but his step by step guide to getting it up and running on Windows, Mac and Linux platforms looks very comprehensive and even covers linker scripts etc.

A very good read even if you don't actually intend to build your own tool chain.

Cheers
ChrisEdited by Chris Roper 2016-01-26
http://caroper.blogspot.com/
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 01:07am 25 Jan 2016
Copy link to clipboard 
Print this post

A guide to build GCC for MIPS / PIC32

I can't open that link Chris.
Have found reference to that site elsewhere but still can't open it.
Do you know if it is still alive?

I would definitely be interested in a working GCC compiler setup for PIC32.

Apparently the original GCC for MIPS didn't have the startup code and headers for hardware peripherals for PIC32 and possibly some other issues.

Thanks
John
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 01:21am 25 Jan 2016
Copy link to clipboard 
Print this post

I did try it and it opened for me, try this one instead:

http://wise-ware.org/wiki/

I also edited the post above to make them both the same.

  JohnL said   Apparently the original GCC for MIPS didn't have the startup code and headers for hardware peripherals for PIC32 and possibly some other issues.


He used NewLib which is an open source version of the Microchip Libraries.
Basically the same Libraries that ChipKit uses.

Getting it all integrated into an IDE would be the next step but so far I am still frying my brain with his excellent description of the cryptic linker script format.

I wish I had read this befor I built my first PIC32 Bootloader and OTA Uploader, it would have saved me hours.Edited by Chris Roper 2016-01-26
http://caroper.blogspot.com/
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 02:30am 25 Jan 2016
Copy link to clipboard 
Print this post

Some more ideas on supporting PIC32 from C:

1. RetroBSD etc

2. Pinguino project

3. Brian Schmalz / maybe AN Other (sorry, it's a long time since I made notes) - I recall a tutorial about patching gcc (the point being that Microchip use gcc to make xc32 etc so MUST by laws release their changes - the hassle being putting it together again I gather)

edit: I think it was Phil Burgess's www.paintyourdragon.com/uc/

Thanks for that wiki, new one for me.

JohnEdited by JohnS 2016-01-26
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 02:26pm 25 Jan 2016
Copy link to clipboard 
Print this post

http://www.microchip.com/forums/m789980.aspx

Discussion on microchip forum.

If example in post #19 (XC8 version) has any truth then it is outrageous what microchip is/was doing.

Their expensive full version optimized compiler may have nothing more than omitting the crippling stuffing code that is deliberately inserted in the free version ??

If anyone has full XC32 compiler, may be worth having a look at some disassembled code to compare non optimized and optimized.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024