The 16-bit language tools consist of a compiler (pic30-gcc.exe), an assembler (pic29-as.exe), a linker (pic30-ld.exe), and an archiver/ librarian (pic30-ar.exe). Additional tools distributed with this release include a binary to Intel Hex converter (pic30-bin2hex.exe) and a command-line simulator (sim30.exe).
The 16-bit language tool official names are:
With the exceptions noted below, the 16-bit tools are written and distributed under the GNU General Public License (GPL) which means that its source code is freely distributed and available to the public.
The source for the tools under the GNU GPL may be downloaded separately from the Microchip WWW web page. You may read the GNU GPL in the file named COPYING located the top level of your install directory. A general discussion of principles underlying the GPL may be found at www.gnu.org/copyleft.
Exceptions to the GNU GPL:
Support code provided for the header files, linker scripts, and runtime libraries are also exceptions to the GPL, and therefore not covered under the GPL.
Devices listed in bold are new for the current release.
The following PIC24 F KA devices are supported:
4K devices | 8K devices | 16K devices | 32K devices |
---|---|---|---|
PIC24F08KA101 | PIC24F16KA101 | ||
PIC24F08KA102 | PIC24F16KA102 | ||
PIC24F04KA200 | |||
PIC24F04KA201 | |||
PIC24F16KA301 | PIC24F32KA301 | ||
PIC24F16KA302 | PIC24F32KA302 | ||
PIC24F16KA304 | PIC24F32KA304 |
The following PIC24 LF KA devices are supported:
16K devices | 32K devices |
---|---|
PIC24LF16KA301 | PIC24LF32KA301 |
PIC24LF16KA302 | PIC24LF32KA302 |
PIC24LF16KA304 | PIC24LF32KA304 |
The following PIC24 F GA devices are supported:
16K devices | 32K devices | 48K devices | 64K devices | 96K devices | 128K devices | 192K devices | 256K devices |
---|---|---|---|---|---|---|---|
PIC24FJ16GA002 | PIC24FJ32GA002 | PIC24FJ48GA002 | PIC24FJ64GA002 | ||||
PIC24FJ16GA004 | PIC24FJ32GA004 | PIC24FJ48GA004 | PIC24FJ64GA004 | ||||
PIC24FJ64GA006 | PIC24FJ96GA006 | PIC24FJ128GA006 | |||||
PIC24FJ64GA008 | PIC24FJ96GA008 | PIC24FJ128GA008 | |||||
PIC24FJ64GA010 | PIC24FJ96GA010 | PIC24FJ128GA010 | |||||
PIC24FJ32GA102 | PIC24FJ64GA102 | ||||||
PIC24FJ32GA104 | PIC24FJ64GA104 | ||||||
PIC24FJ128GA106 | PIC24FJ192GA106 | PIC24FJ256GA106 | |||||
PIC24FJ128GA108 | PIC24FJ192GA108 | PIC24FJ256GA108 | |||||
PIC24FJ128GA110 | PIC24FJ192GA110 | PIC24FJ256GA110 |
The following PIC24 F GB devices are supported:
32K devices | 64K devices | 128K devices | 192K devices | 256K devices |
---|---|---|---|---|
PIC24FJ32GB002 | PIC24FJ64GB002 | |||
PIC24FJ32GB004 | PIC24FJ64GB004 | |||
PIC24FJ64GB106 | PIC24FJ128GB106 | PIC24FJ192GB106 | PIC24FJ256GB106 | |
PIC24FJ64GB108 | PIC24FJ128GB108 | PIC24FJ192GB108 | PIC24FJ256GB108 | |
PIC24FJ64GB110 | PIC24FJ128GB110 | PIC24FJ192GB110 | PIC24FJ256GB110 | |
PIC24FJ128GB206 | PIC24FJ256GB206 | |||
PIC24FJ128GB210 | PIC24FJ256GB210 |
The following PIC24 F DA devices are supported:
128K devices | 256K devices |
---|---|
PIC24FJ128DA106 | PIC24FJ256DA106 |
PIC24FJ128DA110 | PIC24FJ256DA110 |
PIC24FJ128DA206 | PIC24FJ256DA206 |
PIC24FJ128DA210 | PIC24FJ256DA210 |
The following PIC24 H GP devices are supported:
12K devices | 16K devices | 32K devices | 64K devices | 128K devices | 256K devices |
---|---|---|---|---|---|
PIC24HJ12GP201 | |||||
PIC24HJ12GP202 | PIC24HJ32GP202 | PIC24HJ64GP202 | PIC24HJ128GP202 | ||
PIC24HJ32GP204 | PIC24HJ64GP204 | PIC24HJ128GP204 | |||
PIC24HJ64GP206[A] | PIC24HJ128GP206[A] | PIC24HJ256GP206[A] | |||
PIC24HJ64GP210[A] | PIC24HJ128GP210[A] | PIC24HJ256GP210[A] | |||
PIC24HJ32GP302 | |||||
PIC24HJ16GP304 | PIC24HJ32GP304 | ||||
PIC24HJ128GP306[A] | |||||
PIC24HJ128GP310[A] | |||||
PIC24HJ64GP502 | PIC24HJ128GP502 | ||||
PIC24HJ64GP504 | PIC24HJ128GP504 | ||||
PIC24HJ64GP506[A] | PIC24HJ128GP506[A] | ||||
PIC24HJ64GP510[A] | PIC24HJ128GP510[A] | ||||
PIC24HJ256GP610[A] |
The following dsPIC30 devices are supported:
30F10xx | 30F20xx | 30F30xx | 30F40xx | 30F50xx | 30F60xx |
---|---|---|---|---|---|
dsPIC30F1010 | dsPIC30F2010 | dsPIC30F3010 | dsPIC30F6010[A] | ||
dsPIC30F2011 | dsPIC30F3011 | dsPIC30F4011 | dsPIC30F5011 | dsPIC30F6011[A] | |
dsPIC30F2012 | dsPIC30F3012 | dsPIC30F4012 | dsPIC30F6012[A] | ||
dsPIC30F3013 | dsPIC30F4013 | dsPIC30F5013 | dsPIC30F6013[A] | ||
dsPIC30F3014 | dsPIC30F6014[A] | ||||
dsPIC30F5015 | dsPIC30F6015 | ||||
dsPIC30F5016 | |||||
dsPIC30F2020 | |||||
dsPIC30F2023 |
The following dsPIC33F GP devices are supported:
12K devices | 16K devices | 32K devices | 64K devices | 128K devices | 256K devices |
---|---|---|---|---|---|
dsPIC33FJ12GP201 | |||||
dsPIC33FJ12GP202 | dsPIC33FJ32GP202 | dsPIC33FJ64GP202 | dsPIC33FJ128GP202 | ||
dsPIC33FJ32GP204 | dsPIC33FJ64GP204 | dsPIC33FJ128GP204 | |||
dsPIC33FJ64GP206[A] | dsPIC33FJ128GP206[A] | ||||
dsPIC33FJ32GP302 | |||||
dsPIC33FJ16GP304 | dsPIC33FJ32GP304 | ||||
dsPIC33FJ64GP306[A] | dsPIC33FJ128GP306[A] | ||||
dsPIC33FJ64GP310[A] | dsPIC33FJ128GP310[A] | ||||
dsPIC33FJ256GP506[A] | |||||
dsPIC33FJ256GP510[A] | |||||
dsPIC33FJ64GP706[A] | dsPIC33FJ128GP706[A] | ||||
dsPIC33FJ64GP708[A] | dsPIC33FJ128GP708[A] | ||||
dsPIC33FJ64GP710[A] | dsPIC33FJ128GP710[A] | dsPIC33FJ256GP710[A] | |||
dsPIC33FJ64GP802 | dsPIC33FJ128GP802 | ||||
dsPIC33FJ64GP804 | dsPIC33FJ128GP804 |
The following dsPIC33F GS devices are supported:
6K devices | 16K devices | 32K devices | 64K devices |
---|---|---|---|
dsPIC33FJ06GS101 | |||
dsPIC33FJ06GS102 | |||
dsPIC33FJ06GS202 | |||
dsPIC33FJ16GS402 | |||
dsPIC33FJ16GS404 | |||
dsPIC33FJ32GS406 | dsPIC33FJ64GS406 | ||
dsPIC33FJ16GS502 | |||
dsPIC33FJ16GS504 | |||
dsPIC33FJ32GS606 | dsPIC33FJ64GS606 | ||
dsPIC33FJ32GS608 | dsPIC33FJ64GS608 | ||
dsPIC33FJ32GS610 | dsPIC33FJ64GS610 |
The following dsPIC33F MC devices are supported:
12K devices | 16K devices | 32K devices | 64K devices | 128K devices | 256K devices |
---|---|---|---|---|---|
dsPIC33FJ12MC201 | |||||
dsPIC33FJ12MC202 | dsPIC33FJ32MC202 | dsPIC33FJ64MC202 | dsPIC33FJ128MC202 | ||
dsPIC33FJ32MC204 | dsPIC33FJ64MC204 | dsPIC33FJ128MC204 | |||
dsPIC33FJ32MC302 | |||||
dsPIC33FJ16MC304 | dsPIC33FJ32MC304 | ||||
dsPIC33FJ64MC506[A] | dsPIC33FJ128MC506[A] | ||||
dsPIC33FJ64MC508[A] | |||||
dsPIC33FJ64MC510[A] | dsPIC33FJ128MC510[A] | dsPIC33FJ256MC510[A] | |||
dsPIC33FJ64MC706[A] | dsPIC33FJ128MC706[A] | ||||
dsPIC33FJ128MC708[A] | |||||
dsPIC33FJ64MC710[A] | dsPIC33FJ128MC710[A] | dsPIC33FJ256MC710[A] | |||
dsPIC33FJ64MC802 | dsPIC33FJ128MC802 | ||||
dsPIC33FJ64MC804 | dsPIC33FJ128MC804 |
The following 'virtual' devices are supported:
The 16-bit language tools are installed with the MPLAB IDE installer.
The following documents pertain to the 16-bit C compiler, these may be installed as part of the full product or downloaded from Microchip's Website:
We refer to these documents throughout this README in somewhat familiar terms.
Updates to these manuals, that have not made it into (virtual) print, can be found later in this README.
In addition to these manuals, a set of HTML documentation for peripheral and DSP libraries is also included. This documentation covers all supported devices, even if only a subset product is installed.
v3.23b is a part support fix release.
v3.23 is a bug fix release.
v3.22 is released in this form to keep in sync with the full language suite release.
v3.21 is released in this form to keep in sync with the full language suite release.
New section attributes for creating heap or stack allocations in source code. For example:
.section mystack,stack .space 512 .section myheap,heap .space 256
The stack attribute defines a section type, and is compatible with attribute modifiers address() and align().
The heap attribute defines a section type, and is compatible with attribute modifiers address(), xmemory, ymemory, and align().
New section attribute eds for allocating memory in extended data space on some future devices. The eds attribute modifies sections of type bss, data, and persist.
New section attribute page to indicate that a section must not cross a natural page boundary. It ensures that a single setting of the page register is sufficient to access the entire section. The page attribute modifies sections of type bss, data, persist, code, psv, and eedata. In the case of psv, the page attribute is redundant, since by definition sections of type psv avoid page boundaries.
New operator edspage() can be applied to symbols in data memory or program memory. It returns the page value that can be used to make the object visible in the extended data space window. edspage() always returns a 10-bit result.
New operator edsoffset() can be applied to symbols in data memory or program memory. It returns a 16-bit offset that can be used in combination with an object's page value. For objects located in the first 32K of data memory, edsoffset() returns the object's true address. For all other objects, it returns an address in the PSV or extended data space window.
Feature preprocessor definitions which can be used to identify special properties of the different 16-bit devices. Definitions such as __HAS_DSP can be tested by assembler preprocessor directives. A complete list of definitions may be found in chapter 5.9, "Predefined Symbols", in the Assembler manual.
The linker allocates variables in space(eds) on any page where memory is available. However, the linker will use extended RAM first, in order to preserve memory for the stack.
New linker script commands specify startup files. On some future devices PSVPAG is no longer used to access constants stored in program memory. On such devices the standard startup files can not be used. In order to support multiple startup files, new commands specify files appropriate for the target device. For example:
CRT0_STARTUP(crt0_standard.o) CRT1_STARTUP(crt1_standard.o)
These commands replace the EXTERN() commands which previously appeared near the top of linker scripts. See Migration Issues for more information.
Linker scripts are now pre-processed using the standard C pre-processor. Macros can be defined in the Build Options dialog of MPLAB IDE.
To accomodate future devices with extended data memory, the data initialization template has been modified to encode page numbers. For more information, see chapter 10.8, "Initialized Data", in the Linker manual.
Object files now contain signatures for the purpose of matching objects created with different compiler options. In the current release, objects loaded from libraries are selected to ensure consistent setting of the -mlarge-arrays option. Two new linker options have been added to control this feature:
--select-objects Select library objects based on options (default) --no-select-objects Don't select library objects based on options
The memory usage report (which appears in the map file as well as console output) has changed in two ways. First, sections marked noload will now appear in the report, and will count towards the total memory used. In the unusual case where two noload sections have been declared at the same address, the total memory value will be distorted.
Second, the Program Memory report will only show sections actually defined in memory region "program". Previously, the reset vector and interrupt vector tables were included in this section of the report. However, these sections are defined in separate memory regions, and their appearance in the report can be confusing since these sections are not really part of the application code, which is otherwise variable in size.
To clarify the second change, headings in the usage report now include the origin and length as defined in the linker script. For example:
Program Memory [Origin = 0x100, Length = 0x3ff00] section address length (PC units) length (bytes) (dec) ------- ------- ----------------- -------------------- .text 0x100 0x56e 0x825 (2085) .const 0x66e 0x6 0x9 (9) .dinit 0x674 0x82 0xc3 (195) .text 0x6f6 0xa 0xf (15) .isr 0x700 0x2 0x3 (3) Total program memory used (bytes): 0x903 (2307) <1%
The disassembly listing generated by pic30-objdump has been improved. Instead of representing the target address of branch and DO instructions as a PC-relative offset (using a "dot expression"), the absolute target address will be displayed. If a label at the target address can be identified, it will be displayed also. For example, a previous listing:
f8 ff 3a bra NZ, . + 0xFFFFFFF2 b8 ff 07 rcall . + 0xFFFFFF72
is now displayed as:
f8 ff 3a bra NZ, 0x4F4 <.L26> b8 ff 07 rcall 0x46C <_fclose>
The default stack guard band has been increased from 8 to 16 bytes, to adequately handle stack overflow exceptions that may occur from certain instruction sequences. The size of the guard band can also be specified with a new linker option. See Migration Issues for details.
This support update to version 3.10 includes updates to the following device files: dsPIC33FJ06GS101, dsPIC33FJ06GS102, dsPIC33FJ06GS202, dsPIC33FJ16GS402, dsPIC33FJ16GS404, dsPIC33FJ16GS502, and dsPIC33FJ16GS504
See Fixed Issues for additional updates.
This version includes support for 5 new devices: PIC24F04KA201, PIC24F08KA101, PIC24F08KA102, PIC24F16KA101, and PIC24F16KA102.
See Migration Issues for information about how existing projects may be affected.
.text : { *(.init); *(.user_init); *(.handle); *(.libc) *(.libm) *(.libdsp); /* keep together in this order */ *(.lib*); } >program
Linker scripts provided with v3.20 include new commands to specify start-up files for the target device. If these commands are not found, the linker will select default versions. Existing projects with custom linker scripts will function correctly for all current devices. However, the following warning messages may be displayed:
Warning: linker script did not specify CRT0_STARTUP file, default for this device: crt0_standard.o Warning: linker script did not specify CRT1_STARTUP file, default for this device: crt1_standard.o
To quiet these warnings, replace the two EXTERN() commands near the top of the linker script with:
CRT0_STARTUP(crt0_standard.o) CRT1_STARTUP(crt1_standard.o)
The tblpage() operator now returns a value with bit 8 set, even though the TBLPAG register implements bits 0-7 only. The extra bit allows for better code generation by the compiler. Existing projects should not be affected by this change, unless an assembly source file uses the tblpage() operator with a mov.b instruction. In that case, a "relocation truncated to fit" error may be reported. To resolve this problem, revise the assembly source to use a word sized instruction.
When the psvpage() operator is used with future devices that support extended data memory, a 10-bit value is returned. Assembly source files that use the psvpage() operator with a mov.b instruction should be modified to use a word sized instruction.
The C-runtime startup has been enhanced to support data initialization outside of the standard 32K data memory range. There are no migration issues for customers using devices released with prior versions of the tool chain. However, if you have included customized versions of the startup files you may wish to apply those enhancements for future devices. For more information, look in files crt0_standard.s and crt0_extended.s, which are contained within the libpic30 archive.
Because of changes to the startup file architecture, it is no longer possible to load a library startup module by calling __reset. If a custom startup file needs to invoke the standard startup file, copy crt0_standard.s to the project.
No significant migration issues have been identified. However, the format of link map files and disassembly listings has changed slightly (see What's New for details.) Custom tools or scripts which post-process such files may need modifications to accomodate these changes.
The default stack guard band has been increased from 8 to 16 bytes. This results in a corresponding decrease of usable stack space available to applications. To faciltiate the recovery of lost stack space, or to specify a larger guard band for non-trivial exception handlers, a new linker option has been added. For example, to restore stack allocation to match previous versions:
--stackguard=8
MPLAB IDE will report "File not found" for support files referenced by projects in the old locations. MPLAB IDE v8.10 or later provides an easy way to resolve such problems. Simply right-click on the missing project files and select "Locate Missing File" or "Remove". In most cases MPLAB IDE will locate the missing project file automatically. If the missing file is a standard linker script, then removing the file will suffice, since standard linker scripts are included automatically in MPLAB IDE v8.0 or later. If the missing file is a device-specific library, then removing the file will also suffice, since standard linker scripts now include peripheral libraries automatically.
The bin folder has also changed. Tools that are specific to the object file format have been moved to a lower level. This change should not impact existing projects, since these tools should always be invoked by the generic versions which are located in the standard location.
The linker's best-fit allocator will merge output sections with the same name whenever it is convenient to do so. This will change the memory usage report and link map. For example, several adjacent sections named .bss will now be merged into one.
Section .text will flow around section .const (or other psv sections) as necessary. To facilitate this new behaviour, the expression *(.text) has been removed from the definition of output section .text in linker scripts. This may change the organization of sections in program memory, since .text will now be allocated in multiple chunks if necessary. Existing projects which depend on a single .text section can revert to the previous behaviour by restoring the definition of output section .text.
None.
Previously, some addresses were invalid for the address attribute, notably those that are used for the .handle, .libc, .libm, .libdsp and other .lib sections. Sequential sections will now avoid functions with the address attribute.
Previously, applications with large amounts of auto_psv data could fail to link on certain devices, even though the total amount of memory used did not exceed the flash capacity. The new linker does a better job of allocating psv sections, including section .const. Also, input sections .text have been removed from linker scripts, allowing the best-fit allocator to flow them around psv sections as necessary.
In v3.0x, variables with an alignment requirement larger than their size consumed additional memory. This has been corrected.
The following example is not encoded correctly:
.equiv var1,root+1 .equiv var2,var1 .word var1 ; encodes root+1 .word var2 ; encodes root
This can happen when the value specified in .equiv is the name of an SFR high byte such as _LATBH, which is defined in the processor include files as an .equiv. The workaround in this case would be to refer to the base register itself, i.e. _LATB+1
The following assembly statements will cause a failure:
.equ foo,bar .equ baz,foo .word baz
In this example, bar is an undefined symbol, while foo and baz are indirect references to bar. The second level of indirection is causing the failure. The following sequences work fine:
.equ foo,bar .word foo ; one level of indirection .equ bar,9 .equ foo,bar .equ baz,foo .word baz ; two levels of indirection to a literal constant
If a linker script is modified to place the .text section from one object file before all the others, multiple definition errors can result. When this occurs the linker acts as if the section was included twice. The workaround is to specify a full pathname, or *, before the object file name:
/* ** User Code and Library Code */ .text : { *(.init); *(.user_init); *(.handle); *(.libc) *(.libm) *(.libdsp); /* keep together in this order */ *(.lib*); myfile.o(.text); /* this form causes error */ *myfile.o(.text); /* this form works OK */ } >program
As a work-around, use decimal values instead. For example:
--boot=flash_size=1024
The linker will not detect a mis-match of the -mlarge-arrays option among input files. As a work-around, place objects into a library before adding them to the project.
This installation makes no changes to the way environment variables have been updated previously.
Modified environment variables are identified as part of the installation procedure and are documented in the manuals.