Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SimplePublish for SAM C21 Xplained Pro

...

Note

Windows is the only supported OS for the latest Atmel Studio 7.

Tip

ASF is included in Atmel Studio 7 and does not require a specific download, but you can use the Extension Manager (Tools->Extension Manager) to update it.

Prepare the SAM C21 Xplained Pro

...

Navigate to the SimplePublish example directory at examples/samc21_xplained_pro/SimplePublish/SimplePublish  and open the SimplePublish.atsln solution file in Atmel Studio 7. This should open the project with everything set up for you. Since the Xplained Pro has an embedded debugger, you do not have to select any tool: Atmel Studio should detect that the board is connected via USB.

Note

The Atmel Studio project expects to find the sm_clib and sm_qsl as they appear in the Directory Structure. If you chose the zip download or subversion checkout, the sm_clib/ directory from the separate unzipped folder/svn checkout need to be copied into the QSL repository to achieve the same structure.

Now, simply press the  symbol (Ctrl+Alt+F5) to compile and run the program, and you should see prints appearing on the debug terminal you opened.

...

Table 9: ASF modules used in the SimplePublish example code.

Add Platform Specific Files (as Copy)


  1. In the Soution Explorer window (right side), right click the folder src > Add > Existing Item...
    Image Added
  2. Navigate to the SimplePublish example source directory: examples/samc21_xplained_pro/SimplePublish/src/
  3. Select all the .c files and press Add (you do not need to add asf.h).
  4. Press Ok to overwrite the default main.c file.

Add QSL and C Library Files (as Link)

  1. In the Soution Explorer window (right side), right click the folder src > Add > New Folder
  2. Name it sm_clib
  3. Right click the folder you just created > Add > Existing Item...
  4. Navigate to the C Library directory in the repository: sm_clib/sm_clib/
  5. Select all the .c and .h files, except those for the manager/wireless heart:
    dn_ipmg.c/.h
    dn_serial_mg.c/.h
    dn_whmt.c/.h
  6.  Click the down-arrow next to Add and select Add As Link
    Image Added 
  7. Repeat the same steps with an sm_qsl folder for the QSL (but this time, add everything in sm_qsl/)

Add QSL and C Library Directories to Toolchain

  1. In the Soution Explorer window (right side), right click your project > Properties (Alt+F7)
  2. Toolchain > ARM/GNU C Compiler > Directories
  3. Press the Image Added icon and then the (...) button
  4. Again browse to the C Library in the repository: sm_clib/sm_clib/ and press Select Folder

    Note

    Make sure that you add a relative path to sm_clib/sm_clib/ and not just the top sm_clib/ directory.

     

  5. Press OK.

  6. Repeat the previous steps for the QSL in the repository: sm_qsl/

  7. Press Ctrl+S to save your changes

Create folder

Add as link

Add to Directories in Toolchain

Restart Atmel Studio (Directory Bug...)

Add Platform Specific Files

Add as copy

Make necessary adaptations