#error "Need to define M2M_POINTER_SIZE_IN_BYTES"

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm trying to compile the WINC1500 driver in atmel studio and I'm running into this error saying 

"error "Need to define M2M_POINTER_SIZE_IN_BYTES"

 

I'm using the AT32UC3C1256C MCU and have it defined in the winc1500_driver_config.h file. I don't know how to solve this error, I've been following the instructions below to try getting the WINC1500 module to interface with the MCU. 

http://ww1.microchip.com/downloads/en/Appnotes/Adding-an-ATWINC15x0-Wi-Fi-Network-Controller-to-a-Microcontroller-Application-Application-Note-DS00002907B.pdf

 

 

// Set the size of host MCU pointer, in bytes.  Pointer sizes vary depending on the MCU 
// architecture.  The pointer size can be determined by executing the code: 
 //   int x = sizeof(int *);  
#if defined(__PIC32MX__) || defined(__PIC32MZ__)
    #define M2M_POINTER_SIZE_IN_BYTES     4
#elif defined(__C30__)
    #define M2M_POINTER_SIZE_IN_BYTES     2 //2
#elif defined(__XC8)
    #define M2M_POINTER_SIZE_IN_BYTES     3 
#elif defined(__SAMD21J18A__)
    #define M2M_POINTER_SIZE_IN_BYTES     4
#elif defined(__AT32UC3C1256C__)
    #define M2M_POINTER_SIZE_IN_BYTES     4    // 32 bit microcontroller, the pointer size is 4 bytes
#else    
    #error "Need to define M2M_POINTER_SIZE_IN_BYTES"
#endif

 

Last Edited: Mon. Dec 2, 2019 - 03:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
#elif defined(__AT32UC3C1256C__)
    #define M2M_POINTER_SIZE_IN_BYTES     4    // 32 bit microcontroller, the pointer size is 4 bytes
#else

The implication would seems to be that you got the macro name wrong. Are you SURE it is  AT32UC3C1256C  ??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sahil885 wrote:
"Need to define M2M_POINTER_SIZE_IN_BYTES"

So do that, then!

 

This really has nothing to do with Atmel Studio or AVR.

 

There is a specific forum for questions about the WiFi parts - including their supporting software:

 

802.11/Wi-Fi

 

A forum for hardware, software, and protocol discussions specifically related to 802.11.

 

https://community.atmel.com/foru...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
The implication would seems to be that you got the macro name wrong

Or haven't defined it at all ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
Or haven't defined it at all ?
I fear you misunderstand. This is not a define HE made. It's a define the compiler auto made. In the AVR8 world we -mmcu=atmega328p and the compiler internally defines __AVR_ATmega328P__. That is how <avr/io.h> actually works...

...
#elif defined (__AVR_ATmega3250P__)
#  include <avr/iom3250p.h>
#elif defined (__AVR_ATmega3250PA__)
#  include <avr/iom3250pa.h>  
#elif defined (__AVR_ATmega328P__)
#  include <avr/iom328p.h>
#elif (defined __AVR_ATmega328__)
#include <avr/iom328.h>
#elif defined (__AVR_ATmega329__)
#  include <avr/iom329.h>
#elif (defined __AVR_ATmega329A__)
...

I believe AVR32 may have some similar mechanism at work so a selection of UC3C1256 in the  build options somewhere ultimately leads to some __symbol_that_identifies_UC3C1256__ being defined. However I don't think it is  "__AT32UC3C1256C__"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
I fear you misunderstand. This is not a define HE made.

Yes, I do realise that.

 

I don't seem to have the AVR32 support in my Atmel Studio installation to try it (why would I?) - so OP is going to have to explore one of his working AVR32 projects to find what the definition actually is...

 

EDIT

 

I found this:  https://github.com/vegarwe/avr32/blob/master/common/include/avr32/io.h

 

#   elif (defined __AVR32_UC3C1128C__)
#      include <avr32/uc3c1128c.h>
#   elif (defined __AVR32_UC3C1256C__)
#      include <avr32/uc3c1256c.h>
#   elif (defined __AVR32_UC3C1512CREVC__)
#      include <avr32/uc3c1512crevc.h>

So it appears that the symbol is actually  __AVR32_UC3C1256C__

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Dec 2, 2019 - 10:04 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This doesn't really bode well for the compatibility of the rest of the code.

 

As noted previously, it is unlikely that the AVR32 parts of this will have been used much - the OP might even be the first user - so is likely to be having to do a lot of this kind of stuff...

 

https://www.avrfreaks.net/commen...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
There is a specific forum for questions about the WiFi parts - including their supporting software

and there are many threads on there about connecting "non-standard" hosts to the WINC; eg,

 

https://community.atmel.com/forum/winc1500-stm32f407

 

https://community.atmel.com/forum/arduino-atwinc1500

 

https://community.atmel.com/forum/porting-winc1500-stm32f4xx

 

so you might want to look into how they approached it ...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...