cortex-m | Low level access to Cortex-M processors
kandi X-RAY | cortex-m Summary
kandi X-RAY | cortex-m Summary
Low level access to Cortex-M processors. This project is developed and maintained by the Cortex-M team.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cortex-m
cortex-m Key Features
cortex-m Examples and Code Snippets
Community Discussions
Trending Discussions on cortex-m
QUESTION
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:23The last gcc
run ...
QUESTION
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:20Per @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.
QUESTION
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:29As 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).
QUESTION
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:57I fixed it by removing COPY
and adding NOLOAD
to the stack section. It builds and runs fine both with gcc and clang.
QUESTION
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:36Files are generated from input template.
Create a file inputfile
:
QUESTION
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:
- After restart - MCU has to check vector table and execute reset handler, where I initialize stack pointer.
- 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:
- What has to be corrected in linker script
- Correct vtable and handler execution sequence.
Code:
...ANSWER
Answered 2021-Dec-21 at 22:14For what you are doing you can start simpler.
flash.s
QUESTION
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:16The 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:
QUESTION
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:24C 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.
QUESTION
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:31TLDR: 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.
QUESTION
I have some C code that processes data bit-by-bit. Simplified example:
...ANSWER
Answered 2021-Jul-31 at 16:05If 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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cortex-m
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page