Code Monkey home page Code Monkey logo

stm32f103-vga-rs's People

Contributors

abelykh0 avatar sbechet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sbechet

stm32f103-vga-rs's Issues

not enough memory? or How to create Resource object directly in heap w/o using Stack

Hello,

I tried to test your example. Very interesting!

Nevertheless i can't make it work. It seems to be a memory problem :
stm32f103 is 20KB only.

  • 13024 bytes for pixels
  • 1628 bytes for attributes
  • 320 bytes for attribute_definitions
    14972 bytes + some reserved types rust bytes

let mut display = VgaDisplay { create a 14972 bytes stack entry then init::LateResources { seems to do a memcpy at fixed Resources space in memory heap as we can see directly in ghidra :

0800047a 09 f1 36 00     add.w      r0,r9,#0x36
0800047e 29 46           mov        r1,r5
08000480 43 f6 7c 22     movw       r2,#14972
08000484 00 f0 9e f8     bl         compiler_builtins::compiler_builtins::arm::__a   undefined __aeabi_memcpy()

So we have an overlap between heap and stack.

A solution can be not to create stack display.

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/myhome/rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

thumbv7m-none-eabi
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.42.0 (b8cedc004 2020-03-09)


$ rustup default
stable-x86_64-unknown-linux-gnu (default)

$ rustc --version
rustc 1.42.0 (b8cedc004 2020-03-09)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.