blob: d0c7ab0614912df8b990b533dc3b6851bea8816a [file]
// Licensed under the Apache-2.0 license
// SPDX-License-Identifier: Apache-2.0
// AST10x0 USART Service Configuration
// ARM Cortex-M4 @ 200 MHz with 768KB SRAM (0x00000000 - 0x000BFFFF)
// NOTE: AST10x0 does not support XIP - firmware executes from RAM.
//
// PMSAv7-Friendly Memory Layout:
// 0x00000000 - 0x00000500: Vector table (1280 bytes)
// 0x00000500 - 0x00020000: Kernel code (~126KB, ends at 128KB boundary)
// 0x00020000 - 0x00060000: USART app flash (256KB)
// 0x00060000 - 0x00080000: Kernel RAM (128KB)
// 0x00080000 - 0x000A0000: App RAM (128KB)
{
arch: {
type: "armv7m",
vector_table_start_address: 0x00000000,
vector_table_size_bytes: 1280, // 0x500
},
kernel: {
flash_start_address: 0x00000500, // After vector table
flash_size_bytes: 129792, // ~126KB (ends at 0x00020000)
ram_start_address: 0x00060000, // After all flash regions
ram_size_bytes: 131072, // 128KB
},
apps: [
{
name: "usart_server_bin",
flash_size_bytes: 131072, // 128KB for server code
processes: [
{
name: "usart_server_process",
ram_size_bytes: 65536, // 64KB RAM
objects: [
{
// Multiplex channel and IRQ events in the server loop.
name: "wg",
type: "wait_group",
},
{
name: "usart",
type: "channel_handler", // Server side of client→server channel
},
{
name: "usart2",
type: "channel_handler", // Server side of client2→server channel
},
{
// AST1060 UART interrupt line (covers UART instances including UART5).
// Source: ast1060_pac::Interrupt::uart = 8
name: "uart5_irq",
type: "interrupt",
irqs: [
{
name: "uart",
number: 8,
},
],
},
{
type: "thread",
name: "usart_server_thread",
kernel_stack_size_bytes: 4096, // 4KB stack
},],
memory_mappings: [
{
// AST1060 UART5 (debug UART, 16550-compatible)
name: "uart5",
type: "device",
start_address: 0x7e784000,
size_bytes: 0x1000,
},
],
},
],
},
{
name: "usart_client_app",
flash_size_bytes: 65536, // 64KB for client code
processes: [
{
name: "usart_client_process",
ram_size_bytes: 32768, // 32KB RAM
objects: [
{
name: "usart",
type: "channel_initiator",
handler_process: "usart_server_process",
handler_object_name: "usart",
},
{
type: "thread",
name: "usart_client_thread",
kernel_stack_size_bytes: 2048,
},],
},
],
},
{
name: "usart_client2_app",
flash_size_bytes: 65536, // 64KB for second client code
processes: [
{
name: "usart_client2_process",
ram_size_bytes: 32768, // 32KB RAM
objects: [
{
name: "usart",
type: "channel_initiator",
handler_process: "usart_server_process",
handler_object_name: "usart2",
},
{
type: "thread",
name: "usart_client2_thread",
kernel_stack_size_bytes: 2048,
},],
},
],
},
],
}