Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
fpistm merged 1 commit intostm32duino:mainfromzfields:cygnet-v1.2
Oct 7, 2024
Merged

Conversation

zfields
Copy link
Contributor

We made hardware modifications to the Cygnet dev kit to support deep sleep. The following changes reflect those updates.

@fpistmfpistm added the enhancementNew feature or request labelOct 7, 2024
@fpistmfpistm added this to the2.9.0 milestoneOct 7, 2024
@fpistmfpistm self-requested a reviewOctober 7, 2024 09:15
@fpistmfpistm merged commit42e0262 intostm32duino:mainOct 7, 2024
24 checks passed
@zfieldszfields deleted the cygnet-v1.2 branchOctober 7, 2024 14:38
@zfields
Copy link
ContributorAuthor

zfields commentedOct 7, 2024
edited
Loading

@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:
https://github.com/blues/feather-verification-tests/blob/master/FeatherGpio_DigitalRead_Interrupt/FeatherGpio_DigitalRead_Interrupt.ino

@fpistm
Copy link
Member

Hi@zfields
I don't have access to your sketch

@zfields
Copy link
ContributorAuthor

/*  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");  }}

@fpistm
Copy link
Member

Hi@zfields
First, next time, please open a discussion. Comments on PR merged is not easy to follow mainly when it is not link to the PR subject.
For me there is no issue, only a missing knowledge on the STM32 EXTI.
You can't have 1 interrupt for each pin. EXTI does not take care of GPIO port only GPIO pin number.
So you can have 16 EXTI, one per GPIO pin number from 0 to 15.
If you configure interrupt on PA0 then the handler it is the same for PB0, PC0,....
In your case for the Cygnet the latest handler attached will be the one called for all pin with the same pin number:

Arduino pin numberSTM32 aliasGPIO pin numbercomment
A0PA00ISR_d11 not ISR_a0
A1PA11ISR_a4 not ISR_a1
A2PA22ISR_a2
A3PA33ISR_a3
A4PB11ISR_a4
A5PA77ISR_a5
D5PB88ISR_d5
D6PB99ISR_d6
D9PB1414ISR_d9
D10PB1313ISR_user_btn not ISR_d10
D11PB00ISR_d11
D12PB1515ISR_d12
D13PB44ISR_d13
USER_BTNPC1313ISR_user_btn

So as you can see you expect 14 isr handler but only 11 are called.

@zfields
Copy link
ContributorAuthor

@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. 👍

fpistm reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fpistmfpistmfpistm approved these changes

Assignees
No one assigned
Labels
enhancementNew feature or request
Projects
Milestone
2.9.0
Development

Successfully merging this pull request may close these issues.

2 participants
@zfields@fpistm

[8]ページ先頭

©2009-2025 Movatter.jp