Skip to content

Disable LPTICKER on L073RZ #10572

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
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions TESTS/mbedmicro-rtos-mbed/systimer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#error [NOT_SUPPORTED] Tickless mode not supported for this target.
#endif

#if !DEVICE_LPTICKER
#error [NOT_SUPPORTED] Current SysTimer implementation requires lp ticker support.
#endif

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
Expand Down Expand Up @@ -53,7 +49,7 @@ class SysTimerTest: public rtos::internal::SysTimer {

public:
SysTimerTest() :
SysTimer(), _sem(0, 1)
SysTimer(get_lp_ticker_data()), _sem(0, 1)
{
}

Expand Down
13 changes: 0 additions & 13 deletions rtos/TARGET_CORTEX/SysTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*/
#include "rtos/TARGET_CORTEX/SysTimer.h"

#if DEVICE_LPTICKER

#include "hal/lp_ticker_api.h"
#include "mbed_critical.h"
#include "mbed_assert.h"
#if defined(TARGET_CORTEX_A)
Expand Down Expand Up @@ -57,14 +54,6 @@ extern "C" IRQn_ID_t mbed_get_a9_tick_irqn(void);
namespace rtos {
namespace internal {

SysTimer::SysTimer() :
TimerEvent(get_lp_ticker_data()), _time_us(0), _tick(0)
{
_time_us = ticker_read_us(_ticker_data);
_suspend_time_passed = true;
_suspended = false;
}

SysTimer::SysTimer(const ticker_data_t *data) :
TimerEvent(data), _time_us(0), _tick(0)
{
Expand Down Expand Up @@ -193,5 +182,3 @@ void SysTimer::handler()

}
}

#endif
3 changes: 1 addition & 2 deletions rtos/TARGET_CORTEX/SysTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef MBED_SYS_TIMER_H
#define MBED_SYS_TIMER_H

#if DEVICE_LPTICKER || defined(DOXYGEN_ONLY)
#if MBED_TICKLESS || defined(DOXYGEN_ONLY)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This impacts all the targets!
This should be checked very carefully, and should be out of this "L073RZ" PR...

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, PR introduction talks about fixing one target but there are fixes included impacting larger set of targets. Can we split these (l073 will be quick one to get in)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently SysTimer cannot be built when lp ticker is disabled, leading to build errors of L073RZ. I'll move this SysTimer change to a separate pull request, and make the L073RZ change depend on it.


#include "platform/NonCopyable.h"
#include "drivers/TimerEvent.h"
Expand All @@ -48,7 +48,6 @@ namespace internal {
class SysTimer: private mbed::TimerEvent, private mbed::NonCopyable<SysTimer> {
public:

SysTimer();
SysTimer(const ticker_data_t *data);
virtual ~SysTimer();

Expand Down
15 changes: 9 additions & 6 deletions rtos/TARGET_CORTEX/mbed_rtx_idle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ extern "C" {

#ifdef MBED_TICKLESS

MBED_STATIC_ASSERT(!MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER || DEVICE_USTICKER,
"Microsecond ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is true");
MBED_STATIC_ASSERT(MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER || DEVICE_LPTICKER,
"Low power ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is false");
#if MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER && !DEVICE_USTICKER
#error Microsecond ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is true
#endif

#if !MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER && !DEVICE_LPTICKER
#error Low power ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is false
#endif

#include "rtos/TARGET_CORTEX/SysTimer.h"

Expand Down Expand Up @@ -137,7 +140,7 @@ extern "C" {
}


#else
#else // MBED_TICKLESS

static void default_idle_hook(void)
{
Expand All @@ -149,7 +152,7 @@ extern "C" {
core_util_critical_section_exit();
}

#endif // (defined(MBED_TICKLESS) && DEVICE_LPTICKER)
#endif // MBED_TICKLESS

static void (*idle_hook_fptr)(void) = &default_idle_hook;

Expand Down
1 change: 1 addition & 0 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3352,6 +3352,7 @@
"FLASH",
"MPU"
],
"device_has_remove": ["LPTICKER"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep this update out of the PR.
Thx

"release_versions": ["2", "5"],
"bootloader_supported": true,
"device_name": "STM32L073RZ"
Expand Down