@@ -154,8 +154,8 @@ struct Pins {
154154// Static and Const Data
155155// -----------------------------------------------------------------------------
156156
157- /// The BIOS version string
158- static BIOS_VERSION : & str = concat ! ( "Neotron Pico BIOS version " , env!( "BIOS_VERSION " ) , "\0 " ) ;
157+ /// Version string auto-generated by git.
158+ static VERSION : & str = include_str ! ( concat!( env!( "OUT_DIR " ) , "/version.txt" ) ) ;
159159
160160/// Ensures we always send a unique read request
161161static USE_ALT : UseAlt = UseAlt :: new ( ) ;
@@ -168,11 +168,14 @@ static HARDWARE: Mutex<core::cell::RefCell<Option<Hardware>>> =
168168
169169/// This is our Operating System. It must be compiled separately.
170170///
171- /// The RP2040 requires an OS linked at `0x1002_0000`, which is the OS binary
172- /// `flash1002`. Use `objdump` as per the README file to make a `flash1002.bin`.
171+ /// The RP2040 requires an OS linked at `0x1002_0000` and compiled for the
172+ /// `thumbv6m-none-eabi` target. You should therefore use the binary
173+ /// `thumbv6m-none-eabi-flash1002-libneotron_os.bin` from
174+ /// <https://github.com/Neotron-Compute/Neotron-OS/releases>
173175#[ link_section = ".flash_os" ]
174176#[ used]
175- pub static OS_IMAGE : [ u8 ; include_bytes ! ( "flash1002.bin" ) . len ( ) ] = * include_bytes ! ( "flash1002.bin" ) ;
177+ pub static OS_IMAGE : [ u8 ; include_bytes ! ( "thumbv6m-none-eabi-flash1002-libneotron_os.bin" ) . len ( ) ] =
178+ * include_bytes ! ( "thumbv6m-none-eabi-flash1002-libneotron_os.bin" ) ;
176179
177180/// The table of API calls we provide the OS
178181static API_CALLS : common:: Api = common:: Api {
@@ -258,8 +261,8 @@ fn main() -> ! {
258261 // Needed by the clock setup
259262 let mut watchdog = hal:: watchdog:: Watchdog :: new ( pp. WATCHDOG ) ;
260263
261- // BIOS_VERSION has a trailing `\0` as that is what the BIOS/OS API requires.
262- info ! ( "{} starting..." , & BIOS_VERSION [ 0 .. BIOS_VERSION . len ( ) - 1 ] ) ;
264+ // VERSION has a trailing `\0` as that is what the BIOS/OS API requires.
265+ info ! ( "Neotron BIOS {} starting..." , VERSION . trim_matches ( '\0' ) ) ;
263266
264267 // Run at 126 MHz SYS_PLL, 48 MHz, USB_PLL. This is important, we as clock
265268 // the PIO at ÷ 5, to give 25.2 MHz (which is close enough to the 25.175
@@ -824,7 +827,7 @@ fn sign_on() {
824827
825828 tc. move_to ( 0 , 0 ) ;
826829
827- writeln ! ( & tc, "{}" , & BIOS_VERSION [ 0 .. BIOS_VERSION . len ( ) - 1 ] ) . unwrap ( ) ;
830+ writeln ! ( & tc, "Neotron Pico BIOS {}" , VERSION . trim_matches ( '\0' ) ) . unwrap ( ) ;
828831 write ! ( & tc, "{}" , LICENCE_TEXT ) . unwrap ( ) ;
829832
830833 let bmc_ver = critical_section:: with ( |cs| {
@@ -876,7 +879,7 @@ pub extern "C" fn api_version_get() -> common::Version {
876879/// a Rust string. It is unspecified as to whether the string is located
877880/// in Flash ROM or RAM (but it's likely to be Flash ROM).
878881pub extern "C" fn bios_version_get ( ) -> common:: ApiString < ' static > {
879- common:: ApiString :: new ( BIOS_VERSION )
882+ common:: ApiString :: new ( VERSION )
880883}
881884
882885/// Get information about the Serial ports in the system.
0 commit comments