Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Teensy 3.2 SPI DMA Transfer (DmaSpi example) SPI1 error

  1. #1

    Teensy 3.2 SPI DMA Transfer (DmaSpi example) SPI1 error

    I am using the DmaSpi (see link below) working on a Teensy 3.2, but getting this error message. It will complie for a 3.6 and LC, but I don't have one of these devices.

    Can this libarary use used for a 3.2, or is there a better way to manage SPI DMA transer on this Teensy 3.2 device?


    HTML Code:
    In file included from /Users/brendonshaw/Documents/Arduino/libraries/DmaSpi-master/DmaSpi.h:13:0,
                     from /var/folders/n1/rd3_rvgj30b48z_vjlbr376c0000gn/T/arduino_modified_sketch_499667/DMASpi_example1.ino:4:
    /Users/brendonshaw/Documents/Arduino/libraries/DmaSpi-master/ChipSelect.h: In member function 'virtual void ActiveLowChipSelect1::select()':
    /Users/brendonshaw/Documents/Arduino/libraries/DmaSpi-master/ChipSelect.h:104:7: error: 'SPI1' was not declared in this scope
           SPI1.beginTransaction(settings_);
           ^
    /Users/brendonshaw/Documents/Arduino/libraries/DmaSpi-master/ChipSelect.h: In member function 'virtual void ActiveLowChipSelect1::deselect()':
    /Users/brendonshaw/Documents/Arduino/libraries/DmaSpi-master/ChipSelect.h:113:7: error: 'SPI1' was not declared in this scope
           SPI1.endTransaction();
    ^
    Error compiling for board Teensy 3.2 / 3.1.



    https://github.com/crteensy/DmaSpi

  2. #2
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    247
    SPI1 with DMA is only supported on 3.5/3.6/4.0

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,752
    As Blackaddr mentioned, the Teensy 3.2 only has one SPI buss, as you can see on the hardware table: https://www.pjrc.com/teensy/techspecs.html
    As such SPI1 does not exist.

    However the issue is in his library that even if you only try to use SPI object his header file mentioned above uses SPI1.

    I have an outstanding Pull Request to add support for T4 against his library. I just pushed up a change to #if defined().../#endif out the
    SPI1 code in that header file so it compiles...

    That is now part of my Pull Request: https://github.com/crteensy/DmaSpi/pull/28
    Current code that is used in the PR: https://github.com/KurtE/DmaSpi/tree/T4

    As for what to use for DMA SPI... There is that code. Or depending on what you are wanting to do, the SPI library has code that does DMA.
    With the code like:
    Code:
    	bool transfer(const void *txBuffer, void *rxBuffer, size_t count,  EventResponderRef  event_responder);
    Or you can look through some of the different code pieces that do DMA, which use the dmachannel.h stuff out of core... Examples are my ILI9341_t3n library. I believe the latest release of Teensyduino, that maybe our background dma support for the ST7735/ST7789 displays may be included.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •