- Notifications
You must be signed in to change notification settings - Fork1k
fix: Cygnet USER_BTN mapping#2530
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
42e0262
intostm32duino:mainUh oh!
There was an error while loading.Please reload this page.
zfields commentedOct 7, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fpistm I noticed when I was testing that I was limited to approximately 10 interrupts running simultaneously. Would this be expected behavior, or do I need to further improve my board definition? This is the sketch I was using to test: |
Hi@zfields |
/* FeatherGpio_DigitalRead_Interrupt.ino - Feather GPIO Digital Read Interrupt Test Used to test the configuration of new boards added to the STM32 core. modified 31 May 2024 by Zachary J. Fields*/staticbool a0 =false;staticbool a1 =false;staticbool a2 =false;staticbool a3 =false;staticbool a4 =false;staticbool a5 =false;staticbool d5 =false;staticbool d6 =false;staticbool d9 =false;staticbool d10 =false;staticbool d11 =false;staticbool d12 =false;staticbool d13 =false;staticbool user_btn =false;HardwareSerialstlinkSerial(PIN_VCP_RX, PIN_VCP_TX);voidISR_a0 (void) { a0 =true;}voidISR_a1 (void) { a1 =true;}voidISR_a2 (void) { a2 =true;}voidISR_a3 (void) { a3 =true;}voidISR_a4 (void) { a4 =true;}voidISR_a5 (void) { a5 =true;}voidISR_d5 (void) { d5 =true;}voidISR_d6 (void) { d6 =true;}voidISR_d9 (void) { d9 =true;}voidISR_d10 (void) { d10 =true;}voidISR_d11 (void) { d11 =true;}voidISR_d12 (void) { d12 =true;}voidISR_d13 (void) { d13 =true;}voidISR_user_btn (void) { user_btn =true;}// the setup function runs once when you press reset or power the boardvoidsetup() {// Initialize pins for GPIO TestspinMode(A0, INPUT_PULLUP);pinMode(A1, INPUT_PULLUP);pinMode(A2, INPUT_PULLUP);pinMode(A3, INPUT_PULLUP);pinMode(A4, INPUT_PULLUP);pinMode(A5, INPUT_PULLUP);pinMode(D5, INPUT_PULLUP);pinMode(D6, INPUT_PULLUP);pinMode(D9, INPUT_PULLUP);pinMode(D10, INPUT_PULLUP);pinMode(D11, INPUT_PULLUP);pinMode(D12, INPUT_PULLUP);pinMode(D13, INPUT_PULLUP);pinMode(USER_BTN, INPUT_PULLUP);// Attach InterruptsattachInterrupt(digitalPinToInterrupt(A0), ISR_a0, RISING);attachInterrupt(digitalPinToInterrupt(A1), ISR_a1, RISING);attachInterrupt(digitalPinToInterrupt(A2), ISR_a2, RISING);attachInterrupt(digitalPinToInterrupt(A3), ISR_a3, RISING);attachInterrupt(digitalPinToInterrupt(A4), ISR_a4, RISING);attachInterrupt(digitalPinToInterrupt(A5), ISR_a5, RISING);attachInterrupt(digitalPinToInterrupt(D5), ISR_d5, RISING);attachInterrupt(digitalPinToInterrupt(D6), ISR_d6, RISING);attachInterrupt(digitalPinToInterrupt(D9), ISR_d9, RISING);attachInterrupt(digitalPinToInterrupt(D10), ISR_d10, RISING);attachInterrupt(digitalPinToInterrupt(D11), ISR_d11, RISING);attachInterrupt(digitalPinToInterrupt(D12), ISR_d12, RISING);attachInterrupt(digitalPinToInterrupt(D13), ISR_d13, RISING);attachInterrupt(digitalPinToInterrupt(USER_BTN), ISR_user_btn, RISING);// Initialize the LPUART for logging stlinkSerial.begin(115200);constsize_t stlinkSerial_timeout_ms =3000;for (constsize_t start_ms =millis(); !stlinkSerial && (millis() - start_ms) < stlinkSerial_timeout_ms;);// Provide a visual indication a catastrophic failure has occurredif (!stlinkSerial) {pinMode(LED_BUILTIN, OUTPUT);while (true) {digitalWrite(LED_BUILTIN, HIGH);delay(100);digitalWrite(LED_BUILTIN, LOW);delay(100); }; } stlinkSerial.println("Running Feather GPIO Digital Read Interrupt Test");}// the loop function runs over and over again forevervoidloop() {// Check for pin A0 interruptif (a0) {delay(100); a0 =false; stlinkSerial.println("A0: Interrupt"); }// Check for pin A1 interruptif (a1) {delay(100); a1 =false; stlinkSerial.println("A1: Interrupt"); }// Check for pin A2 interruptif (a2) {delay(100); a2 =false; stlinkSerial.println("A2: Interrupt"); }// Check for pin A3 interruptif (a3) {delay(100); a3 =false; stlinkSerial.println("A3: Interrupt"); }// Check for pin A4 interruptif (a4) {delay(100); a4 =false; stlinkSerial.println("A4: Interrupt"); }// Check for pin A5 interruptif (a5) {delay(100); a5 =false; stlinkSerial.println("A5: Interrupt"); }// Check for pin D5 interruptif (d5) {delay(100); d5 =false; stlinkSerial.println("D5: Interrupt"); }// Check for pin D6 interruptif (d6) {delay(100); d6 =false; stlinkSerial.println("D6: Interrupt"); }// Check for pin D9 interruptif (d9) {delay(100); d9 =false; stlinkSerial.println("D9: Interrupt"); }// Check for pin D10 interruptif (d10) {delay(100); d10 =false; stlinkSerial.println("D10: Interrupt"); }// Check for pin D11 interruptif (d11) {delay(100); d11 =false; stlinkSerial.println("D11: Interrupt"); }// Check for pin D12 interruptif (d12) {delay(100); d12 =false; stlinkSerial.println("D12: Interrupt"); }// Check for pin D13 interruptif (d13) {delay(100); d13 =false; stlinkSerial.println("D13: Interrupt"); }// Check for USER_BTN interruptif (user_btn) {delay(100); user_btn =false; stlinkSerial.println("USER_BTN: Interrupt"); }} |
Hi@zfields
So as you can see you expect 14 isr handler but only 11 are called. |
@fpistm Thank you for your thorough answer. I love your chips and I love learning deeper about them. I really do appreciate your time. Next time I will open a discussion. 👍 |
We made hardware modifications to the Cygnet dev kit to support deep sleep. The following changes reflect those updates.