Skip to content

STM32F4 - Add low power timer #2760

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

Merged
merged 2 commits into from
Sep 28, 2016
Merged

STM32F4 - Add low power timer #2760

merged 2 commits into from
Sep 28, 2016

Conversation

svastm
Copy link
Contributor

@svastm svastm commented Sep 21, 2016

This PR add a low power timer implementation for STM32F0 targets.

Concern:

  • NUCLEO_F411RE
  • NUCLEO_F401RE
  • DISCO_F429ZI
  • NUCLEO_F446RE
  • NUCLEO_F410RB
  • DISCO_F469NI
  • NUCLEO_F446ZE
  • B96B_F446VE

Results


Tests

  • ARM
 +-------------------+---------------+---------------------------------------+-------------------------------------+--------+--------+---------+--------------------+
 | target            | platform_name | test suite                            | test case                           | passed | failed | result  | elapsed_time (sec) |
 +-------------------+---------------+---------------------------------------+-------------------------------------+--------+--------+---------+--------------------+
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1ms LowPowerTimeout                 | 1      | 0      | OK      | 0.05               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1sec LowPowerTimeout                | 1      | 0      | OK      | 1.05               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1sec LowPowerTimeout from deepsleep | 0      | 0      | SKIPPED | 0.0                |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1sec LowPowerTimeout from sleep     | 1      | 0      | OK      | 1.06               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 500us LowPowerTimeout               | 1      | 0      | OK      | 0.05               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 5sec LowPowerTimeout                | 1      | 0      | OK      | 5.05               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1ms lp_ticker                       | 1      | 0      | OK      | 0.04               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1s lp_ticker                        | 1      | 0      | OK      | 1.04               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1s lp_ticker deepsleep              | 0      | 0      | SKIPPED | 0.0                |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1s lp_ticker sleep                  | 1      | 0      | OK      | 1.05               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 500us lp_ticker                     | 1      | 0      | OK      | 0.05               |
 | NUCLEO_F410RB-ARM | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 5s lp_ticker                        | 1      | 0      | OK      | 5.04               |
 +-------------------+---------------+---------------------------------------+-------------------------------------+--------+--------+---------+--------------------+
  • GCC_ARM
Fail
  • IAR
 +-------------------+---------------+---------------------------------------+-------------------------------------+--------+--------+---------+--------------------+
| target            | platform_name | test suite                            | test case                           | passed | failed | result  | elapsed_time (sec) |
+-------------------+---------------+---------------------------------------+-------------------------------------+--------+--------+---------+--------------------+
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1ms LowPowerTimeout                 | 1      | 0      | OK      | 0.05               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1sec LowPowerTimeout                | 1      | 0      | OK      | 1.05               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1sec LowPowerTimeout from deepsleep | 0      | 0      | SKIPPED | 0.0                |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 1sec LowPowerTimeout from sleep     | 1      | 0      | OK      | 1.06               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 500us LowPowerTimeout               | 1      | 0      | OK      | 0.05               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_drivers-lp_timeout | 5sec LowPowerTimeout                | 1      | 0      | OK      | 5.05               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1ms lp_ticker                       | 1      | 0      | OK      | 0.05               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1s lp_ticker                        | 1      | 0      | OK      | 1.04               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1s lp_ticker deepsleep              | 0      | 0      | SKIPPED | 0.0                |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 1s lp_ticker sleep                  | 1      | 0      | OK      | 1.05               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 500us lp_ticker                     | 1      | 0      | OK      | 0.04               |
| NUCLEO_F410RB-IAR | NUCLEO_F410RB | mbed-os-tests-mbed_hal-lp_ticker      | 5s lp_ticker                        | 1      | 0      | OK      | 5.04               |
+-------------------+---------------+---------------------------------------+-------------------------------------+--------+--------+---------+--------------------+

@@ -39,12 +40,31 @@ static int rtc_inited = 0;

static RTC_HandleTypeDef RtcHandle;

#if DEVICE_RTC_LSI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEVICE_ reserved for device_has list. macros can use STM or just RTC_LSI

RtcHandle.Init.OutPut = RTC_OUTPUT_DISABLE;
RtcHandle.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
RtcHandle.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;

if (HAL_RTC_Init(&RtcHandle) != HAL_OK) {
error("RTC error: RTC initialization failed.");
}

#if DEVICE_LOWPOWERTIMER
#if DEVICE_RTC_LSI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above about DEVICE_

@@ -129,6 +159,7 @@ void rtc_free(void)
RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
HAL_RCC_OscConfig(&RCC_OscInitStruct);

#if DEVICE_RTC_LSI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above about DEVICE_

@sg- sg- added the needs: CI label Sep 22, 2016
@sg-
Copy link
Contributor

sg- commented Sep 22, 2016

@svastm can this be rebased and conflicts resolved?

@svastm
Copy link
Contributor Author

svastm commented Sep 22, 2016

rebased

@@ -862,7 +862,8 @@
"progen": {"target": "nucleo-f446ze"},
"detect_code": ["0778"],
"macros": ["TRANSACTION_QUEUE_SIZE_SPI=2"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"]
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LMESTM release_version has been removed by accident in e68b550 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it.

@sg- sg- added needs: work and removed needs: CI labels Sep 22, 2016
@svastm svastm mentioned this pull request Sep 26, 2016
3 tasks
@svastm
Copy link
Contributor Author

svastm commented Sep 27, 2016

@sg- I don't understand the needs: work label.

@sg-
Copy link
Contributor

sg- commented Sep 27, 2016

There is a conflict or something blocking the next step, CI

Conflicting files
hal/targets.json

Enable the low power timer for the following targets:
 - NUCLEO_F411RE
 - NUCLEO_F401RE
 - DISCO_F429ZI
 - NUCLEO_F446RE
 - NUCLEO_F410RB
 - DISCO_F469NI
 - NUCLEO_F446ZE
 - B86B_F446VE
@svastm
Copy link
Contributor Author

svastm commented Sep 28, 2016

Rebased

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 28, 2016

@svastm Can you address DEVICE_ reserved for device_has list. macros can use STM or just RTC_LSI comment?

@svastm
Copy link
Contributor Author

svastm commented Sep 28, 2016

@0xc0170 Yes, I have opened another PR #2816 to rename this macro over all the targets.

@sg- sg- added needs: CI and removed needs: work labels Sep 28, 2016
@sg-
Copy link
Contributor

sg- commented Sep 28, 2016

/morph test

@sg-
Copy link
Contributor

sg- commented Sep 28, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@mbed-bot
Copy link

[Build ${MBED_BUILD_ID}]
FAILURE: Something went wrong when building and testing.

@sg-
Copy link
Contributor

sg- commented Sep 28, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 982

All builds and test passed!

@mbed-bot
Copy link

[Build 994]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@sg- sg- merged commit 3f9a04c into ARMmbed:master Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants