ATSAMD21G17L with SERCOM I2C fails to compile

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

I am getting compiler errors with a new empty ASF project. Simply adding the SERCOM I2C driver (master/callback) results in a compiler errors:

Error        'PINMUX_PA00D_SERCOM1_PAD0' undeclared (first use in this function)    Test    C:\Test\src\ASF\sam0\drivers\sercom\sercom_pinout.h    579
Error        'PINMUX_PA01D_SERCOM1_PAD1' undeclared (first use in this function)    Test    C:\Test\src\ASF\sam0\drivers\sercom\sercom_pinout.h    580

 

PINMUX_PA00D_SERCOM1_PAD0 is not defined in the samd21g17l.h file, it is there for the 'd' variant. This only seems to happen with the "L" variant. "D" compiles without errors.

 

This issue can be replicated by creating an ASF board project and adding SERCOM I2C Master (callback) and compiling.

The error occurs with ASF V3.47 and 3.50.0. I am using Microchip Studio V7.0.2542.

This topic has a solution.
Last Edited: Tue. Jul 13, 2021 - 11:37 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes a needed check for this part is missing in sercom_pinout.h 

    /* SERCOM1 */
#if SAM_PART_IS_DEFINED(SAMD21G15L) || SAM_PART_IS_DEFINED(SAMD21G16L) || SAM_PART_IS_DEFINED(SAMD21G17L)
    #define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
    #define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
    #define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
    #define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
#else
    #define SERCOM1_PAD0_DEFAULT      PINMUX_PA00D_SERCOM1_PAD0
    #define SERCOM1_PAD1_DEFAULT      PINMUX_PA01D_SERCOM1_PAD1
    #define SERCOM1_PAD2_DEFAULT      PINMUX_PA30D_SERCOM1_PAD2
    #define SERCOM1_PAD3_DEFAULT      PINMUX_PA31D_SERCOM1_PAD3
#endif

/Lars

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

Thanks Lars, Microchip confirmed this was missing from the header file.