GithubHelp home page GithubHelp logo

lupyuen / pinetime-rust-mynewt Goto Github PK

View Code? Open in Web Editor NEW
207.0 20.0 54.0 268.17 MB

PineTime Smart Watch firmware based on Rust and Apache Mynewt OS

Home Page: https://lupyuen.github.io/articles/sneak-peek-of-pinetime-smart-watch-and-why-its-perfect-for-teaching-iot

License: Apache License 2.0

C 43.84% Batchfile 0.05% Shell 0.54% Assembly 49.39% C++ 1.33% Rust 4.78% HTML 0.07%
rust mynewt pinetime nrf52 nrf52832

pinetime-rust-mynewt's Issues

Bootloader does not start properly after a watchdog reset/incoherent SPI state

I'm working on this issue in InfiniTime : race conditions occurs during sleep/wakeup and something put the devices (spi) into an incoherent state (I think it is disabled while a transaction is running). This bug must be fixed in InfiniTime, of course.

When this bug happens, it looks like the watch is totally frozen, because the screen stays black. This is strange because the watchdog should reset the MCU and the bootloader should be able to start again.

I did some checks and i'm positive that the watchdog works as intended and resets the MCU. But... the bootloader does not start. I cannot debug it right now, but I guess it is also stuck somewhere because of this incoherent state of the SPI device (weird, because the MCU has just been reset...).

I'm not 100% sure of my analysis, but I think we really should have a look at this in order to ensure that the bootloader is as robust as possible.

[FR] OTA istallation

without opening the watches.
I guess it's possible ad described (somewhere) but should be referenced from README

Broken build

Building the master, I've experienced following error

[~/t/pinetime/pinetime-rust-mynewt]$ scripts/build-app.sh                                                                                                                              [broken-build-fixed] 
+ mynewt_build_app=nrf52_my_sensor
+ rust_build_target=thumbv7em-none-eabihf
+ launch_config=launch-nrf52-pi.json
+ set +x

----- Building Rust app and Mynewt OS for thumbv7em-none-eabihf / nrf52_my_sensor...

----- Build Rust app
+ cargo build --target thumbv7em-none-eabihf
    Updating crates.io index
   Compiling app v2.1.1 (/home/fanda/t/pinetime/pinetime-rust-mynewt/rust/app)
error: proc macro panicked
   --> rust/app/src/app_network.rs:98:20
    |
98  |       let _payload = coap!( @json {        
    |  ____________________^
99  | |         //  Create `values` as an array of items under the root.
100 | |         //  Assume `val` contains `key: "t", val: 2870, geo: { lat, long }`. 
101 | |         //  Append to the `values` array the Sensor Key, Value and optional Geolocation:
...   |
107 | |         "device": &device_id,
108 | |     });
    | |______^
    |
    = help: message: index out of bounds: the len is 1 but the index is 1
    = note: this error originates in the macro `$crate::json_rep_set_text_string` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `app` due to 2 previous errors

When I change @json to @cbor build finishes with success, but the app might be broken.

Build failes on Build Rust app

Hello i'm trying to build the Firmware Image via VisualStudioCode

After starting the application build process it fails with the following errors.


Building target targets/nrf52_my_sensor
Linking D://pinetime-rust-mynewt/bin/targets/nrf52_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf
Error: c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: D:/
/pinetime-rust-mynewt/bin/targets/nrf52_my_sensor/app/libc/baselibc/libc_baselibc.a(start.o): in function _start': D:\****\pinetime-rust-mynewt/repos/apache-mynewt-core/libc/baselibc/src/start.c:39: undefined reference to main'
collect2.exe: error: ld returned 1 exit status

Could Not Find D:****\pinetime-rust-mynewt\target\thumbv7em-none-eabihf\debug\libapp.a
----- Build Rust app

D:*\pinetime-rust-mynewt>cargo build --target thumbv7em-none-eabihf
Compiling app v2.1.1 (D:*
\pinetime-rust-mynewt\rust\app)
error: proc macro panicked
--> rust\app\src\app_network.rs:98:20
|
98 | let _payload = coap!( @JSON {
| ______________^
99 | | // Create values as an array of items under the root.
100 | | // Assume val contains key: "t", val: 2870, geo: { lat, long }.
101 | | // Append to the values array the Sensor Key, Value and optional Geolocation:
... |
107 | | "device": &device_id,
108 | | });
| |
^
|
= help: message: index out of bounds: the len is 1 but the index is 1
= note: this error originates in the macro $crate::json_rep_set_text_string (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile app due to 2 previous errors
✅ ◾ ️Done!


I'm an experienced Embedded Softwae Developer.
I hoped to use the PineTime as starting point for complex embedded Rust applications.
Due to this fact im rather inexperienced in programming with Rust
I tried to debug the build with the proposed solution:


(in Nightly builds, run with -Z macro-backtrace for more info)

PS D:***\pinetime-rust-mynewt> cargo build -Z macro-backtrace
error: unknown -Z flag specified: macro-backtrace


Running on Windows 10 with Visual Code.


git log -r
commit eab7a64 (HEAD -> master, origin/master, origin/HEAD)
Author: Lee Lup Yuen [email protected]
Date: Wed Apr 21 09:46:00 2021 +0800

Update FUNDING.yml

commit 65e8519
Author: Lee Lup Yuen [email protected]
Date: Sun Apr 18 18:28:33 2021 +0800

Don't run workflow on PR

commit 158d767
Author: lupyuen [email protected]
Date: Fri Apr 9 09:16:41 2021 +0800

Standardise header and footer

How to activate bluetooth on pinetime after flashing mynewt

Hi,

I used your guide to flash mynewt with the counter app developed on rust.

now I want to connect my android flutter base app with the pinetime watch.

I managed to run the bluetoote flutter application on my android but it doesn't find the pinetime.

What am I missing?

Thanks

Higher consumption on nRF52832 when boot from mcuboot

Hi @lupyuen,
I'm working with @JF002 on power consumption of Pinetime watch, using Infinitime from JF.

I noticed that consumption is higher when Infinitime is booted by mcuboot than when it is stand-alone. Difference is about 500µA.

As a example, I disabled watchdog in bootloader, and add a simple __WFE loop in main function of Infinitime.
Booting from mcuboot gives a consumption of 574µA, while booting in stand-alone configuration gives 170µA.

Resources may be used in mcuboot/mynewt and not de-initialized in mcuboot, nor in Infinitime.

Do you have any idea for me? How can I identify which resource is consuming power?

Thanks for your help.
Vincent

install-pi.sh stops on non-existent path

----- Installing openocd-spi...
+ '[' '!' -d /home/pi/openocd-spi ']'
+ cp /home/pi/openocd-spi/src/openocd /home/pi/pinetime-rust-mynewt/openocd/bin/openocd
cp: cannot create regular file '/home/pi/pinetime-rust-mynewt/openocd/bin/openocd': No such file or directory

At first I had this script in subdirectory /home/pi/PineTime/pinetime-rust-mynewt/scripts/, so I moved the solution to /home/pi/ but the issue was still there. So I created directory openocd/bin by mkdir -p ../openocd/bin and run the script install-pi.sh again and it worked.

Expected behavior:

  1. script will autodetect path.
  2. required directory will be autocreated

build-app.sh can't build cortex-m

When build-app.sh tries to compile cortex-m it ends with error:

+ mynewt_build_app=nrf52_my_sensor
+ rust_build_target=thumbv7em-none-eabihf
+ launch_config=launch-nrf52-pi.json
+ set +x

----- Building Rust app and Mynewt OS for thumbv7em-none-eabihf / nrf52_my_sensor...

----- Build Rust app
+ cargo build --target thumbv7em-none-eabihf
   Compiling cortex-m v0.6.2
error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:11:24
   |
11 |         () => unsafe { asm!("bkpt" :::: "volatile") },
   |                        ----^^^^^^^^^^^^^^^^^^^^^^^^
   |                        |
   |                        help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:39:13
   |
39 |               asm!("1:
   |               ^---
   |               |
   |  _____________help: replace with: `llvm_asm!`
   | |
40 | |                   nop
41 | |                   subs $0, $$1
42 | |                   bne.n 1b"
...  |
45 | |                  :
46 | |                  : "volatile");
   | |_______________________________^
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:68:24
   |
68 |         () => unsafe { asm!("nop" :::: "volatile") },
   |                        ----^^^^^^^^^^^^^^^^^^^^^^^
   |                        |
   |                        help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:89:24
   |
89 |         () => unsafe { asm!("wfe" :::: "volatile") },
   |                        ----^^^^^^^^^^^^^^^^^^^^^^^
   |                        |
   |                        help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
   --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:110:24
    |
110 |         () => unsafe { asm!("wfi" :::: "volatile") },
    |                        ----^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        help: replace with: `llvm_asm!`
    |
    = note: consider migrating to the new asm! syntax specified in RFC 2873
    = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
   --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:131:24
    |
131 |         () => unsafe { asm!("sev" :::: "volatile") },
    |                        ----^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        help: replace with: `llvm_asm!`
    |
    = note: consider migrating to the new asm! syntax specified in RFC 2873
    = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
   --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:155:24
    |
155 |         () => unsafe { asm!("isb 0xF" ::: "memory" : "volatile") },
    |                        ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        help: replace with: `llvm_asm!`
    |
    = note: consider migrating to the new asm! syntax specified in RFC 2873
    = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
   --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:183:24
    |
183 |         () => unsafe { asm!("dsb 0xF" ::: "memory" : "volatile") },
    |                        ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        help: replace with: `llvm_asm!`
    |
    = note: consider migrating to the new asm! syntax specified in RFC 2873
    = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
   --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/asm.rs:209:24
    |
209 |         () => unsafe { asm!("dmb 0xF" ::: "memory" : "volatile") },
    |                        ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        help: replace with: `llvm_asm!`
    |
    = note: consider migrating to the new asm! syntax specified in RFC 2873
    = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/interrupt.rs:13:13
   |
13 |             asm!("cpsid i" ::: "memory" : "volatile");
   |             ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |             |
   |             help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/interrupt.rs:40:15
   |
40 |         () => asm!("cpsie i" ::: "memory" : "volatile"),
   |               ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |               |
   |               help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/basepri.rs:11:17
   |
11 |                 asm!("mrs $0, BASEPRI" : "=r"(r) ::: "volatile");
   |                 ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                 |
   |                 help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/basepri.rs:40:19
   |
40 |             () => asm!("msr BASEPRI, $0" :: "r"(_basepri) : "memory" : "volatile"),
   |                   ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                   |
   |                   help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/basepri_max.rs:17:23
   |
17 |                 () => asm!("msr BASEPRI_MAX, $0" :: "r"(_basepri) : "memory" : "volatile"),
   |                       ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                       |
   |                       help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
   --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/control.rs:166:30
    |
166 |                     unsafe { asm!("mrs $0, CONTROL" : "=r"(r) ::: "volatile") }
    |                              ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                              |
    |                              help: replace with: `llvm_asm!`
    |
    = note: consider migrating to the new asm! syntax specified in RFC 2873
    = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
   --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/control.rs:197:17
    |
197 |                 asm!("msr CONTROL, $0" :: "r"(control) : "memory" : "volatile");
    |                 ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                 |
    |                 help: replace with: `llvm_asm!`
    |
    = note: consider migrating to the new asm! syntax specified in RFC 2873
    = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/faultmask.rs:37:30
   |
37 |                     unsafe { asm!("mrs $0, FAULTMASK" : "=r"(r) ::: "volatile") }
   |                              ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                              |
   |                              help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/msp.rs:10:22
   |
10 |             unsafe { asm!("mrs $0,MSP" : "=r"(r) ::: "volatile") }
   |                      ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                      |
   |                      help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/msp.rs:33:15
   |
33 |         () => asm!("msr MSP,$0" :: "r"(_bits) :: "volatile"),
   |               ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |               |
   |               help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/primask.rs:37:30
   |
37 |                     unsafe { asm!("mrs $0, PRIMASK" : "=r"(r) ::: "volatile") }
   |                              ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                              |
   |                              help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/psp.rs:10:22
   |
10 |             unsafe { asm!("mrs $0,PSP" : "=r"(r) ::: "volatile") }
   |                      ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                      |
   |                      help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/psp.rs:33:15
   |
33 |         () => asm!("msr PSP,$0" :: "r"(_bits) :: "volatile"),
   |               ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |               |
   |               help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/apsr.rs:58:17
   |
58 |                 asm!("mrs $0, APSR" : "=r"(r) ::: "volatile");
   |                 ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                 |
   |                 help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/lr.rs:12:22
   |
12 |             unsafe { asm!("mov $0,R14" : "=r"(r) ::: "volatile") }
   |                      ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                      |
   |                      help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/lr.rs:28:15
   |
28 |         () => asm!("mov R14,$0" :: "r"(_bits) :: "volatile"),
   |               ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |               |
   |               help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/pc.rs:12:22
   |
12 |             unsafe { asm!("mov $0,R15" : "=r"(r) ::: "volatile") }
   |                      ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                      |
   |                      help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: the legacy LLVM-style asm! syntax is no longer supported
  --> /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cortex-m-0.6.2/src/register/pc.rs:28:15
   |
28 |         () => asm!("mov R15,$0" :: "r"(_bits) :: "volatile"),
   |               ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |               |
   |               help: replace with: `llvm_asm!`
   |
   = note: consider migrating to the new asm! syntax specified in RFC 2873
   = note: alternatively, switch to llvm_asm! to keep your code working as it is

error: aborting due to 27 previous errors

error: could not compile `cortex-m`.

To learn more, run the command again with --verbose.

Expected behavior: Script compiles cortex-m

Bluetooth adapter is not available

The code builded correctly but the app only shows a blue screen which says" Bluetooth adapter is not available". I'm using android lollipop on nexus 4 virtual machine.

Send bootloader version to application

It would be useful if the application could somehow get the version of the running bootloader. This would allow

  • displaying this information to the user
  • different application behaviour, for example resetting the watchdog timer or not.

Tickle Watchdog to prevent reboot after 7 seconds

Hi @caspermeijn with reference to...

https://github.com/apache/mynewt-core/pull/2381/files

I'm now testing the new Sanity Interval, but using the old Watchdog Interval...

https://github.com/lupyuen/pinetime-rust-mynewt/blob/lvgl/apps/my_sensor_app/syscfg.yml#L119-L127

syscfg.vals:

    ###########################################################################
    # Watchdog Settings

    # The default PineTime bootloader will setup a 7 second watchdog
    SANITY_INTERVAL:      5000  #  Tickle the watchdog every 5 seconds, that the watchdog won't trigger a reboot
    # WATCHDOG_INTERVAL:  7000  #  If watchdog is not set, set it to 7 seconds

Note that I'm updating the apps/syscfg.yml, not the bsp/syscfg.yml.

This seems to work, PineTime is responding to BLE after 7 seconds. Previously it was hanging due to the watchdog being triggered.

So I suppose this validates your proposed fix for SANITY_INTERVAL.

Do we need to change WATCHDOG_INTERVAL? Or just leave it as default for now? Thanks.

Missing file target/nrf52.cfg

I'm trying to flash PineTime from Raspberry Pi according to README.md, now I'm at step 8) Flash the bootloader. I know there is flash protection, so I'm trying to run script/nrf52-pi/flash-unprotect.sh at first and later flash-boot.sh but there is an error:

pi@raspberrypi:~/pinetime-rust-mynewt $ ./scripts/nrf52-pi/flash-boot.sh
+ openocd/bin/openocd -f scripts/nrf52-pi/swd-pi.ocd -f scripts/nrf52/flash-boot.ocd
Open On-Chip Debugger 0.10.0+dev-01130-g9d1b46f5 (2020-07-19-22:23)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
scripts/nrf52-pi/swd-pi.ocd:13: Error: Can't find target/nrf52.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 26
at file "scripts/nrf52-pi/swd-pi.ocd", line 13

The target folder is stored in parent folder and its subfolders - not ~/pinetime-rust-mynewt/target/ but ~/openocd-spi/tcl/target/ - so find command can't look it up.

build-app.sh is missing some libraries

After running ./scripts/nrf52/build-boot.sh I executed ./scripts/build-app.sh and after some time it failed on error Undefined main, so I ran it again and it fails on this:

----- Build Rust app
+ cargo build --target thumbv7em-none-eabihf
error: failed to read `/home/pi/pinetime-rust-mynewt/rust/druid-embedded/druid/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

Expected behavior: druid toolkit will be available (pre-downloaded) in the directory ~/pinetime-rust-mynewt/rust/druid-embedded.

After trying to fix it by clonning repository druid-embedded, it continues with the same error for piet-embedded, kurbo-embedded and st7735-lcd-batch-rs.

Firmware to update MCUBoot Bootloader

Hi thanks for helping to create the Rust+Mynewt firmware for updating the MCUBoot Bootloader :-)

  1. Try writing some Rust code in https://github.com/lupyuen/pinetime-rust-mynewt/blob/master/rust/app/src/lib.rs

  2. Check whether GitHub Actions will compile it. You need to enable GitHub Actions in your repo... just click "Actions" to enable it

  3. Edit the Rust code in lib.rs to read the bytes from a binary file (i.e. the bootloader binary)

    Use the include_bytes! macro as shown here...

    https://github.com/lupyuen/pinetime-rust-mynewt/blob/master/rust/app/src/chip8.rs#L88

    You may put the binary file in the same folder as lib.rs.

  4. Next step is to write the bytes into flash ROM. But we'll do this one step at a time :-)

To test your firmware without a PineTime, use Remote PineTime...

https://github.com/lupyuen/remote-pinetime-bot/blob/master/README.md

Lemme know if you get stuck. Thanks again :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.