arm

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

How can I change the precission of a floating point number in ARM Assembly?

谁说我不能喝 提交于 2020-04-16 04:30:46
问题 I am currently studying computer sciense and in one of my classes (Computer Arquitecture) i am asked to make a function (in ARM assembly) that shows te result of multipying euler to a power (input). In this question they tell me that the result must be calculated with a precission of 0.001, the thing is, i don't know how to do that. If anyone could show me how it would be much apreciated. 来源: https://stackoverflow.com/questions/60645429/how-can-i-change-the-precission-of-a-floating-point

How can I change the precission of a floating point number in ARM Assembly?

让人想犯罪 __ 提交于 2020-04-16 04:29:25
问题 I am currently studying computer sciense and in one of my classes (Computer Arquitecture) i am asked to make a function (in ARM assembly) that shows te result of multipying euler to a power (input). In this question they tell me that the result must be calculated with a precission of 0.001, the thing is, i don't know how to do that. If anyone could show me how it would be much apreciated. 来源: https://stackoverflow.com/questions/60645429/how-can-i-change-the-precission-of-a-floating-point

随笔之GoldFish Kernel启动过程中arm汇编分析

本秂侑毒 提交于 2020-04-09 09:46:11
随笔之 GoldFish Kernel 启动过程中 arm 汇编分析 一 分析 电子版下载 http://download.csdn.net/detail/innost/4834459 本节介绍 Kernel 启动。此时 Piggy 已经将 vimlinux 解压, BL 将执行权限传给了 Kernel 。 代码在 arch/arm/kernel/head.S 中。相关代码如下: // 将采用 C/C++ 注释语句 /* .section是GNU ASM的语法。格式如下: .section name[,"flags"[,@type]] 其中,name是必须的,flags是可选。 "ax"表示:a为section is allocatable,x为executable。 */ .section ".text.head", "ax" //这个ENTRY(stext)有相当的含义。在kernel/vmlinux.ld.S中,也定义了一个ENTRY。在ld //语法中,ENTRY是一个command,用来定义入口点。所以,这里就是kernel执行的入口点函数。 ENTRY(stext) /* MSR:是ARM汇编指令,用来将数据copy到status register寄存器中。cpsr_c表示要操作 CPSR寄存器的Control标志。 */ msr cpsr_c, #PSR_F_BIT

How do interrupts work in multi-core system?

核能气质少年 提交于 2020-04-08 10:37:43
问题 I want to write code for interrupts of the buttons on Raspberry pi 2. This board uses QUAD Core Broadcom BCM2836 CPU (ARM architecture). That mean, only one CPU is on this board( Raspberry pi 2 ). But I don't know how do interrupts in multi-core system. I wonder whether interrupt line is connected to each core or one CPU. So, I found the paragraph below via Google. Interrupts on multi-core systems On a multi-core system, each interrupt is directed to one (and only one) CPU, although it doesn

【STM32H7的DSP教程】第7章 ARM DSP源码和库移植方法(IAR8)

浪子不回头ぞ 提交于 2020-04-07 16:42:02
完整版教程下载地址: http://www.armbbs.cn/forum.php?mod=viewthread&tid=94547 第7章 ARM DSP源码和库移植方法(IAR8) 本期教程主要讲解ARM官方DSP源码和库的移植以及一些相关知识的介绍。 7.1 初学者重要提示 7.2 DSP库的下载和说明 7.3 DSP库版本的区别 7.4 DSP库的几个重要的预定义宏含义 7.5 DSP库在IAR上的移植(源码移植方式) 7.6 DSP库在IAR上的移植(库移植方式) 7.7 升级到最新版DSP库方法 7.8 简易DSP库函数验证 7.9 总结 7.1 初学者重要提示 IAR请使用8.30及其以上版本,CMSIS请使用5.6.0及其以上版本。 IAR的工程创建,下载和调试方法,在V7用户手册有详细说明: http://www.armbbs.cn/forum.php?mod=viewthread&tid=93255 。 7.2 DSP库的下载和说明 下面详细的给大家讲解一下官方DSP库的移植。 7.2.1 DSP库的下载 DSP库是包含在CMSIS软件包(Cortex Microcontroller Software Interface Standard)里面,所以下载DSP库也就是下载CMSIS软件包。这里提供三个可以下载的地方: 方式一:STM32CubeH7软件包里面。

How to prevent “main.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text'” when creating an aarch64 baremetal program?

三世轮回 提交于 2020-04-07 07:39:53
问题 When playing with creating baremetal executables, I hit this error: main.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text' collect2: error: ld returned 1 exit status I then managed to create a minimal reproduction example: main.c void _start(void) {} notmain.S .skip 32 link.ld ENTRY(_start) SECTIONS { .text : { */bootloader.o(.text) *(.text) *(.rodata) *(.data) *(COMMON) } .bss : { *(.bss) } heap_low = .; . = . + 0x1000000; heap_top = .; . = . + 0x1000000;

How to prevent “main.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text'” when creating an aarch64 baremetal program?

那年仲夏 提交于 2020-04-07 07:39:30
问题 When playing with creating baremetal executables, I hit this error: main.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text' collect2: error: ld returned 1 exit status I then managed to create a minimal reproduction example: main.c void _start(void) {} notmain.S .skip 32 link.ld ENTRY(_start) SECTIONS { .text : { */bootloader.o(.text) *(.text) *(.rodata) *(.data) *(COMMON) } .bss : { *(.bss) } heap_low = .; . = . + 0x1000000; heap_top = .; . = . + 0x1000000;

ARM指令集----杂项指令

纵然是瞬间 提交于 2020-04-07 05:35:59
ARM指令集可以分为6类,即是跳转指令,数据处理指令,程序状态传输指令,Load、Store指令,协处理器指令和异常中断指令 跳转指令: 在ARM中有两种方式可以实现程序的跳转,一种是跳转指令,另一种是直接向PC寄存器写入目标地址的值 通过直接向PC寄存器写入目标寄存器的数字可以实现在4GB 地址空间的任意跳转,这种跳转又称为长跳转,如果在残肢令前面使用MOV LR,PC等指令,可以保存返回来的地址值,这样就实现了在4GB空间中的子程序调用 ARM的跳转指令可以从当前指令向前或者是向后的32位的地址进行空间跳转,这类跳转指令有一下4种 B 跳转指令 BL带换回的跳转指令 BLX 带返回的跳转和切换指令 BX 带状态切换的跳转指令 B和BL的区别在于,L决定是否将PC寄存器的数字保存到LR寄存器中, BL指令用于实现子程序的调用,子程序的返回地址可以将LR寄存器的值复制到PC寄存器来实现 数据处理指令 数据处理指令包括如下指令   MOV 数据传送指令   MVN 数据求反传送指令:MVN指令有以下用途:先寄存器传递一个负数,生成位的掩码,求一个数的反码   CMP 比较指令:   CMN 基于相反数的比较指令   TST 位测试指令 :TST指令通常是用于测试寄存器中某些位是1还是0   TEQ 测试相等指令:TEQ用来比较两个数是否相等ORR指令   ADD 加法指令

Why this code run into infinite loop in ARM

大憨熊 提交于 2020-04-07 05:17:25
问题 I am learning ARM assembly and compiled a code which simply ran a loop 5 times but when ran it goes to infinite loop .global main main: push {ip.lr} sub r1,r1,r1 well: ldr r0,=message bl printf add r1,r1,#1 cmp r1,#6 bne well pop {ip,pc} message: .ascii "Amit Singh Tomar\n" Why this code runs in to infinite Loop? 回答1: printf call destroys your r1 . Save your loop invariant in non-scratch register. 回答2: R1 gets trashed by the call to printf - use a non-volatile register instead or save/restore