bare-metal

Relocation in assembly

会有一股神秘感。 提交于 2019-12-17 14:13:32
问题 I have a boot-up code for a bare-metal ARM written in assembly and I'm trying to understand how it works. The binary is written in some external Flash, and is copying parts of itself in RAM at boot-up. I still didn't exactly get the concept of relocation in this context, even though I read this wikipedia entry. The RAM is mapped to a low address window, and the flash in a high address window. Can someone explain to me why we test the value of the link register here? /* Test if we are running

Relocation in assembly

纵然是瞬间 提交于 2019-12-17 14:13:09
问题 I have a boot-up code for a bare-metal ARM written in assembly and I'm trying to understand how it works. The binary is written in some external Flash, and is copying parts of itself in RAM at boot-up. I still didn't exactly get the concept of relocation in this context, even though I read this wikipedia entry. The RAM is mapped to a low address window, and the flash in a high address window. Can someone explain to me why we test the value of the link register here? /* Test if we are running

GCC baremetal inline-assembly SI register not playing nicely with pointers

醉酒当歌 提交于 2019-12-13 16:10:03
问题 Well, this is obviously a beginner's question, but this is my first attempt at making an operating system in C (Actually, I'm almost entirely new to C .. I'm used to asm ) so, why exactly is this not valid? As far as I know, a pointer in C is just a uint16_t used to point to a certain area in memory, right (or a uint32_t and that's why it's not working)? I've made the following kernel ("I've already made a bootloader and all in assembly to load the resulting KERNEL.BIN file): kernel.c void

How to code ARM interrupt functions in C

泄露秘密 提交于 2019-12-12 06:08:49
问题 I am using arm-none-eabi-gcc toolchain, v 4.8.2, on LinuxMint 17.2 64b. I am, at hobbyist level, trying to play with a TM4C123G board and its usual features (coding various blinkies, uart things...) but always trying to remain as close to the metal as possible without using other libraries (eg CMSIS...) whenever possible. Also no IDE (CCS, Keil...), just Linux terminal windows, the board and I... All that mostly for education purpose. The issue : I am stuck trying to implement the usual

Cross compile program which uses pthreads for bare metal

喜夏-厌秋 提交于 2019-12-12 01:42:39
问题 OK, this might be a very general question but I'm not to familiar with the topic and happy for any hint. I have a Cross Compiling tool chain from SoucereyCodeBench for ARM ( arm-xilinx-linux-gnueabi-). I cross compiled a library which uses the compiler Options: -DSC_INCLUDE_FX -DSC_USE_PTHREADS -pthreads -fPIC -DPIC So if I want to use the libary for bare metal program I would need pthreads for the bare metal compiler (arm-xilinx-eabi-) I guess? Otherwise my program probally wouldn't run or

Enable neon on ARM cortex-a series

萝らか妹 提交于 2019-12-11 14:46:31
问题 I want to initialize on a bare metal cortex A-15 the NEON cp. After following ARM's directives I wrote this sequence at the end of my platform init sequence: MOV r0, #0x00F00000 MRC p15, 0, r0, c1, c1, 2 ORR r0, r0, #0x0C00 BIC r0, r0, #0xC000 MCR p15, 0, r0, c1, c1, 2 ISB MRC p15, 4, r0, c1, c1, 2 BIC r0, r0, #0x0C00 BIC r0, r0, #(3<<14) MCR p15, 4, r0, c1, c1, 2 ISB MOV r3, #0x40000000 VMSR FPEXC, r3 I get this error: Error: operand 0 must be FPSCR -- `vmsr FPEXC,r3' I am using arm-eabi-as

Linking GMP into a baremetal program

我与影子孤独终老i 提交于 2019-12-11 10:56:43
问题 I have some code which relies on a library, namely the University of Tsukuba Elliptic Pairing Library. This library itself relies on GMP. I'd like to run this program baremetal on an ARM core, specifically on a beaglebone black. GMP is a massive library, so I'd prefer to cross-compile if possible. I'd also prefer something other than the ``brute force" solution of simply dumping the entire GMP source code into the same file as my program and pushing it into arm-none-eabi-gcc. What is the

How to provide a web site as a single file?

不羁的心 提交于 2019-12-11 07:06:17
问题 I have a bare-metal application running on a tiny 16 bit microcontroller (St10) with 10BASE-T Ethernet (CS8900) and a Tcp/IP implementation based upon the EasyWeb project. There is a tiny webserver implemented for displaying some status information of the device and also allows to change settings et cetera. For browser access, the webserver provides some files like index.html , *.css , *.js , *.svg , *.png and so on. As the bare-metal target has no storage media like a sd-card, I put all of

Stdio/Stdlib still linking after passing -ffreestanding and -nostdlib flags to linker

橙三吉。 提交于 2019-12-11 04:42:57
问题 I'm trying to compile a bare metal application for an ARM c Cortex-M3 processor and I'm having trouble setting up the compiler/link flags. I'm on Ubuntu Trusty, using arm-none-eabi-gcc compiler 4.9.3 20150529. Here is my main.c: #include <stdio.h> void main() { printf("Hello, world"); } // Tons of clock initialization code ... And here is the generated link command: arm-none-eabi-gcc -mthumb -mcpu=cortex-m3 -mlittle-endian -g -ggdb -T /home/user/hello-arm/cmake/../ldscripts/STM32F100XB_FLASH

Entering sleep mode on arm cortex m4

坚强是说给别人听的谎言 提交于 2019-12-10 17:57:02
问题 I'm trying to put a cortex m4 processor to sleep for a little less than a second. I want to be able to tell it to sleep, then a second later, or when a button is pressed, pick up right where I left off. I've looked in the reference manual and VLPS mode looks like it would fit my needs. I don't know how to begin to enter that mode or how to program the NVIC . More Info: I am doing this in C, on the bare metal. 回答1: You can download and inspect the code that implements this demo. Although the