SPI Example code

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

Hi.

I am trying to compile the SPI example code (application note 32105), but get errors from avr32-gcc:

'avr32_spi_t' has no member named 'ptcr'

I simply typed 'make' in the Cygwin environment. The code is located in the /tmp dir. Updated both the toolchain and example code.

What am I doing wrong here?

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

If you are making a project for linux then use:
avr32-linux-gcc

else then you probably are missing some referance to the headers.

Maybe try the AVR32 General (standalone) forum as you probably are not using linux in this example :)

Life's to short for waiting on slow CPU's

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

Hmmm, I thought this appnote was updated. It does not compile because of a change in the toolchain headers. You need to remove all the PDC stuff in the appnote.

Hans-Christian

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

Thanks, it now compiles with avr32-linux-gcc as well as avr32-gcc. But before testing I would like to disable the LCD display in order to use the SPI externally, and also to save power consuption.

I tried to disable the LCD by commenting out the display code in the /etc/init.d/rcS file, the image disappeared but the power concuption did not change.

Is it recommended to use another SPI-driver for this purpose? Or a separate driver for controlling the LCD power state?

The application is supposed to run on Linux OS.

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

Eh... The example code in the application note is for _standalone_ development, you can not run it under Linux.

In Linux you need to use the SPI framework in the kernel.

Hans-Christian

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

Or from userspace you can use the scspi driver from http://avr32linux.org/twiki/bin/...

But yes, you certainly can't punch a hole through Linux and access the hardware directly, that defeats the purpose of the OS ;)

Oh and posts regarding dev in Linux should be in the Linux forum. Otherwise people will assume you are developing a stand alone app and give you wrong advice.

-S.