Questions tagged [bare-metal]

In a bare-metal environment, the software runs directly on the hardware (CPU, microprocessor, etc) without the intermediary layer of an operating system.

There are multiple definitions for the term bare metal, (bare-metal, baremetal). This tag is specific to the definition meaning without an operating system.

https://en.wikipedia.org/wiki/Bare_machine

The software/firmware talks directly to the hardware and peripherals without running on top of an operating system.

A typical use case is firmware running on a microcontroller that manages the peripherals directly and doesnt use an RTOS. Some bootloaders for microprocessors would also fall into this category.

See other tags for bare metal server and other definitions.

539 questions
-1
votes
3 answers

4x4 matrix keypad stm32 cant interface it

I want to interface a keypad in stm32 l053r8 with timer interrupt. I have a SysTick_Handler function which I am handling there the switch debouncing of push buttons and every time the push button counter gets equal to 10 I am using a flag in order…
gregni
  • 417
  • 3
  • 12
-1
votes
1 answer

How to have right arow behavior in a console

I am trying to recreate a line editor in a bare metal environnement : a chip receiving and sending data in an UART. The UART is linked to a keyboard on input and a screen on output. To simulate left arrow, i send the character \b. I cannot find how…
Foxhunt
  • 764
  • 1
  • 9
  • 23
-1
votes
4 answers

Delay implementation in STM32 using for loop

I am using a NUCLEO-L476RG development board, I am learning to write GPIO drivers for STM32 family I have implementing a simple logic in which I need to turn on an LED when a push button is pressed. I have a strange issue: Edit 1:The Bread board LED…
Ashwin Sekar
  • 1
  • 1
  • 5
-1
votes
1 answer

Can I get GCC to create truly position independent ARM32 code?

What I'm after is ARM32 code that I can load and enter at a random memory location, and it will still work. Function calls, access to constants, etc. should be PC-relative, the stack can be anywhere, I don't need global or static variables, but…
Simon Willcocks
  • 308
  • 1
  • 9
-1
votes
1 answer

Can not boot up bare mental Raspberry binary to 0x80000

I want to boot up my bare-metal binary using u-boot with Raspberry Pi 3 Model B. I used fatload command to load my binary to address 0x80000 but the result is CPU resetting U-Boot> fatload mmc 0 0x80000 kernel8.elf 67168 bytes read in 16 ms (4…
rhett
  • 1
  • 2
-1
votes
1 answer

Unit test on a 16-bit embedded target

I am currently trying to evaluate the best way of unit testing some code written for a 16-bit based dsPIC device. The compiler used for compiling the C code for the target is Microchip's XC16. I was not able to find any emulation tools, such as QEMU…
Łukasz Przeniosło
  • 2,725
  • 5
  • 38
  • 74
-1
votes
1 answer

How does malloc know where the first available block is in embedded systems?

I have read that malloc has multiple implementations which are platform depended. How does it work in an embedded device in bare metal programming? Let's suppose we have an mcu with 256KB FLASH memory and 64KB RAM. How does it know how much…
MrBit
  • 290
  • 4
  • 20
-1
votes
2 answers

Is there a compilation option to stop gcc using floating point instructions in integer code?

My integer-only, bare-metal C project just ground to a halt when I got an unexpected exception about a floating point instruction. Looking at the gcc generated code, the culprit is an fmov d0, x0, used to temporarily store a value in a floating…
Simon Willcocks
  • 308
  • 1
  • 9
-1
votes
1 answer

Can I use . as member qualifier in gnu c structures

Is it ok to use . as a member qualifier instead of the symbol -> for structures in GNU c. The compiler does not complain when symbol . used in place of ->.
TonyP
  • 5,655
  • 13
  • 60
  • 94
-1
votes
1 answer

How to use types in embedded C for portable bare metal software

I'm writing my first bare metal application in C for a specific micro controller. I want to make it as much portable as possible and I'm not sure what is the proper way for using the C types. I have two options in mind: Using the typical C standard…
Dan
  • 2,452
  • 20
  • 45
-1
votes
1 answer

Using std::tuple with arm-none-eabi-gcc on a freestanding (bare-metal) project?

It is my understanding that std::pair and std::tuple are basically compile-time constructs that don't require any particular runtime support, and can be implemented (if messily) purely using template constructs. So why is it that when I #include…
Thomas
  • 3,321
  • 1
  • 21
  • 44
-1
votes
1 answer

Accessing pointer variable of one .c file in another standalone .c file without using .h file

Firstly the scenario, my host environment is Linux, target is MAX10 FPGA and running RISCV soft processor and writing software for that. I am writing a simple bootloader in which I have one file main.c where all the functions are defined and another…
kni
  • 17
  • 4
-1
votes
1 answer

malloc() doesn't return null when overruns the HEAP (bare-metal)

I am debugging a bare-metal project on Kinetis TWRK70M120 using Cross ARM GCC toolchain. (Kinetis Design Studio) I have one question: Why malloc() doesn't return NULL pointer when it overruns the heap size? How is that possible? I would not expect…
pyfilekW
  • 1
  • 1
-1
votes
1 answer

Critical section to disable SVC in ARM cortex R

I would like to implement SVC protected critical section in a block of code like below: key = SVC_disable(); ... /* SVC protected critical block of code */ SVC_restore(key); How to implement SVC_disable/restore on cortex R5 ARM Additional…
Badri
  • 1,973
  • 2
  • 14
  • 16
-1
votes
2 answers

ARM Assembly - CMP wrong output

I'm working on a program in ARM assembly (Raspberry pi), but I have a problem. I have this code, but the lower part is always executing (skip$). mov r1, #3 mov r3, #4 add r2, r1, r3 bl Debug cmp r2, #0x0A ble skip$ mov r0, #10 sub r0, r0,…
1 2 3
35
36