[<<][arm][>>][..]
Sat Sep 15 10:18:42 EDT 2018

uc_tools bootloader + rust code?

What is needed to load a piece of rust code onto the STM32 boot
loader?  Say I want to write the serial port handler.

So it needs to be able to:
- go at a phsical address and find a structure there
- set the function points to point into rust code

The first is simple, the rest I don't know how to do.

How can C code call a Rust function?


https://users.rust-lang.org/t/how-to-call-rust-library-in-c/11436


#[no_mangle]
extern "C" fn foo() {
    // stuff
}

http://greyblake.com/blog/2017/08/10/exposing-rust-library-to-c/

Maybe the simplest way is to create a static library.

https://doc.rust-lang.org/cargo/reference/manifest.html#building-dynamic-or-static-libraries


Practically, start with git/armboot, and produce an .a library
exposing read and write functions.  Then write a small C wrapper to
glue it together.

It's not git/armboot.  This is old code.




[Reply][About]
[<<][arm][>>][..]