Skip to content

Conversation

jue89
Copy link
Contributor

@jue89 jue89 commented Oct 18, 2022

Contribution description

This is split-off #18760 and provides commits that are useful for #18756.

Testing procedure

  1. Compile testing.
  2. tests/periph_gpio should be able to raise IRQs even with PM_BLOCKER_INITIAL set to { 0, 0, 0 }. Make sure to configure GPIO_INT_PM_BLOCKER to the lowest power mode that is able to register IRQs.

Issues/PRs references

#18760
#18756

Gecko Series 2 is shipped with a new IADC peripheral which is backed by its own emlib driver.
@jue89 jue89 added Platform: ARM Platform: This PR/issue effects ARM-based platforms CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: pm Area: (Low) power management Area: cpu Area: CPU/MCU ports labels Oct 18, 2022
@jue89 jue89 changed the title cpu/efm32: housekeeping preparing introduction of Gecko Series 2 cpu/efm32: preparing introduction of Gecko Series 2 Oct 18, 2022
@jue89 jue89 marked this pull request as ready for review October 18, 2022 14:50
@jue89 jue89 requested a review from basilfx as a code owner October 18, 2022 14:50
@jue89 jue89 requested a review from gschorcht October 18, 2022 14:50
@riot-ci
Copy link

riot-ci commented Oct 18, 2022

Murdock results

✔️ PASSED

dc8fe69 cpu/efm32: satisfy vera++

Success Failures Total Runtime
1991 0 1991 06m:24s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@jue89 jue89 force-pushed the feature/cpu_efm32_series_2_preparation branch from d68e51b to eadd704 Compare October 18, 2022 15:17
@jue89 jue89 force-pushed the feature/cpu_efm32_series_2_preparation branch from eadd704 to ed5f7da Compare October 18, 2022 15:34
@jue89 jue89 requested a review from kaspar030 as a code owner October 18, 2022 15:34
@jue89
Copy link
Contributor Author

jue89 commented Oct 18, 2022

Finally static tests are fine. I'd say this is ready to be reviewed.

@gschorcht I renamed the power modes and prefixed EFM32 like the stm32 family does.

@gschorcht
Copy link
Contributor

I will test it later today with my EFM32GG12B board (sltb009a). I have have it not at hand.

@jue89
Copy link
Contributor Author

jue89 commented Oct 18, 2022

I'll test with my board, as well ;-) But Murdock will take until tomorrow, anyways ...

@gschorcht
Copy link
Contributor

I had include periph/pm.h in cpu/efm32/periph/gpio.c to get it compiled for sltb009a board.

diff --git a/cpu/efm32/periph/gpio.c b/cpu/efm32/periph/gpio.c
index bc74bf6fa0..f7c285ee43 100644
--- a/cpu/efm32/periph/gpio.c
+++ b/cpu/efm32/periph/gpio.c
@@ -24,6 +24,7 @@
 #include "cpu.h"
 
 #include "periph/gpio.h"
+#include "periph/pm.h"
 
 #include "em_gpio.h"

With this change I could compile it. tests/periph_gpio seems to work on my sltb009a board with PM_BLOCKER_INITIAL { 0, 0, 0 } and GPIO_INT_PM_BLOCKER=0.

@jue89 jue89 force-pushed the feature/cpu_efm32_series_2_preparation branch from 73031de to dc8fe69 Compare October 18, 2022 21:30
@jue89
Copy link
Contributor Author

jue89 commented Oct 18, 2022

I had include periph/pm.h in cpu/efm32/periph/gpio.c to get it compiled for sltb009a board.

diff --git a/cpu/efm32/periph/gpio.c b/cpu/efm32/periph/gpio.c
index bc74bf6fa0..f7c285ee43 100644
--- a/cpu/efm32/periph/gpio.c
+++ b/cpu/efm32/periph/gpio.c
@@ -24,6 +24,7 @@
 #include "cpu.h"
 
 #include "periph/gpio.h"
+#include "periph/pm.h"
 
 #include "em_gpio.h"

With this change I could compile it. tests/periph_gpio seems to work on my sltb009a board with PM_BLOCKER_INITIAL { 0, 0, 0 } and GPIO_INT_PM_BLOCKER=0.

I inlcuded pm_layered.h (it defines pm_block() and pm_unblock()) and board.h, which can be used to define GPIO_INT_PM_BLOCKER.

@jue89
Copy link
Contributor Author

jue89 commented Oct 18, 2022

I had success, as well: The (not upstream, yet) board xg23b-pk6068a blocks the right PM mode and can be woken up with an GPIO IRQ:

> pm show
2022-10-19 00:21:32,733 # pm show
2022-10-19 00:21:32,734 # mode 0 blockers: 0 
2022-10-19 00:21:32,734 # mode 1 blockers: 1 
2022-10-19 00:21:32,736 # mode 2 blockers: 0 
2022-10-19 00:21:32,741 # Lowest allowed mode: 2
> init_int 1 1 0 0
2022-10-19 00:21:37,203 # init_int 1 1 0 0
2022-10-19 00:21:37,206 # GPIO_PIN(1, 1) successfully initialized as ext int
2022-10-19 00:21:43,636 # INT: external interrupt from pin 1
(... pressing the button logs into the console)
> pm unblock 1
2022-10-19 00:21:52,745 # pm unblock 1
2022-10-19 00:21:52,746 # Unblocking power mode 1.
> help
(... console is stalled ... the UART is disabled)
2022-10-19 00:21:58,405 # INT: external interrupt from pin 1
(... pressing the button still logs into the console)

@jue89 jue89 enabled auto-merge October 19, 2022 08:10
@jue89 jue89 merged commit b4b8f2b into RIOT-OS:master Oct 19, 2022
@jue89
Copy link
Contributor Author

jue89 commented Oct 19, 2022

Murdock is also happy :) Thank you for reviewing!

@jue89 jue89 deleted the feature/cpu_efm32_series_2_preparation branch October 19, 2022 11:03
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Area: pm Area: (Low) power management CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants