Author Topic: Microchip TCPIP  (Read 16482 times)

0 Members and 1 Guest are viewing this topic.

Offline ChristopherTopic starter

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Microchip TCPIP
« on: December 23, 2013, 12:03:27 am »
I've got a simple stripboard setup with an ENC28j60 and a PIC32MX130F064B (All I had) which is all working OK so far.

Trying to compile the demo stack downloaded from MCP, I've literally got none of the features selected, a custom Main file, and with the HTTP Server example enabled it used 70k of flash!

The MCP site says it uses 10k max.. Is this normal or can I make it any smaller..??? I've got no room left for my program!
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12780
  • Country: nz
Re: Microchip TCPIP
« Reply #1 on: December 23, 2013, 12:10:43 am »
I've never used that chip/IDE/toolchain but just from what your saying i'm wondering if selecting/unselecting "features" may not be the same as removing them from the project.

Also check your compile options, maybe the compiler isn't doing any optimisations
« Last Edit: December 23, 2013, 12:13:00 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline ChristopherTopic starter

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Re: Microchip TCPIP
« Reply #2 on: December 23, 2013, 12:20:46 am »
Ive tried various optimisation levels on the compiler.

Selecting demo features is done by commenting out defines ~ so all of the crap i dont want is presumably taken out at compike time. I wonder if theres any webpages stored in flash ?

Normally id just say chuff it and get another pic with 4x the flash but im stuck with getting a prototype ready over christmas with the bits i have on hand.....
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14847
  • Country: gb
    • Mike's Electric Stuff
Re: Microchip TCPIP
« Reply #3 on: December 23, 2013, 12:22:06 am »
I think you need to specify a compiler option to make it not to link in procedures that aren't used.
And yes, that is totally brain-dead behaviour, especially when they provide loads of general-purpose libraries which nobody is going to use every part of.

I really wish Microchip would get their compilers up the standard of the likes of IAR.



Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14847
  • Country: gb
    • Mike's Electric Stuff
Re: Microchip TCPIP
« Reply #4 on: December 23, 2013, 12:23:26 am »
Take a look through the .map file to see where the memory is going - could well be that an HTTP demo has an image embedded in there somewhere
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30417
  • Country: nl
    • NCT Developments
Re: Microchip TCPIP
« Reply #5 on: December 23, 2013, 03:00:41 am »
Maybe the optimisation isn't on (optimisation may be crippled so look for generic GCC MIPS compiler with full optimisation) or like Mike said: check the mapfile.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline JTR

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: Microchip TCPIP
« Reply #6 on: December 23, 2013, 04:36:04 am »


The MCP site says it uses 10k max.. Is this normal or can I make it any smaller..??? I've got no room left for my program!

10K for a TCP/IP stack in a PIC32? Dream on...  If that was 10K machine instructions and not bytes well maybe...

 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Microchip TCPIP
« Reply #7 on: December 23, 2013, 08:04:26 am »
In the compiler options, enable "Isolate each function in a section" and "Generate 16-bit code". Also set the optimization level to 1, or s if your license allows it. In the linker options, enable "Remove unused sections" and "Generate 16-bit code".

Offline RoadRunner

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: de
Re: Microchip TCPIP
« Reply #8 on: December 23, 2013, 08:54:02 am »
Take a look through the .map file to see where the memory is going - could well be that an HTTP demo has an image embedded in there somewhere
as mike said.
i believe the demo is storing webpages at the flash itself. and the microchip site will only give you size for the stack not for webpages.
« Last Edit: December 23, 2013, 09:01:03 am by Gaurav »
 

Offline matkar

  • Regular Contributor
  • *
  • Posts: 153
  • Country: si
  • Sixty percent of the time it works EVERY time.
Re: Microchip TCPIP
« Reply #9 on: December 24, 2013, 07:27:17 pm »
As far as I remember I was able to strip the compiled stack to around 10k with UDP communication only and a static IP. I used PIC18F87K22. As soon as you start adding  TCP/IP, DHCP, HTTP... the numbers jump up quickly. Try it yourself by defining/undefining options. Beware that defining some options automatically defines other options as well.
I have just reopened the stack in MPLab. Here is an exaple of configuration settings from TCPIP ENC28.h file:

Code: [Select]
// =======================================================================
//   Application Options
// =======================================================================

/* Application Level Module Selection
 *   Uncomment or comment the following lines to enable or
 *   disabled the following high-level application modules.
 */
#define STACK_USE_UART // Application demo using UART for IP address display and stack configuration
//#define STACK_USE_UART2TCP_BRIDGE // UART to TCP Bridge application example
//#define STACK_USE_IP_GLEANING
#define STACK_USE_ICMP_SERVER // Ping query and response capability
//#define STACK_USE_ICMP_CLIENT // Ping transmission capability
//#define STACK_USE_HTTP2_SERVER // New HTTP server with POST, Cookies, Authentication, etc. 
//#define STACK_USE_SSL_SERVER // SSL server socket support (Requires SW300052)
//#define STACK_USE_SSL_CLIENT // SSL client socket support (Requires SW300052)
//#define STACK_USE_AUTO_IP               // Dynamic link-layer IP address automatic configuration protocol
//#define STACK_USE_DHCP_CLIENT // Dynamic Host Configuration Protocol client for obtaining IP address and other parameters
#define STACK_USE_DHCP_SERVER // Single host DHCP server
//#define STACK_USE_FTP_SERVER // File Transfer Protocol (old)
//#define STACK_USE_SMTP_CLIENT // Simple Mail Transfer Protocol for sending email
//#define STACK_USE_SNMP_SERVER // Simple Network Management Protocol v2C Community Agent
//#define STACK_USE_SNMPV3_SERVER // Simple Network Management Protocol v3 Agent
//#define STACK_USE_TFTP_CLIENT // Trivial File Transfer Protocol client
//#define STACK_USE_GENERIC_TCP_CLIENT_EXAMPLE // HTTP Client example in GenericTCPClient.c
//#define STACK_USE_GENERIC_TCP_SERVER_EXAMPLE // ToUpper server example in GenericTCPServer.c
//#define STACK_USE_TELNET_SERVER // Telnet server
//#define STACK_USE_ANNOUNCE // Microchip Embedded Ethernet Device Discoverer server/client
//#define STACK_USE_DNS // Domain Name Service Client for resolving hostname strings to IP addresses
//#define STACK_USE_DNS_SERVER // Domain Name Service Server for redirection to the local device
//#define STACK_USE_NBNS // NetBIOS Name Service Server for repsonding to NBNS hostname broadcast queries
//#define STACK_USE_REBOOT_SERVER // Module for resetting this PIC remotely.  Primarily useful for a Bootloader.
//#define STACK_USE_SNTP_CLIENT // Simple Network Time Protocol for obtaining current date/time from Internet
#define STACK_USE_UDP_PERFORMANCE_TEST // Module for testing UDP TX performance characteristics.  NOTE: Enabling this will cause a huge amount of UDP broadcast packets to flood your network on the discard port.  Use care when enabling this on production networks, especially with VPNs (could tunnel broadcast traffic across a limited bandwidth connection).
//#define STACK_USE_TCP_PERFORMANCE_TEST // Module for testing TCP TX performance characteristics
//#define STACK_USE_DYNAMICDNS_CLIENT // Dynamic DNS client updater module
//#define STACK_USE_BERKELEY_API // Berekely Sockets APIs are available
//#define STACK_USE_ZEROCONF_LINK_LOCAL // Zeroconf IPv4 Link-Local Addressing
//#define STACK_USE_ZEROCONF_MDNS_SD // Zeroconf mDNS and mDNS service discovery


// =======================================================================
//   Data Storage Options
// =======================================================================

/* MPFS Configuration
 *   MPFS is automatically included when required for other
 *   applications.  If your custom application requires it
 *   otherwise, uncomment the appropriate selection.
 */
//#define STACK_USE_MPFS2

/* MPFS Storage Location
 *   If html pages are stored in internal program memory,
 *   comment both MPFS_USE_EEPROM and MPFS_USE_SPI_FLASH, then
 *   include an MPFS image (.c or .s file) in the project.
 *   If html pages are stored in external memory, uncomment the
 *   appropriate definition.
 *
 *   Supported serial flash parts include the SST25VFxxxB series.
 */
//#define MPFS_USE_EEPROM
//#define MPFS_USE_SPI_FLASH

/* EEPROM Addressing Selection
 *   If using the 1Mbit EEPROM, uncomment this line
 */
//#define USE_EEPROM_25LC1024

/* EEPROM Reserved Area
 *   Number of EEPROM bytes to be reserved before MPFS storage starts.
 *   These bytes host application configurations such as IP Address,
 *   MAC Address, and any other required variables.
 *
 *   For MPFS Classic, this setting must match the Reserved setting
 * on the Advanced Settings page of the MPFS2 Utility.
 */
#define MPFS_RESERVE_BLOCK (137ul)

/* MPFS File Handles
 *   Maximum number of simultaneously open MPFS2 files.
 *   For MPFS Classic, this has no effect.
 */
#define MAX_MPFS_HANDLES (7ul)

With this configuration it compiles to 9897 words.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14847
  • Country: gb
    • Mike's Electric Stuff
Re: Microchip TCPIP
« Reply #10 on: December 24, 2013, 09:19:04 pm »
..of course if the compiler omitted unused code by default, you wouldn't need most of these configuration options - it would just only include stuff that gets called.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline JTR

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: Microchip TCPIP
« Reply #11 on: December 25, 2013, 01:11:03 pm »
As far as I remember I was able to strip the compiled stack to around 10k with UDP communication only and a static IP. I used PIC18F87K22.

PIC18 != PIC32. The comparison is pointless.
 

Offline matkar

  • Regular Contributor
  • *
  • Posts: 153
  • Country: si
  • Sixty percent of the time it works EVERY time.
Re: Microchip TCPIP
« Reply #12 on: December 25, 2013, 05:17:15 pm »
PIC18 != PIC32. The comparison is pointless.

Fair enough.

Now to be more fair I've tested space savings with two different options on a PIC32 uC as well. Here is my first configuration file:
Code: [Select]
// =======================================================================
//   Application Options
// =======================================================================

/* Application Level Module Selection
 *   Uncomment or comment the following lines to enable or
 *   disabled the following high-level application modules.
 */
//#define STACK_USE_UART                    // Application demo using UART for IP address display and stack configuration
//#define STACK_USE_UART2TCP_BRIDGE        // UART to TCP Bridge application example
//#define STACK_USE_IP_GLEANING
#define STACK_USE_ICMP_SERVER            // Ping query and response capability
#define STACK_USE_ICMP_CLIENT            // Ping transmission capability
#define STACK_USE_HTTP2_SERVER            // New HTTP server with POST, Cookies, Authentication, etc.
//#define STACK_USE_SSL_SERVER            // SSL server socket support (Requires SW300052)
//#define STACK_USE_SSL_CLIENT            // SSL client socket support (Requires SW300052)
#define STACK_USE_AUTO_IP               // Dynamic link-layer IP address automatic configuration protocol
#define STACK_USE_DHCP_CLIENT            // Dynamic Host Configuration Protocol client for obtaining IP address and other parameters
#define STACK_USE_DHCP_SERVER            // Single host DHCP server
//#define STACK_USE_FTP_SERVER            // File Transfer Protocol (old)
#define STACK_USE_SMTP_CLIENT            // Simple Mail Transfer Protocol for sending email
//#define STACK_USE_SNMP_SERVER            // Simple Network Management Protocol v2C Community Agent
//#define STACK_USE_SNMPV3_SERVER            // Simple Network Management Protocol v3 Agent
//#define STACK_USE_TFTP_CLIENT            // Trivial File Transfer Protocol client
#define STACK_USE_GENERIC_TCP_CLIENT_EXAMPLE    // HTTP Client example in GenericTCPClient.c
#define STACK_USE_GENERIC_TCP_SERVER_EXAMPLE    // ToUpper server example in GenericTCPServer.c
#define STACK_USE_TELNET_SERVER            // Telnet server
#define STACK_USE_ANNOUNCE                // Microchip Embedded Ethernet Device Discoverer server/client
#define STACK_USE_DNS                    // Domain Name Service Client for resolving hostname strings to IP addresses
//#define STACK_USE_DNS_SERVER            // Domain Name Service Server for redirection to the local device
#define STACK_USE_NBNS                    // NetBIOS Name Service Server for repsonding to NBNS hostname broadcast queries
#define STACK_USE_REBOOT_SERVER            // Module for resetting this PIC remotely.  Primarily useful for a Bootloader.
#define STACK_USE_SNTP_CLIENT            // Simple Network Time Protocol for obtaining current date/time from Internet
//#define STACK_USE_UDP_PERFORMANCE_TEST    // Module for testing UDP TX performance characteristics.  NOTE: Enabling this will cause a huge amount of UDP broadcast packets to flood your network on the discard port.  Use care when enabling this on production networks, especially with VPNs (could tunnel broadcast traffic across a limited bandwidth connection).
#define STACK_USE_TCP_PERFORMANCE_TEST    // Module for testing TCP TX performance characteristics
//#define STACK_USE_DYNAMICDNS_CLIENT        // Dynamic DNS client updater module
#define STACK_USE_BERKELEY_API            // Berekely Sockets APIs are available
//#define STACK_USE_ZEROCONF_LINK_LOCAL    // Zeroconf IPv4 Link-Local Addressing
//#define STACK_USE_ZEROCONF_MDNS_SD        // Zeroconf mDNS and mDNS service discovery

Compile size was 45853 words.

I've changed the config file (which is almost identical to my config file for PIC18 uC in my previous reply) to:

Code: [Select]
// =======================================================================
//   Application Options
// =======================================================================

/* Application Level Module Selection
 *   Uncomment or comment the following lines to enable or
 *   disabled the following high-level application modules.
 */
//#define STACK_USE_UART                    // Application demo using UART for IP address display and stack configuration
//#define STACK_USE_UART2TCP_BRIDGE        // UART to TCP Bridge application example
//#define STACK_USE_IP_GLEANING
#define STACK_USE_ICMP_SERVER            // Ping query and response capability
//#define STACK_USE_ICMP_CLIENT            // Ping transmission capability
//#define STACK_USE_HTTP2_SERVER            // New HTTP server with POST, Cookies, Authentication, etc.
//#define STACK_USE_SSL_SERVER            // SSL server socket support (Requires SW300052)
//#define STACK_USE_SSL_CLIENT            // SSL client socket support (Requires SW300052)
//#define STACK_USE_AUTO_IP               // Dynamic link-layer IP address automatic configuration protocol
//#define STACK_USE_DHCP_CLIENT            // Dynamic Host Configuration Protocol client for obtaining IP address and other parameters
#define STACK_USE_DHCP_SERVER            // Single host DHCP server
//#define STACK_USE_FTP_SERVER            // File Transfer Protocol (old)
//#define STACK_USE_SMTP_CLIENT            // Simple Mail Transfer Protocol for sending email
//#define STACK_USE_SNMP_SERVER            // Simple Network Management Protocol v2C Community Agent
//#define STACK_USE_SNMPV3_SERVER            // Simple Network Management Protocol v3 Agent
//#define STACK_USE_TFTP_CLIENT            // Trivial File Transfer Protocol client
//#define STACK_USE_GENERIC_TCP_CLIENT_EXAMPLE    // HTTP Client example in GenericTCPClient.c
//#define STACK_USE_GENERIC_TCP_SERVER_EXAMPLE    // ToUpper server example in GenericTCPServer.c
//#define STACK_USE_TELNET_SERVER            // Telnet server
//#define STACK_USE_ANNOUNCE                // Microchip Embedded Ethernet Device Discoverer server/client
//#define STACK_USE_DNS                    // Domain Name Service Client for resolving hostname strings to IP addresses
//#define STACK_USE_DNS_SERVER            // Domain Name Service Server for redirection to the local device
//#define STACK_USE_NBNS                    // NetBIOS Name Service Server for repsonding to NBNS hostname broadcast queries
//#define STACK_USE_REBOOT_SERVER            // Module for resetting this PIC remotely.  Primarily useful for a Bootloader.
//#define STACK_USE_SNTP_CLIENT            // Simple Network Time Protocol for obtaining current date/time from Internet
#define STACK_USE_UDP_PERFORMANCE_TEST    // Module for testing UDP TX performance characteristics.  NOTE: Enabling this will cause a huge amount of UDP broadcast packets to flood your network on the discard port.  Use care when enabling this on production networks, especially with VPNs (could tunnel broadcast traffic across a limited bandwidth connection).
//#define STACK_USE_TCP_PERFORMANCE_TEST    // Module for testing TCP TX performance characteristics
//#define STACK_USE_DYNAMICDNS_CLIENT        // Dynamic DNS client updater module
//#define STACK_USE_BERKELEY_API            // Berekely Sockets APIs are available
//#define STACK_USE_ZEROCONF_LINK_LOCAL    // Zeroconf IPv4 Link-Local Addressing
//#define STACK_USE_ZEROCONF_MDNS_SD        // Zeroconf mDNS and mDNS service discovery

and compile size dropped to 7801 words.

I want to point out that substantial space savings can be achieved by carefully selecting only modules you really need in your project.

 

Offline JTR

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: Microchip TCPIP
« Reply #13 on: December 26, 2013, 02:39:13 am »

and compile size dropped to 7801 words.

I want to point out that substantial space savings can be achieved by carefully selecting only modules you really need in your project.

That seems reasonable. 7801 words  = 31204 bytes.

What would be really interesting is seeing the same done for the PIC24. Somehow I think it will use about half of what the PIC32 did.
 

Offline SirDan

  • Contributor
  • Posts: 29
  • Country: ca
  • Spell binding guitar solos
    • Voltage Divider CA
Re: Microchip TCPIP
« Reply #14 on: December 30, 2013, 12:48:17 am »

and compile size dropped to 7801 words.

I want to point out that substantial space savings can be achieved by carefully selecting only modules you really need in your project.

That seems reasonable. 7801 words  = 31204 bytes.

What would be really interesting is seeing the same done for the PIC24. Somehow I think it will use about half of what the PIC32 did.

Just to clarify. 7801 words = 15602 bytes because a word = 2 bytes. 7801 dwords = 31204 bytes because a dword = 4 bytes.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30417
  • Country: nl
    • NCT Developments
Re: Microchip TCPIP
« Reply #15 on: December 30, 2013, 01:28:50 am »
..of course if the compiler omitted unused code by default, you wouldn't need most of these configuration options - it would just only include stuff that gets called.
That could get messy with interrupt handlers, functions which are getting called through tables with function pointers or are mapped into a section with a fixed address.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline JTR

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: Microchip TCPIP
« Reply #16 on: December 30, 2013, 05:29:20 am »

Just to clarify. 7801 words = 15602 bytes because a word = 2 bytes. 7801 dwords = 31204 bytes because a dword = 4 bytes.

An instruction word on a PIC32 is 4 bytes. Please anyone, feel free to post a working TCP/IP stack for the PIC32 written in C that fits in 15k bytes.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30417
  • Country: nl
    • NCT Developments
Re: Microchip TCPIP
« Reply #17 on: December 30, 2013, 11:22:22 am »

Just to clarify. 7801 words = 15602 bytes because a word = 2 bytes. 7801 dwords = 31204 bytes because a dword = 4 bytes.

An instruction word on a PIC32 is 4 bytes. Please anyone, feel free to post a working TCP/IP stack for the PIC32 written in C that fits in 15k bytes.
Look for uIP. AFAIK PIC32 also has a 16 bit instruction set just like ARM's thumb. I managed to get a TCP/IP stack (uip), BSD socket layer interface, http client, http server, DHCP, DNS a proprietary protocol and some meaningful software into 32kB of flash on ARM. I probably could make it smaller (the BSD socket interface was about as big as uIP) but I liked the convenience of the BSD socket layer to be able to re-use exisiting software and develop parts the software on a PC first.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline JTR

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: Microchip TCPIP
« Reply #18 on: December 30, 2013, 01:48:17 pm »

Look for uIP. AFAIK PIC32 also has a 16 bit instruction set just like ARM's thumb. I managed to get a TCP/IP stack (uip), BSD socket layer interface, http client, http server, DHCP, DNS a proprietary protocol and some meaningful software into 32kB of flash on ARM. I probably could make it smaller (the BSD socket interface was about as big as uIP) but I liked the convenience of the BSD socket layer to be able to re-use exisiting software and develop parts the software on a PC first.

I am well aware of the MIP16e instruction set on the PIC32. I have written a USB stack and bootloader that fits into the 3K bootblock with room (maybe) for a debugger as well. Prior to that I tried with 32-bit assembler and also with C using the MIP16e option. I think I have a good understanding of what a memory hog the PIC32 can be. It is a pig when the most common data unit is a byte as it is for TCP/IP and USB.

While I have not written code for the ARM my understanding is that PIC32 != ARM when it comes to code size.

If anyone really has a real world TCP/IP stack for the PIC32 that fits within 15kB I sure would like to see it.

(BTW, Not saying that it cannot be done just I seriously doubt that it has been done. There are very few "suckers" like me who get right down to the bare metal and scrooge over every instruction. The tool set just is not friendly for that sort of nth degree coding...)

 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14847
  • Country: gb
    • Mike's Electric Stuff
Re: Microchip TCPIP
« Reply #19 on: December 30, 2013, 03:50:40 pm »
On the subject of code size, does anyone have a feel for how much better the paid version of Microchip C32 is compared to the free version?
I've done a few PIC32 projects with the free one, which although not using much code, have been fairly speed-sensitive, and not found speed to be a major problem. If anything, limitations in the PIC32MX1xx hardware have been worse, like not implementing shadow registers  and poor UART FIFO implementation.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30417
  • Country: nl
    • NCT Developments
Re: Microchip TCPIP
« Reply #20 on: December 30, 2013, 04:00:24 pm »
This thread on Microchip's website pretty much answers that:
http://www.microchip.com/forums/m481688.aspx
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: Microchip TCPIP
« Reply #21 on: December 30, 2013, 04:20:21 pm »
On the subject of code size, does anyone have a feel for how much better the paid version of Microchip C32 is compared to the free version?
I've done a few PIC32 projects with the free one, which although not using much code, have been fairly speed-sensitive, and not found speed to be a major problem. If anything, limitations in the PIC32MX1xx hardware have been worse, like not implementing shadow registers  and poor UART FIFO implementation.
Can't you install with the 60 day trial to find out? Maybe on a virtual machine, dunno if the activation/licensing scheme cares about that.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14847
  • Country: gb
    • Mike's Electric Stuff
Re: Microchip TCPIP
« Reply #22 on: December 30, 2013, 04:34:03 pm »
On the subject of code size, does anyone have a feel for how much better the paid version of Microchip C32 is compared to the free version?
I've done a few PIC32 projects with the free one, which although not using much code, have been fairly speed-sensitive, and not found speed to be a major problem. If anything, limitations in the PIC32MX1xx hardware have been worse, like not implementing shadow registers  and poor UART FIFO implementation.
Can't you install with the 60 day trial to find out? Maybe on a virtual machine, dunno if the activation/licensing scheme cares about that.
I could - just wondered if anyone else already had
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: Microchip TCPIP
« Reply #23 on: December 30, 2013, 05:20:44 pm »
On the subject of code size, does anyone have a feel for how much better the paid version of Microchip C32 is compared to the free version?
I've done a few PIC32 projects with the free one, which although not using much code, have been fairly speed-sensitive, and not found speed to be a major problem. If anything, limitations in the PIC32MX1xx hardware have been worse, like not implementing shadow registers  and poor UART FIFO implementation.
Can't you install with the 60 day trial to find out? Maybe on a virtual machine, dunno if the activation/licensing scheme cares about that.
I could - just wondered if anyone else already had
The results on your code would be more useful to you.

The differences from a PIC24 project built with XC1.20 with -Os and -O1 optimization levels
Code: [Select]
-Os
section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200              0x1878          0x24b4  (9396)
.text                       0x3958              0x16fc          0x227a  (8826)

-O1
section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200              0x1b0a          0x288f  (10383)
.text                       0x3bea              0x1892          0x24db  (9435)




 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Microchip TCPIP
« Reply #24 on: December 30, 2013, 09:19:35 pm »
While I have not written code for the ARM my understanding is that PIC32 != ARM when it comes to code size.
MIPS32 is comparable in size to "full" ARM, but the newer Cortex-M cores use a more compact 16/32-bit instruction encoding called Thumb-2, which in my tests produces maybe 30% smaller binaries. The new Microchip PIC32MZ MCUs use a similar compact instruction encoding called microMIPS, which produces similarly-sized binaries as Thumb-2.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->