From 69c4294f70c2ffa56dda199e03c2b93c8ff0b747 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 18 Jun 2024 09:26:22 +0100 Subject: [PATCH] Fix spiFlash type mismatch warning during init (#2809) This PR makes a small change to Host builds, enabling all `debug_x` statements during init/exit. This highlights one issue, fixed, caused by missing device entry in Rp2040, Host hardware configs: ``` [Device] 'spiFlash' type mismatch, 'unknown' in partition table but device reports 'flash' ``` --- Sming/Arch/Host/Components/hostlib/startup.cpp | 4 +++- Sming/Arch/Host/standard.hw | 7 ++++++- Sming/Arch/Rp2040/standard.hw | 9 ++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Sming/Arch/Host/Components/hostlib/startup.cpp b/Sming/Arch/Host/Components/hostlib/startup.cpp index 3fce4bec04..f74fdf3405 100644 --- a/Sming/Arch/Host/Components/hostlib/startup.cpp +++ b/Sming/Arch/Host/Components/hostlib/startup.cpp @@ -246,6 +246,8 @@ int main(int argc, char* argv[]) } } + m_setPuts(&host_nputs); + host_debug_i("\nWelcome to the Sming Host emulator\n\n"); auto i = get_first_non_option(); @@ -309,7 +311,7 @@ int main(int argc, char* argv[]) pause(config.exitpause); // Avoid issues with debug statements whilst running exit handlers - m_setPuts(nullptr); + m_setPuts(&host_nputs); return exitCode; } diff --git a/Sming/Arch/Host/standard.hw b/Sming/Arch/Host/standard.hw index 7244be0578..287e348737 100644 --- a/Sming/Arch/Host/standard.hw +++ b/Sming/Arch/Host/standard.hw @@ -3,7 +3,12 @@ "arch": "Host", "bootloader_size": "0x2000", "partition_table_offset": "0x2000", - "options": ["4m"], + "devices": { + "spiFlash": { + "type": "flash", + "size": "4M" + } + }, "partitions": { "rom0": { "address": "0x008000", diff --git a/Sming/Arch/Rp2040/standard.hw b/Sming/Arch/Rp2040/standard.hw index d143cd3ba0..2955c37e9d 100644 --- a/Sming/Arch/Rp2040/standard.hw +++ b/Sming/Arch/Rp2040/standard.hw @@ -4,9 +4,12 @@ "arch": "Rp2040", "bootloader_size": 0, "partition_table_offset": "self.devices[0].size - 0x1000", - "options": [ - "2m" - ], + "devices": { + "spiFlash": { + "type": "flash", + "size": "2M" + } + }, "partitions": { "rom0": { "address": 0,