cortex-m

Convert DWT cycle count to time using STM32 and HAL

醉酒当歌 提交于 2021-02-11 17:01:58
问题 I am developing on STM32F302R8 in FreeRTOS. I am using the following DWT code from here to profile execution time. My DWT cycle count seems to be working, but I am unsure how to convert it into seconds. From what I gathered online, it seems like the cycle count is based on the CPU frequency. Which HAL function will return the correct CPU frequency for me? I am thinking that it's one of the following uint32_t HAL_RCC_GetSysClockFreq(void); uint32_t HAL_RCC_GetHCLKFreq(void); uint32_t HAL_RCC

Problem cross-compiling trivial example with gcc when using hard float

南楼画角 提交于 2021-01-28 04:42:20
问题 When I try to compile a trivial example test.c int main () { return 0; } for a cortex m7 target with hard float ABI by using the following invocation arm-none-eabi-gcc -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard --specs=nosys.specs test.c I get this error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o: Conflicting CPU architectures 13/1 /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld

what is Interruptible-restartable instructions in ARM cortex m0/m0+

怎甘沉沦 提交于 2020-05-15 10:25:48
问题 I am currently reading ARM Cortex M0+ User Guide on ARM website shown below http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/CHDBIBGJ.html In User Manual, following paragraph is mentioned: Interruptible-restartable instructions The interruptible-restartable instructions are LDM, STM, PUSH, POP and, in 32-cycle multiplier implementations, MULS. When an interrupt occurs during the execution of one of these instructions, the processor abandons execution of the instruction.

What determines where the exception frame goes on Cortex-M4?

半腔热情 提交于 2020-04-17 21:47:47
问题 I'm struggling with an exception stack frame writing over my local/automatic/stack variables. I'm using FreeRTOS 8.2.1 and Microchip ASF for SAM4L Developing with Eclipse MCU 2018/09 and Segger J-Link 6.40. [EDIT] The very first time through the loop, r7 has a different value (0x200044D0), which looks like it might be the correct value (same as SP). I'm thinking now that r7 is being changed while waiting on an RTOS message queue, which happens at the top of the loop (but not the first time

Arm及Arm Cortex-M处理器

允我心安 提交于 2020-03-08 09:47:31
https://mp.weixin.qq.com/s/sRio4NPTSj4oVq2YtM_c1g 1 Arm 处理器架构 从大的方面讲,Arm公司共出过八种处理器架构,其中V1-V3架构,是ARM诞生之初的架构,已经过时而废,目前最新的架构师V8,V9也许不久的将来会发布。其中V6,V7,V8架构又分为M系列,A系列和R系列。 2 Arm 处理器 早期的处理器现在被称为经典处理器,例如曾经广泛使用的arm7/arm9/arm11处理器。现在主要的是Arm Cortex 系列,又分为3类: Cortex-M: 嵌入式处理器 Cortex-A: 应用处理器 Cortex-R: 实时处理器 上图中Cortex-M系列没有罗列出M23,M33,M35P以及M55。 3 Arm Cortex处理器ARM A, R,M系列处理器应用领域不同,这是由这些处理器的特点决定的。 4 Arm Cortex-M处理器 在嵌入式领域,Cortex-M处理器被广泛使用。Cortex-M处理器系列针对低成本和高能效的微控制器进行了优化。这些处理器可用于各种应用,包括物联网,工业和日常消费类设备。 目前ARM Cortex-M最新的处理器是Cortex-M55,Arm Cortex-M55处理器是具有AI功能的Cortex-M处理器,并且是第一个采用Arm Helium矢量处理技术的功能

痞子衡嵌入式:ARM Cortex-M内核那些事(3.3)- 为AI,ML而生(M55)

雨燕双飞 提交于 2020-02-11 00:54:36
  大家好,我是痞子衡,是正经搞技术的痞子。今天痞子衡给大家介绍的是 ARM Cortex-M55 。   鼠年春节,大家都在时刻关心 2019nCoV 疫情发展,没太多心思搞技术,就在这个时候,ARM 不声不响搞了个大新闻,如果你登录 ARM developer 网站,会发现 Cortex-M 家族多了一个新成员:Cortex-M55   这个 Cortex-M55 到底是什么来头?之前可是一点消息都没有啊!这个命名看起来像是 Cortex-M33/M35P 的大哥,但说不定也可能是 Cortex-M7 的大哥,反正自从 Cortex-M23 出来也是搞不懂 ARM 什么命名套路了,为了解开心头疑惑,让我们去一探究竟,直接打开Cortex-M55的模块框图:   模块框图乍一看似乎没什么新意,内核架构是 ARMv8.1-M mainline,看名字像是 ARMv8-M mainline 的小升级(流水线从 3 级变 4 级了,性能应该有点提升,查一下跑分确实从 4.02 CoreMark/MHz 提升到了 4.2 CoreMark/MHz),另外看到 TrustZone 在压阵,那基本就是 Cortex-M33 的大哥没得跑了。咱们再去查查 Cortex-M55 具体特性:   看到这基本才知道 Cortex-M55 是什么来头,Cortex-M55 中引入了 I/D-TCM

Generate sine signal in C without using the standard function

心已入冬 提交于 2020-01-30 19:37:06
问题 I want to generate a sine signal in C without using the standard function sin() in order to trigger sine shaped changes in the brightness of a LED. My basic idea was to use a lookup table with 40 points and interpolation. Here's my first approach: const int sine_table[40] = {0, 5125, 10125, 14876, 19260, 23170, 26509, 29196, 31163, 32364, 32767, 32364, 31163, 29196, 26509, 23170, 19260, 14876, 10125, 5125, 0, -5126, -10126,-14877, -19261, -23171, -26510, -29197, -31164, -32365, -32768, -32365

Generate sine signal in C without using the standard function

大城市里の小女人 提交于 2020-01-30 19:37:05
问题 I want to generate a sine signal in C without using the standard function sin() in order to trigger sine shaped changes in the brightness of a LED. My basic idea was to use a lookup table with 40 points and interpolation. Here's my first approach: const int sine_table[40] = {0, 5125, 10125, 14876, 19260, 23170, 26509, 29196, 31163, 32364, 32767, 32364, 31163, 29196, 26509, 23170, 19260, 14876, 10125, 5125, 0, -5126, -10126,-14877, -19261, -23171, -26510, -29197, -31164, -32365, -32768, -32365