tweedegolf / dis-bootloader Goto Github PK
View Code? Open in Web Editor NEWA rust bootloader for our internal project using the nRF9160 chip.
License: Other
A rust bootloader for our internal project using the nRF9160 chip.
License: Other
We're getting:
error: opaque type's hidden type cannot be another opaque type from the same scope
--> bootloader/src/main.rs:34:1
|
34 | #[embassy::main]
| ^^^^^^^^^^^^^^^^ one of the two opaque types used here has to be outside its defining scope
|
note: opaque type whose hidden type is being assigned
--> bootloader/src/main.rs:34:1
|
34 | #[embassy::main]
| ^^^^^^^^^^^^^^^^
note: opaque type being used as hidden type
--> bootloader/src/main.rs:34:1
|
34 | #[embassy::main]
| ^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `::embassy::task` (in Nightly builds, run with -Z macro-backtrace for more info)
Probably need to update to a newer version of Embassy
An application using embassy_time and "time-driver-rtc1" from embassy-nrf crashes.
(HOST) INFO flashing program (8.71 KiB)
(HOST) INFO success!
────────────────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────────────────
stack backtrace:
0: HardFaultTrampoline
<exception entry>
1: _ZN4core3ptr13read_volatile17hd3f8821b78d6920fE
at /rustc/8b705839cd656d202e920efa8769cbe43a5ee269/library/core/src/ptr/mod.rs:1474:9
2: _ZN5vcell21VolatileCell$LT$T$GT$3get17h846ed7bb76a64525E
at /Users/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/vcell-0.1.3/src/lib.rs:33:18
3: _ZN11nrf9160_pac7generic14Reg$LT$REG$GT$4read17h781ecf172b477ff2E
at /Users/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/nrf9160-pac-0.11.0/src/generic.rs:65:19
4: _ZN84_$LT$embassy_nrf..time_driver..RtcDriver$u20$as$u20$embassy_time..driver..Driver$GT$3now17h4e33ced8e698ee26E
at /Users/martin/.cargo/git/checkouts/embassy-9312dcb0ed774b29/d49d1b6/embassy-nrf/src/time_driver.rs:218:23
5: _embassy_time_now
at /Users/martin/.cargo/git/checkouts/embassy-9312dcb0ed774b29/d49d1b6/embassy-time/src/driver.rs:156:13
6: _ZN12embassy_time6driver3now17hf91ab4d33d5c6c11E
at /Users/martin/.cargo/git/checkouts/embassy-9312dcb0ed774b29/d49d1b6/embassy-time/src/driver.rs:126:14
7: _ZN12embassy_time7instant7Instant3now17h0483671508ea8743E
at /Users/martin/.cargo/git/checkouts/embassy-9312dcb0ed774b29/d49d1b6/embassy-time/src/instant.rs:21:26
8: _ZN16embassy_executor3raw8Executor4poll17h42b4164cf3414afbE
at /Users/martin/.cargo/git/checkouts/embassy-9312dcb0ed774b29/d49d1b6/embassy-executor/src/raw/mod.rs:358:42
9: _ZN16embassy_executor4arch8Executor3run17hb54781054eaf4739E
at /Users/martin/.cargo/git/checkouts/embassy-9312dcb0ed774b29/d49d1b6/embassy-executor/src/arch/cortex_m.rs:54:17
10: _ZN7bateman18__cortex_m_rt_main17hf74310984f680484E
at src/main.rs:12:1
11: main
at src/main.rs:12:1
12: Reset
(HOST) ERROR the program panicked
If I run it without any time features it works.
Suggestion by Dirbaio:
There's one trick to swap without needing scratch space, just needs slot B to be 1 page bigger.
[ABC] [abc.]
[ABC] [abcC]
[ABc] [abcC]
[ABc] [abBC]
[Abc] [abBC]
[Abc] [aABC]
[abc] [aABC]
[abc] [.ABC]
Needs "moving" each page just once, and each page gets written just once (so if your flash can do 10k erases you can do 10k swaps, with scratch you can do less because you're "concentrating" many erases into the scratch pages).
After swap slot B is "shifted" by 1, so you need to do the "unswap" in the reverse order to account for that.
We use the cortex m bootload function:
dis-bootloader/bootloader/src/main.rs
Line 371 in 4741e29
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.