cortex-m | Low level access to Cortex-M processors

 by   rust-embedded Rust Version: v0.7.7 License: Apache-2.0

kandi X-RAY | cortex-m Summary

kandi X-RAY | cortex-m Summary

cortex-m is a Rust library. cortex-m has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Low level access to Cortex-M processors. This project is developed and maintained by the Cortex-M team.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              cortex-m has a low active ecosystem.
              It has 643 star(s) with 123 fork(s). There are 34 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 74 open issues and 109 have been closed. On average issues are closed in 99 days. There are 14 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of cortex-m is v0.7.7

            kandi-Quality Quality

              cortex-m has 0 bugs and 0 code smells.

            kandi-Security Security

              cortex-m has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              cortex-m code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              cortex-m is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              cortex-m releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cortex-m
            Get all kandi verified functions for this library.

            cortex-m Key Features

            No Key Features are available at this moment for cortex-m.

            cortex-m Examples and Code Snippets

            No Code Snippets are available at this moment for cortex-m.

            Community Discussions

            QUESTION

            c project makefile multiple definitions error
            Asked 2022-Apr-11 at 13:23

            This question is a repex created corresponding to this problem.

            In my embedded C project I have two separate boards and I want to create two .c files (master.c and slave.c) for each board containing their own specific main() function.

            I've used stm32cumbemx to generate the project with main.c, makefile and other sources and headers (I want to replace main.c with master.c and slave.c manually). this is the folder structure of the project (I deleted slave.c for simplicity):

            ...

            ANSWER

            Answered 2022-Apr-11 at 13:23

            QUESTION

            GNU ARM assembler giving a seemingly irrelevant register in error message
            Asked 2022-Feb-15 at 11:20
            Goal

            I'm building a mutex primitive using gcc inline assembly for a CortexM7 target using the LDREX and STREX instructions, following the Barrier Litmus Tests and Cookbook document from ARM.

            Code ...

            ANSWER

            Answered 2022-Feb-15 at 11:20

            Per @jester's help, I realized I had the wrong constraint on the GCC-inline variable alias for the lock. It should have been "+m", specifying a memory address instead of a register.

            I was also de-referencing the address of the lock when I should have been leaving it as a pointer.

            I changed [lock] "+l"(*lock) to [lock] "+m"(lock) and it now builds.

            Source https://stackoverflow.com/questions/71065708

            QUESTION

            HardFault with STM32 caused through GSL
            Asked 2022-Feb-10 at 13:29

            I successfully cross-compiled the GNU Scientific Library for my STM32F303 with an Arm Cortex M4, as I've described here:

            How to crosscompile GSL for Arm Cortex M4?

            However, this works fine, but now I got for every memory allocation from the GSL an HardFault. For example, this line:

            ...

            ANSWER

            Answered 2022-Feb-10 at 13:29

            As in the comments described, I've used indeed the wrong linker script during cross-compiling (the default linker script). It worked after specifying the linker-script (I had to use the linker-script for the specific MCU).

            Source https://stackoverflow.com/questions/71011160

            QUESTION

            LLVM linker places stack in the wrong place
            Asked 2022-Feb-08 at 09:57

            I am trying to link Cortex-M4 firmware with clang + lld. The gcc build works fine. I am using the stock CMSIS linker script with only RAM & ROM size adjusted (bases are the same). Beginning of the script (without comments):

            ...

            ANSWER

            Answered 2022-Feb-08 at 09:57

            I fixed it by removing COPY and adding NOLOAD to the stack section. It builds and runs fine both with gcc and clang.

            Source https://stackoverflow.com/questions/70097305

            QUESTION

            Same sources, 2 different binaries with a linker script variable
            Asked 2022-Jan-21 at 11:36

            With CMake, I am trying to use the same sources and the same linker script to generate two different binaries.

            ...

            ANSWER

            Answered 2022-Jan-21 at 11:36

            Files are generated from input template.

            Create a file inputfile:

            Source https://stackoverflow.com/questions/70800199

            QUESTION

            STM32F103C8 bare metal with linker scripts GCC
            Asked 2021-Dec-21 at 22:14

            I am trying to write bare metal code in assembly and compile + link it using GCC toolchain. As I know the proper steps is to follow the following steps:

            1. After restart - MCU has to check vector table and execute reset handler, where I initialize stack pointer.
            2. Execute main code. In order to complete this task I also need to have respective linker script. When i am trying to execute linker it throws syntax error. Please advice:
            3. What has to be corrected in linker script
            4. Correct vtable and handler execution sequence.

            Code:

            ...

            ANSWER

            Answered 2021-Dec-21 at 22:14

            For what you are doing you can start simpler.

            flash.s

            Source https://stackoverflow.com/questions/70422764

            QUESTION

            External Flash Loader gets "failed to download Segment[0]" error on STM32CubeIDE
            Asked 2021-Dec-16 at 22:16

            I have made a custom external flash loader(.stldr) file for my STM32 based board and this file works great with ST Link Utility(Read, Write and Erase) are work fine and i can Program the board correctly. But when i try to use the created .stldr file by STM32CubeIDE the erasing process well done but when the downloading process gets start then "failed to download Segment[0]" error pups up.

            Could any one help me with the problem?

            ...

            ANSWER

            Answered 2021-Dec-16 at 22:16

            The Problem was for the version of STM32CubeIDE 1.8

            I downgraded to the STM32CubeIDE1.7 and the problem is solved.

            Edited: I found the problem. According to these pictures(First for STM32CubeIDE 1.8 and Second for STM32CubeIDE 1.7)

            • The STM32CubeIDE 1.8 uses the STM32CubeProgrammer 2.9 and this makes the problems but the STM32CubeIDE 1.7 uses STM32CubeProgrammer 2.8 and it makes every things work fine.

            Solution2:

            Alternative to downgrading stm32CubeIDE from 1.8 to 1.7 version, you can only copy and replace the below directory contents of the STM32CubeIDE 1.7:

            Source https://stackoverflow.com/questions/70342257

            QUESTION

            Wrong definition of UINT16_C in arm-none-eabi-gcc?
            Asked 2021-Oct-29 at 22:24

            I noticed that arm-none-eabi-gcc 10.2 defines the macros UINTN_C in the following way (compiling with -mcpu=cortex-m7 -std=c99 -g3 -O0):

            ...

            ANSWER

            Answered 2021-Oct-29 at 22:24

            C doesn't recognize the notion of a numeric literal whose type is smaller than int and unsigned int. On a platform where int is 32 bits, the expression (uint16_t)123 would behave as type signed int as a result of integer promotion, and it would be somewhat illogical for an expression containing a numeric literal of supposed type uint16_t to behave in a manner inconsistent with the way any other expression of that type would be processed.

            Source https://stackoverflow.com/questions/69582128

            QUESTION

            Precise Time Measurement in STM32MP1 with DWT CYCCNT
            Asked 2021-Sep-02 at 13:31

            I am using OSD32MP1 (based on STM32MP157c) in Production Mode with OpenSTLinux on Core A7 and FreeRTOS on M4. One of the tasks is to timestamp ADC data acquired by M4 at very highspeed, very precisely (think it order of nanosecond to microsecond). Note that only time difference between measurements is important.

            On-chip RTC is available (it is assigned to A7 but registers are accessible to M4). However the subsecond precision is ~0.003s (PREDIV_S is 255 - See Reference Manual for Detail) so it is not good enough.

            This, this and this stackoverflow posts led to using DWT_CYCCNT i.e., CPU Cycle Counter to measure the time time difference. Relevant portions of the code is as following:

            On M4 Side:

            ...

            ANSWER

            Answered 2021-Sep-02 at 13:31

            TLDR: Packet drop between M4 and A7.

            Hi, I ended up solving my own problem with a lot of help from PatrikF at ST Forum who suggested that DWT should work as ARM specifies it to.

            Turned out the problem was very consistent packet drop between M4 and A7, exactly by factor of 2 which resulted in twice the CYCCNT. I wasted too much time looking in wrong direction but at the end of the day, I learnt the importance of packet counter.

            Note that Partrik also added some recommendations on high precision counters in STM:

            Maybe using STGENR is another option independant of Cortex-M4 frequency.

            STGEN is running by default on HSI 64MHz which give you a resolution of about 15ns, but HSI is not an high precision oscillator (+/-1%).

            alternatively, using STGEN on HSE 24MHz which is more precise (few ten of ppm) but give a resolution of about 40ns.

            See also this post: https://community.st.com/s/question/0D53W00000oXAqhSAG/how-can-i-get-access-to-m4-timers-from-a7-linux-is-it-possible-

            As STGEN is read using AXI bus thru async buses from Cortex-m4, it must suffer some ns of additional latency.

            Source https://stackoverflow.com/questions/69009997

            QUESTION

            ARM Cortex M0+: How to use "Branch if Carry" instructions in C-code?
            Asked 2021-Aug-31 at 18:54

            I have some C code that processes data bit-by-bit. Simplified example:

            ...

            ANSWER

            Answered 2021-Jul-31 at 16:05

            If you have specific code you want then...you just write it. Start with the compiled code and hand optimize as desired. The compiler cannot read your mind.

            gcc 5.x.x is where gnu peaked as far as code output, it has gone down hill since. but that does not mean that version is always better than the newer versions. godbolt or just having various ones installed on your computer can help if you are trying to get the compiler to do the work for you.

            Source https://stackoverflow.com/questions/68601363

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install cortex-m

            You can download it from GitHub.
            Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.

            Support

            This crate is guaranteed to compile on stable Rust 1.42 and up. It might compile with older versions but that may change in any new patch release.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rust-embedded/cortex-m.git

          • CLI

            gh repo clone rust-embedded/cortex-m

          • sshUrl

            git@github.com:rust-embedded/cortex-m.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Rust Libraries

            996.ICU

            by 996icu

            deno

            by denoland

            rust

            by rust-lang

            alacritty

            by alacritty

            tauri

            by tauri-apps

            Try Top Libraries by rust-embedded

            rust-raspberrypi-OS-tutorials

            by rust-embeddedRust

            cross

            by rust-embeddedRust

            discovery

            by rust-embeddedRust

            embedded-hal

            by rust-embeddedRust

            cortex-m-quickstart

            by rust-embeddedRust