Page 1 of 1

SAM3S-EK Example Software and AT91 library Build Issues

Posted: Mon Oct 31, 2011 7:12 am
by E-Duluth
I have been steadily attempting for the past two weeks to complete a from source build of the AT91 peripheral library (libboard_sam3s-ek, libchip_sam3s, usb, memories, etc...) along with some of the simple examples. My environment is Windows 7 with several tools, including Yagarto, CodeSourcery (Lite and Pro), IAR EWARM (5.5 and 6.2), and Atollic TrueStudio.

I can reliably build simple examples from the 2.1 Software Package for EWARM 5.4 under IAR 5.5, but have not been successful in building the full peripheral library. Success with the various GCC tool chains has been mixed but none have been completely successful. Command line use of Yagarto and CS Lite produce the best results. One of the main problems is the library make files simply do not work correctly under windows. I have located the offending line of code in the make files, but have not determined how to correct the problem. The specific problem is with creating the ../../lib folder to hold the *.a files. This produces a folder named "....lib" in the current directory. I have worked around (not fixed) this problem.

My current issue is with compiling supc.c. All attempts at compiling this file with various compilers have all result in many errors associated with undefined externals which I assume are inline assembly macros. A list of these errors is included at the end of this post. I have attempted to locate these reference with a complete text search of the 2.1 Software Package without success.

Can someone point me in a direct for solving both the make file issue and these unresolved references?

List of supc.c compile errors:

supc.c: In function 'SUPC_EnableFlash':
supc.c:58:10: error: 'Supc' has no member named 'SUPC_FWUTR'
supc.c:59:50: error: 'AT91C_SUPC_FLASHON' undeclared (first use in this function)
supc.c:59:50: note: each undeclared identifier is reported only once for each function it appears in
supc.c:61:30: error: 'AT91C_SUPC_FLASHS' undeclared (first use in this function)
supc.c: In function 'SUPC_DisableFlash':
supc.c:72:52: error: 'AT91C_SUPC_FLASHON' undeclared (first use in this function)
supc.c:74:30: error: 'AT91C_SUPC_FLASHS' undeclared (first use in this function)
supc.c: In function 'SUPC_SetVoltageOutput':
supc.c:83:5: error: 'voltage' undeclared (first use in this function)
supc.c:83:5: error: 'AT91C_SUPC_VRVDD' undeclared (first use in this function)
supc.c: In function 'SUPC_EnableDeepMode':
supc.c:93:50: error: 'AT91C_SUPC_VRDEEP' undeclared (first use in this function)
supc.c: In function 'SUPC_DisableDeepMode':
supc.c:101:52: error: 'AT91C_SUPC_VRDEEP' undeclared (first use in this function)
supc.c: In function 'SUPC_EnableSram':
supc.c:110:50: error: 'AT91C_SUPC_SRAMON' undeclared (first use in this function)
supc.c: In function 'SUPC_DisableSram':
supc.c:118:52: error: 'AT91C_SUPC_SRAMON' undeclared (first use in this function)
supc.c: In function 'SUPC_EnableRtc':
supc.c:126:50: error: 'AT91C_SUPC_RTCON' undeclared (first use in this function)
supc.c:128:30: error: 'AT91C_SUPC_RTS' undeclared (first use in this function)
supc.c: In function 'SUPC_DisableRtc':
supc.c:136:52: error: 'AT91C_SUPC_RTCON' undeclared (first use in this function)
supc.c:138:30: error: 'AT91C_SUPC_RTS' undeclared (first use in this function)
supc.c: In function 'SUPC_SetBodSampling':
supc.c:147:5: error: 'AT91C_SUPC_BODSMPL' undeclared (first use in this function)
supc.c:149:10: error: 'Supc' has no member named 'SUPC_BOMR'
supc.c:150:10: error: 'Supc' has no member named 'SUPC_BOMR'
supc.c: In function 'SUPC_DisableVoltageRegulator':
supc.c:158:33: error: 'AT91C_SUPC_VROFF' undeclared (first use in this function)
supc.c: In function 'SUPC_Shutdown':
supc.c:168:33: error: 'AT91C_SUPC_SHDW' undeclared (first use in this function)

Re: SAM3S-EK Example Software and AT91 library Build Issues

Posted: Mon Mar 26, 2012 8:54 pm
by kshysio
i've also had a problems with this kit and the examples (not all of them works - for example mirrored font in keil LCD examples, or data storage errors during initialization). the solution to compile a libraries is to first create manualy folders "lib", then compile one after one libraries (memory, usb, board, chip etc.).
it would be best if all examples were available for the Atmel Studio...
Kshysio

Re: SAM3S-EK Example Software and AT91 library Build Issues

Posted: Wed Apr 18, 2012 11:35 am
by paranoid_android
E-duluth, I had the same problem with exactly the same files.
I wanted to port a SAM3S Software Package 2.1. for GNU (AT91SAM3S-EK GNU Software Package, 'SAM3S_softpack_2.1_for_CodeSourcery_2010q1') to a solution template in Atmel Studio.
Much like it's done with ASF, but since ASF (at least at the moment) lacks of some functionality present in Software Package, I decided to create a template solution that would contain all the libraries ready for compiling so that whenever I'd need to create a project I could copy the template and strip it off the unused libraries.
Anyway, as it was in your case, I couldn't compile supc.c.
I get such error (amongst many other):
''Supc' has no member named 'SUPC_FWUTR' D:\ARM\projects\SAM3S_software_pack_template\lib\libraries\libchip_sam3s\source\supc.c 58 10 SAM3S_software_pack_template'
So I checked the typedef for Supc and of course there's no such field there.
I started to dig deeper and it turned out that cortex-m3 doesn't have an FWUTR register (Flash Wake-up Timer Register). It's ARM7 that has it, so my assumption is that the package was combined of all libraries Atmel had, but some of them are not meant to be used with SAM3S chips.

I followed the one-library-at-a-time approach, commenting out all the problematic lines/macros/functions and I'm going to successfully build the whole package and compile some examples for SAM3S-EK.
I just hope that all of the examples in the package will one day be added to ASF.