Skip to content

Ast10x0 : FMC flash backend for the flash service - #433

Draft
rusty1968 wants to merge 12 commits into
OpenPRoT:mainfrom
rusty1968:fmc-flash-service
Draft

Ast10x0 : FMC flash backend for the flash service#433
rusty1968 wants to merge 12 commits into
OpenPRoT:mainfrom
rusty1968:fmc-flash-service

Conversation

@rusty1968

Copy link
Copy Markdown
Collaborator

This PR depends on #365

Tests

The service is exercised end-to-end through the full IPC stack (FlashIpcClient → server → BlockingFlash → Ast10x0FmcFlashDriver → FMC CS0), not just at the peripheral level.

  • flash_qemu_test — runs under emulation, no hardware required
  • flash_evb_test — the same system image on real AST10x0 EVB hardware

@yvettewu1

yvettewu1 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Tested with ast1060 evb board:

  1. The flash test itself passed: the client completed geometry, erase, program, read-back, and restore, then printed flash client PASS.
  2. The later HardFault was caused by the target shutdown path calling semihosting exit(), which works under QEMU/debugger-style environments but can trap as a HardFault on bare AST10x0 EVB hardware.

Tested with the following changes and no more HardFault:

-use cortex_m_semihosting::debug::{exit, EXIT_FAILURE, EXIT_SUCCESS};
+use console_backend::console_backend_write_all;

-exit(status);
+let _ = console_backend_write_all(sentinel);

cfrantz and others added 11 commits August 25, 2026 10:08
Signed-off-by: Chris Frantz <cfrantz@google.com>
Signed-off-by: Chris Frantz <cfrantz@google.com>
The flash-service branch's services/flash/client.rs calls
ErrorCode::check_status, which was missing from util/error on this
branch; restore it so the baseline compiles.
Adds the AST10x0 flash-service test image's system config, generic
kernel target, and server app (flash_server_bin). The server process
owns the SCU (pinctrl), FMC register, and CS0 AHB read-window device
mappings, and serves services_flash_server::FlashIpcServer requests
over the "flash" channel using the Task 3 FMC backend. The client app,
system_image, and tests are added by the next task.
Completes the pinmux-ownership change already present in the flash test
image (system.json5 no longer maps the SCU into the server process): the
backend driver no longer touches the shared SCU; PINCTRL_FMC_QUAD is
applied once by the kernel target before any process starts.
@rusty1968

Copy link
Copy Markdown
Collaborator Author

Your code is explicitly dependent of the std crate. Just take a look at producer : Vec<Box> is double heap here — the Vec allocates the array and each Box allocates a provider. We do not have a memory allocator in an embedded environment. OpenPRoT is no alloc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants