Neotron Pico - OS

Neotron Pico OS (operating system).

back to main Neotron Pico page.

History

2024-08-15: try to flash the OS

tingo@kg-core1:~/personal/projects/2023/rust/embedded/neotron/neotron-os $ probe-rs run --chip RP2040 target/thumbv6m-none-eabi/release/flash1002
     Erasing sectors  [00:00:01] [#######################################################################################] 120.00 KiB/120.00 KiB @ 65.62 KiB/s (eta 0s )
 Programming pages    [00:00:05] [#######################################################################################] 120.00 KiB/120.00 KiB @ 21.47 KiB/s (eta 0s )    Finished in 7.471s
ERROR probe_rs::cmd::run: Error attempting to attach to RTT: RTT control block not found in target memory.
- Make sure RTT is initialized on the target, AND that there are NO target breakpoints before RTT initalization.
- For VSCode and probe-rs-debugger users, using `halt_after_reset:true` in your `launch.json` file will prevent RTT 
    initialization from happening on time.
- Depending on the target, sleep modes can interfere with RTT. Continuing without RTT...     
Error: An ARM specific error occurred.

Caused by:
    0: Error using access port
    1: Failed to read register DRW at address 0x0000000c
    2: An error occurred in the communication with an access port or debug port.
    3: Target device did not respond to request.

yes, that was it, the Neotron Pico rebooted and I now have OS 0.8.1 on it. Nice.

2024-08-15: check probe-rs

tingo@kg-core1:~/personal/projects/2023/rust/embedded/neotron/neotron-os $ probe-rs list
The following debug probes were found:
[0]: Picoprobe CMSIS-DAP (VID: 2e8a, PID: 000c, Serial: E660D4A0A71CA332, CmsisDap)

2024-08-15: check what we got

tingo@kg-core1:~/personal/projects/2023/rust/embedded/neotron/neotron-os $ ls target/thumbv6m-none-eabi/release/flash*02
target/thumbv6m-none-eabi/release/flash0002 target/thumbv6m-none-eabi/release/flash0802 target/thumbv6m-none-eabi/release/flash1002

what are they?

tingo@kg-core1:~/personal/projects/2023/rust/embedded/neotron/neotron-os $ file target/thumbv6m-none-eabi/release/flash*02
target/thumbv6m-none-eabi/release/flash0002: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
target/thumbv6m-none-eabi/release/flash0802: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
target/thumbv6m-none-eabi/release/flash1002: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped

ok, so ELF files. Good.

2024-08-15: build latest os

tingo@kg-core1:~/personal/projects/2023/rust/embedded/neotron/neotron-os $ cargo build --target thumbv6m-none-eabi --release --bins
    Updating crates.io index
  Downloaded bitflags v2.5.0
  Downloaded postcard v1.0.8
  Downloaded serde v1.0.203
  Downloaded signal-hook-registry v1.4.2
  Downloaded r0 v1.0.0
  Downloaded cobs v0.2.3
  Downloaded serde_derive v1.0.203
  Downloaded mio v0.8.11
  Downloaded embedded-sdmmc v0.7.0
  Downloaded neotron-api v0.2.0
  Downloaded menu v0.3.2
  Downloaded neotron-sdk v0.2.0
  Downloaded neotron-api v0.1.0
  Downloaded neotron-romfs v1.0.0
  Downloaded neotron-loader v0.1.0
  Downloaded vte v0.12.1
  Downloaded 16 crates (720.1 KB) in 0.94s
   Compiling proc-macro2 v1.0.85
   Compiling unicode-ident v1.0.12
   Compiling semver v1.0.23
   Compiling neotron-ffi v0.1.0
   Compiling bitflags v2.5.0
   Compiling serde v1.0.203
   Compiling atomic-polyfill v1.0.3
   Compiling autocfg v1.3.0
   Compiling critical-section v1.1.2
   Compiling rustc_version v0.4.0
   Compiling byteorder v1.5.0
   Compiling quote v1.0.36
   Compiling num-traits v0.2.19
   Compiling heapless v0.7.17
   Compiling syn v2.0.66
   Compiling hash32 v0.2.1
   Compiling neotron-api v0.2.0
   Compiling stable_deref_trait v1.2.0
   Compiling vte_generate_state_changes v0.1.1
   Compiling neotron-api v0.1.0
   Compiling embedded-hal v1.0.0
   Compiling neotron-os v0.8.1 (/zs/tingo/personal/projects/2023/rust/embedded/neotron/neotron-os/neotron-os)
   Compiling chrono v0.4.38
   Compiling pc-keyboard v0.7.0
   Compiling arrayvec v0.7.4
   Compiling cobs v0.2.3
   Compiling utf8parse v0.2.1
   Compiling vte v0.12.1
   Compiling neotron-romfs v1.0.0
   Compiling neotron-common-bios v0.12.0
   Compiling menu v0.3.2
   Compiling neotron-sdk v0.2.0
   Compiling neotron-loader v0.1.0
   Compiling r0 v1.0.0
   Compiling flames v0.1.0 (/zs/tingo/personal/projects/2023/rust/embedded/neotron/neotron-os/utilities/flames)
   Compiling serde_derive v1.0.203
   Compiling embedded-sdmmc v0.7.0
   Compiling postcard v1.0.8
warning: dropping unsupported crate type `cdylib` for target `thumbv6m-none-eabi`

warning: unexpected `cfg` condition name: `romfs_enabled`
  --> neotron-os/src/lib.rs:64:7
   |
64 | #[cfg(romfs_enabled = "yes")]
   |       ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(romfs_enabled, values("yes"))'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(romfs_enabled, values(\"yes\"))");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `romfs_enabled`
  --> neotron-os/src/lib.rs:67:11
   |
67 | #[cfg(not(romfs_enabled = "yes"))]
   |           ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(romfs_enabled, values("yes"))'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(romfs_enabled, values(\"yes\"))");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: field `0` is never read
  --> neotron-os/src/program.rs:73:16
   |
73 |     Filesystem(crate::fs::Error),
   |     ---------- ^^^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
   = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
73 |     Filesystem(()),
   |                ~~

warning: field `0` is never read
  --> neotron-os/src/program.rs:75:11
   |
75 |     ElfFs(neotron_loader::Error<crate::fs::Error>),
   |     ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
75 |     ElfFs(()),
   |           ~~

warning: field `0` is never read
  --> neotron-os/src/program.rs:77:12
   |
77 |     ElfRom(neotron_loader::Error<neotron_loader::traits::SliceError>),
   |     ------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
77 |     ElfRom(()),
   |            ~~

warning: `neotron-os` (lib) generated 6 warnings
    Finished `release` profile [optimized + debuginfo] target(s) in 32.26s

2024-08-15: update the os repository

tingo@kg-core1:~/personal/projects/2023/rust/embedded/neotron/neotron-os $ git pull
remote: Enumerating objects: 344, done.
remote: Counting objects: 100% (317/317), done.
remote: Compressing objects: 100% (118/118), done.
remote: Total 344 (delta 207), reused 297 (delta 199), pack-reused 27 (from 1)
Receiving objects: 100% (344/344), 179.00 KiB | 2.71 MiB/s, done.
Resolving deltas: 100% (224/224), completed with 11 local objects.
From https://github.com/neotron-compute/neotron-os
   2439089..76c4260  develop            -> origin/develop
 * [new branch]      add-file-api       -> origin/add-file-api
 * [new branch]      add-graphics-api   -> origin/add-graphics-api
 * [new branch]      add-more-artefacts -> origin/add-more-artefacts
 * [new branch]      bump-actions       -> origin/bump-actions
 * [new branch]      fix-tool-links     -> origin/fix-tool-links
   aa55271..65798e8  main               -> origin/main
 * [new tag]         v0.8.1             -> v0.8.1
 * [new tag]         v0.6.0             -> v0.6.0
 * [new tag]         v0.7.0             -> v0.7.0
 * [new tag]         v0.7.1             -> v0.7.1
 * [new tag]         v0.8.0             -> v0.8.0
Updating 2439089..76c4260
Fast-forward
 .github/workflows/format.yml                              |   2 +-
 .github/workflows/rust.yml                                |  31 ++++-
 CHANGELOG.md                                              |  65 +++++++--
 Cargo.lock                                                | 439 ++++++++++++++++++++++++++++++++++++++++++++++++++----------
 Cargo.toml                                                |  52 +-------
 README.md                                                 |  38 +++++-
 build.rs                                                  |  33 -----
 build.sh                                                  |  26 +++-
 flake.lock                                                | 127 ------------------
 flake.nix                                                 |  88 ------------
 neotron-os/Cargo.lock                                     | 321 ++++++++++++++++++++++++++++++++++++++++++++
 neotron-os/Cargo.toml                                     |  49 +++++++
 neotron-os/build.rs                                       |  56 ++++++++
 neotron-flash-0002.ld => neotron-os/neotron-flash-0002.ld |   0
 neotron-flash-0802.ld => neotron-os/neotron-flash-0802.ld |   0
 neotron-flash-1002.ld => neotron-os/neotron-flash-1002.ld |   0
 {src => neotron-os/src}/bin/flash0002.rs                  |   2 +
 {src => neotron-os/src}/bin/flash0802.rs                  |   2 +
 {src => neotron-os/src}/bin/flash1002.rs                  |   2 +
 neotron-os/src/commands/block.rs                          |  61 +++++++++
 {src => neotron-os/src}/commands/config.rs                |  36 +++--
 neotron-os/src/commands/fs.rs                             | 214 +++++++++++++++++++++++++++++
 neotron-os/src/commands/hardware.rs                       | 335 ++++++++++++++++++++++++++++++++++++++++++++++
 {src => neotron-os/src}/commands/input.rs                 |   2 +
 neotron-os/src/commands/mod.rs                            |  87 ++++++++++++
 {src => neotron-os/src}/commands/ram.rs                   |  82 +++---------
 neotron-os/src/commands/screen.rs                         | 223 +++++++++++++++++++++++++++++++
 {src => neotron-os/src}/commands/sound.rs                 | 104 +++++++++------
 {src => neotron-os/src}/commands/timedate.rs              |   2 +
 {src => neotron-os/src}/config.rs                         |  22 +--
 neotron-os/src/fs.rs                                      | 268 +++++++++++++++++++++++++++++++++++++
 {src => neotron-os/src}/lib.rs                            |  79 +++++++++--
 neotron-os/src/program.rs                                 | 754 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 {src => neotron-os/src}/refcell.rs                        |   0
 {src => neotron-os/src}/vgaconsole.rs                     | 209 ++++++++++++++---------------
 src/commands/block.rs                                     | 112 ----------------
 src/commands/fs.rs                                        | 101 --------------
 src/commands/hardware.rs                                  | 140 -------------------
 src/commands/mod.rs                                       |  38 ------
 src/commands/screen.rs                                    |  18 ---
 src/fs.rs                                                 |  83 ------------
 src/program.rs                                            | 485 ------------------------------------------------------------------
 utilities/README.md                                       |  12 ++
 utilities/flames/Cargo.toml                               |  12 ++
 utilities/flames/README.md                                |   3 +
 utilities/flames/build.rs                                 |   3 +
 utilities/flames/src/lib.rs                               | 156 ++++++++++++++++++++++
 utilities/flames/src/main.rs                              |  15 +++
 48 files changed, 3379 insertions(+), 1610 deletions(-)
 delete mode 100644 build.rs
 delete mode 100644 flake.lock
 delete mode 100644 flake.nix
 create mode 100644 neotron-os/Cargo.lock
 create mode 100644 neotron-os/Cargo.toml
 create mode 100644 neotron-os/build.rs
 rename neotron-flash-0002.ld => neotron-os/neotron-flash-0002.ld (100%)
 rename neotron-flash-0802.ld => neotron-os/neotron-flash-0802.ld (100%)
 rename neotron-flash-1002.ld => neotron-os/neotron-flash-1002.ld (100%)
 rename {src => neotron-os/src}/bin/flash0002.rs (96%)
 rename {src => neotron-os/src}/bin/flash0802.rs (96%)
 rename {src => neotron-os/src}/bin/flash1002.rs (96%)
 create mode 100644 neotron-os/src/commands/block.rs
 rename {src => neotron-os/src}/commands/config.rs (74%)
 create mode 100644 neotron-os/src/commands/fs.rs
 create mode 100644 neotron-os/src/commands/hardware.rs
 rename {src => neotron-os/src}/commands/input.rs (98%)
 create mode 100644 neotron-os/src/commands/mod.rs
 rename {src => neotron-os/src}/commands/ram.rs (54%)
 create mode 100644 neotron-os/src/commands/screen.rs
 rename {src => neotron-os/src}/commands/sound.rs (57%)
 rename {src => neotron-os/src}/commands/timedate.rs (98%)
 rename {src => neotron-os/src}/config.rs (80%)
 create mode 100644 neotron-os/src/fs.rs
 rename {src => neotron-os/src}/lib.rs (85%)
 create mode 100644 neotron-os/src/program.rs
 rename {src => neotron-os/src}/refcell.rs (100%)
 rename {src => neotron-os/src}/vgaconsole.rs (93%)
 delete mode 100644 src/commands/block.rs
 delete mode 100644 src/commands/fs.rs
 delete mode 100644 src/commands/hardware.rs
 delete mode 100644 src/commands/mod.rs
 delete mode 100644 src/commands/screen.rs
 delete mode 100644 src/fs.rs
 delete mode 100644 src/program.rs
 create mode 100644 utilities/README.md
 create mode 100644 utilities/flames/Cargo.toml
 create mode 100644 utilities/flames/README.md
 create mode 100644 utilities/flames/build.rs
 create mode 100644 utilities/flames/src/lib.rs
 create mode 100644 utilities/flames/src/main.rs

2024-08-15: I created this page.