SAMV70: sleep.c provided with ASF 3.36.1 fails to compile

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

Hello!
I'm using Atmel Studio 7.0.1645 with ASF upgraded to version 3.36.1 
When building new project or upgrading the old one for SAMV70 controller i faced with many errors of compilation of the PMC driver:

Build started.
Project "SPI_XDMAC_EXAMPLE2.cproj" (Compile target(s)):
Target "Compile" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2.cproj" (entry point):
	Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe "src/ASF/sam/drivers/pmc/sleep.o"
		Building file: ../src/ASF/sam/drivers/pmc/sleep.c
		Invoking: ARM/GNU C Compiler : 6.3.1
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAMV70N20B__ -DBOARD=SAME70_XPLAINED -Dscanf=iscanf -DARM_MATH_CM7=true -Dprintf=iprintf -DDEBUG -DTEST_SUITE_DEFINE_ASSERT_MACRO -D_ASSERT_ENABLE_  -I"../src/ASF/sam/drivers/spi" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/common/services/clock" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/sam/drivers/xdmac" -I"../src/ASF/sam/boards/same70_xplained" -I"../src/ASF/sam/boards" -I"../src/ASF/common/boards" -I"../src/ASF/common/services/ioport" -I"../src/ASF/common/services/gpio" -I"../src/ASF/sam/drivers/pio" -I"../src/ASF/sam/drivers/mpu" -I"../src/ASF/sam/drivers/spi/spi_xdmac_example/same70q21_same70_xplained" -I"../src" -I"../src/config" -I"../src/ASF/common/services/delay" -I"../src/ASF/common/services/spi/sam_spi" -I"../src/ASF/common/services/spi" -I"../src/ASF/sam/drivers/qspi" -I"../src/ASF/sam/drivers/ssc" -I"..\..\..\..\..\Analog Devices\SigmaStudio 3.13\Projects\Sample Schematics\ADAU170x\Signal Flows\IC 1_Pre-Emphasis_Modulator" -I"../src/ASF/thirdparty/CMSIS/Include5" -I"../src/ASF/sam/utils/cmsis/samv70/include" -I"../src/ASF/sam/utils/cmsis/samv70/source/templates" -I"../src/ASF/sam/drivers/i2sc" -I"../src/ASF/common/services/sleepmgr" -I"../src/ASF/common/services/sleepmgr/sam"  -O1 -fdata-sections -ffunction-sections -mlong-calls -g2 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "src/ASF/sam/drivers/pmc/sleep.d" -MT"src/ASF/sam/drivers/pmc/sleep.d" -MT"src/ASF/sam/drivers/pmc/sleep.o"   -o "src/ASF/sam/drivers/pmc/sleep.o" "../src/ASF/sam/drivers/pmc/sleep.c"
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(280,8): error: unknown type name 'pmc_callback_wakeup_clocks_restored_t'
		 static pmc_callback_wakeup_clocks_restored_t callback_clocks_restored = NULL;
		        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(280,73): warning: initialization makes integer from pointer without a cast [-Wint-conversion]
		 static pmc_callback_wakeup_clocks_restored_t callback_clocks_restored = NULL;
		                                                                         ^~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(282,6): warning: no previous prototype for 'pmc_sleep' [-Wmissing-prototypes]
		 void pmc_sleep(int sleep_mode)
		      ^~~~~~~~~
		../src/ASF/sam/drivers/pmc/sleep.c: In function 'pmc_sleep':
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(285,7): error: 'SAM_PM_SMODE_SLEEP_WFI' undeclared (first use in this function)
		  case SAM_PM_SMODE_SLEEP_WFI:
		       ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(285,7): info: each undeclared identifier is reported only once for each function it appears in
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(286,7): error: 'SAM_PM_SMODE_SLEEP_WFE' undeclared (first use in this function)
		  case SAM_PM_SMODE_SLEEP_WFE:
		       ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(288,26): error: 'SCR_SLEEPDEEP' undeclared (first use in this function)
		   SCB->SCR &= (uint32_t)~SCR_SLEEPDEEP;
		                          ^~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(307,7): error: 'SAM_PM_SMODE_WAIT_FAST' undeclared (first use in this function)
		  case SAM_PM_SMODE_WAIT_FAST:
		       ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(308,7): error: 'SAM_PM_SMODE_WAIT' undeclared (first use in this function)
		  case SAM_PM_SMODE_WAIT: {
		       ^~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(352,4): error: called object 'callback_clocks_restored' is not a function or function pointer
		    callback_clocks_restored();
		    ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(280,46): info: declared here
		 static pmc_callback_wakeup_clocks_restored_t callback_clocks_restored = NULL;
		                                              ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(353,29): warning: assignment makes integer from pointer without a cast [-Wint-conversion]
		    callback_clocks_restored = NULL;
		                             ^
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(360,7): error: 'SAM_PM_SMODE_BACKUP' undeclared (first use in this function)
		  case SAM_PM_SMODE_BACKUP:
		       ^~~~~~~~~~~~~~~~~~~
		../src/ASF/sam/drivers/pmc/sleep.c: At top level:
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(375,6): warning: no previous prototype for 'pmc_is_wakeup_clocks_restored' [-Wmissing-prototypes]
		 bool pmc_is_wakeup_clocks_restored(void)
		      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\src\ASF\sam\drivers\pmc\sleep.c(381,3): error: unknown type name 'pmc_callback_wakeup_clocks_restored_t'
		   pmc_callback_wakeup_clocks_restored_t callback)
		   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Lexus\Documents\Atmel Studio\7.0\SPI_XDMAC_EXAMPLE2\SPI_XDMAC_EXAMPLE2\Release\Makefile(372,1): error: recipe for target 'src/ASF/sam/drivers/pmc/sleep.o' failed
		make: *** [src/ASF/sam/drivers/pmc/sleep.o] Error 1
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "Compile" in project "SPI_XDMAC_EXAMPLE2.cproj" -- FAILED.
Done building project "SPI_XDMAC_EXAMPLE2.cproj" -- FAILED.

Build FAILED.

After a couple of days i have found that there is an invisible mistake in the "sleep.h" provided by the ASF. At the very beginning of the file the option for SAMV70 is missed:

/* SAM3,SAM4,SAMG,SAMV,SAME and SAMS series */
#if (SAM3S || SAM3N || SAM3XA || SAM3U || SAM4S || SAM4E || SAM4N || SAM4C || \
		SAM4CM || SAM4CP || SAMG || SAMV71 || SAME70 || SAMS70 )

So to fix it one simply must add " || SAMV70 ":

/* SAM3,SAM4,SAMG,SAMV,SAME and SAMS series */
#if (SAM3S || SAM3N || SAM3XA || SAM3U || SAM4S || SAM4E || SAM4N || SAM4C || \
		SAM4CM || SAM4CP || SAMG || SAMV71 || SAME70 || SAMS70 || SAMV70)

 

Last Edited: Sun. Dec 3, 2017 - 05:59 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So to fix it one simply must add " || SAMV70 ":

and after you have done that, now it's working.?

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

beingmachine wrote:

So to fix it one simply must add " || SAMV70 ":

and after you have done that, now it's working.?

 

Yes! The project is built without errors and warnings.