Skip to content

using SPI causes IllegalInstruction exception #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
elFallino opened this issue Nov 15, 2016 · 4 comments
Closed

using SPI causes IllegalInstruction exception #52

elFallino opened this issue Nov 15, 2016 · 4 comments

Comments

@elFallino
Copy link

I try to get Adafruits ILI9341 TFT library working.
I found that SPI seems not to work and could track it down to the call of pinMatrixOutAttach in esp32_hal_spi.c

Arduino sketch:


#include "SPI.h"

#define TFT_DC 9
#define TFT_CS 11
#define TFT_MOSI 8
#define TFT_CLK 6
#define TFT_RST 10
#define TFT_MISO 7

void setup() {
  Serial.begin(115200);
  
  Serial.println("creating object");
  SPIClass myspi = SPIClass();    //Does not matter if using HSPI, VSPI or FSPI

  Serial.println("calling begin()");
  myspi.begin(TFT_CLK, TFT_MISO, TFT_MOSI, TFT_CS);

  Serial.println("end successful");
}

void loop() {
}

Error on the ESP32:

[...]
load:0x40080000,len:260
entry 0x40080034
rtc v118 Oct 19 2016 15:22:11
XTAL 40M
creating object
calling begin()
Guru Meditation Error of type IllegalInstruction occurred on core   1. Exception was unhandled.
Register dump:
PC      :  400d05a2  PS      :  00060630  A0      :  800d053f  A1      :  3ffb68d0  
A2      :  00000002  A3      :  00000006  A4      :  3ff640bc  A5      :  00000000  
A6      :  3ff64000  A7      :  00000000  A8      :  800d0594  A9      :  3ffb68b0  
A10     :  00000026  A11     :  00000008  A12     :  00000000  A13     :  00000000  
A14     :  3ffb3540  A15     :  3ffb3508  SAR     :  0000001a  EXCCAUSE:  00000000  
EXCVADDR:  00000000  LBEG    :  400d404d  LEND    :  400d405d  LCOUNT  :  ffffffff  
CPU halted.

Chain of method calls as far as I tracked it:
1: In sketch: myspi.begin()
2: SPi.cpp (method SPIClass::begin): spiAttachSCK()
3: esp32-hal-spi.c (method spiAttachSCK): pinMatrixOutAttach()

I am using Arduino 1.6.12 and the esp32-arduino plugin from today, Nov 15th.

Let me know if i can provide more information.

@ladyada
Copy link
Contributor

ladyada commented Nov 16, 2016

btw the library totally works with default SPI device - was commited and tested with esp32 feather + ili9341 featherwing - slow but works :)

adafruit/Adafruit_ILI9341@51934bd

@elFallino
Copy link
Author

The same changes I did, too. It compiles well but fails for the same reason. So I tried to track down the point that seems to cause that.

@me-no-dev
Copy link
Member

well :) you are using the SPI flash pins to attach your LCD ;) that will surely mess things up :)

@elFallino
Copy link
Author

Oh damn, my fault. ;)
Had the opinion that I could do so as long as CS selects the right one.
Selecting other pins than the FSPI ones does fine.
Thank you.

Lzw655 pushed a commit to Lzw655/arduino-esp32 that referenced this issue Oct 12, 2023
brentru pushed a commit to adafruit/arduino-esp32 that referenced this issue Oct 22, 2024
* Added HalloWing M4 to Arcade Platforms

* Added Adafruit CircuitPlayground Express and Bluefruit

* Removed commas. It didn't like that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants