From 3a4f8b0ad5cc893ceef82eee60e3ec17dcf358fe Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 2 May 2019 11:04:44 +0200 Subject: [PATCH 1/3] tweak .travis.yml to build / update docs --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 563806977a..146748d95a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,6 +49,8 @@ branches: - master - staging - trying + # to build docs + - v0.4.x notifications: email: From eca12fecefb3a572845eecf354005db950a81a95 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 2 May 2019 11:15:30 +0200 Subject: [PATCH 2/3] tweak ci scripts --- ci/after-success.sh | 2 +- ci/script.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/after-success.sh b/ci/after-success.sh index 65ddb90483..e7d24ef869 100644 --- a/ci/after-success.sh +++ b/ci/after-success.sh @@ -37,6 +37,6 @@ if [ -z ${TRAVIS_PULL_REQUEST-} ]; then TRAVIS_PULL_REQUEST=false fi -if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]; then +if { [ $TRAVIS_BRANCH = master ] || [ $TRAVIS_BRANCH = v0.4.x ]; } && [ $TRAVIS_PULL_REQUEST = false ]; then main fi diff --git a/ci/script.sh b/ci/script.sh index 492f33f6bd..327bdfc3ea 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -224,6 +224,6 @@ if [ -z ${TARGET-} ]; then TARGET=$(rustc -Vv | grep host | cut -d ' ' -f2) fi -if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_PULL_REQUEST != false ]; then +if { [ $TRAVIS_BRANCH != master ] && [ $TRAVIS_BRANCH != v0.4.x ]; } || [ $TRAVIS_PULL_REQUEST != false ]; then main fi From ec1d508040696745cd997f848ee6bd6345359e38 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 26 Jul 2019 03:15:13 -0700 Subject: [PATCH 3/3] Enable the DWT unit before poking at its registers. On cold boot, the DWT unit is off, which means our attempts to clear and disable the cycle counter in pre-init don't work. This seems to result in access to CYCCNT always returning 1073741824, which delays tasks scheduled in init by that many cycles (~15s at 72 MHz). Fixes #196. --- macros/src/codegen.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index 4468216f53..ff8fb6508d 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -507,7 +507,6 @@ fn post_init(ctxt: &Context, app: &App, analysis: &Analysis) -> proc_macro2::Tok // Enable cycle counter if cfg!(feature = "timer-queue") { - exprs.push(quote!(p.DCB.enable_trace())); exprs.push(quote!(p.DWT.enable_cycle_counter())); } @@ -2024,6 +2023,8 @@ fn pre_init(ctxt: &Context, app: &App, analysis: &Analysis) -> proc_macro2::Toke // Set the cycle count to 0 and disable it while `init` executes if cfg!(feature = "timer-queue") { + // We need to explicitly enable the trace block to set CYCCNT. + exprs.push(quote!(p.DCB.enable_trace();)); exprs.push(quote!(p.DWT.ctrl.modify(|r| r & !1);)); exprs.push(quote!(p.DWT.cyccnt.write(0);)); }