What does "bare metal" mean to you?

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To me, "bare metal" has always meant, "without an Operating System".

 

 

But, just now, stevech wrote:

With ARM Cortex MCUs, one does not muck with registers like on an AVR.

Use vendor-provided Hardware Abstraction Libraries (HAL), for every peripheral I/O device on the chip.

AVR was bare-metal.

ARM, is not.

 

https://www.avrfreaks.net/comment...

 

Which seems to suggest that, to stevech, "bare metal" means, "without the use of a HAL".

 

Just wondered what others think when they use the term, "bare metal" - are there varying degrees of "bareness" ... ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For me it's a question of context.

 

On "big iron" I might well agree with you that "bare metal" means "without an OS".

 

On small micros I use it to mean "without the manufacturer supplied support library" (because they are usually shit).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Oh look - an OS called "BareMetal"

 

http://www.returninfinity.com/ba...

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

On small micros I use it to mean "without the manufacturer supplied support library" (because they are usually shit).

 

Same here. I use it to mean that I...

 

a) Read, study and inwardly digest the datasheet/reference manual

b) Work out how I want my peripherals configured

c) Write code to set bits in registers to achieve that

 

Interestingly, I've just been reading a selection guide for another family of 8-bit uCs and it said...

Quote:

Variations in interrupt response time can cause adverse effects in some applications, causing, for example, audio distortion or motor noise and vibration. With the xxx it’s easy to work “close to the metal” and have full control over the entire system.

 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I am respraying my car and i am at the stage now were i have it back to "bare metal" wink

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Actually when you think about it "bare metal" always really means the same thing. It's a question of whether you are making direct writes to control registers in the silicon (metal) or not. In the small MCU/HAL case you aren't because you call gpio_set_mode() and it does the GPIO3_CTRL = 0x55 or whatever for you. While in the big iron/OS case the reason you can't do GPIO3_CTRL = 0x55 is simply because it's likely protected in ring 0. So I imagine if you use big+OS but then write ring0 level code that runs inside the kernel you might still call that "bare metal". As it happens you almost never need to (certainly for all the SoC peripherals anyway) because the manufacturer already supplied a BSP and if you need to access GPIO3 there's probably a /sy/gpio/port3 or a /dev/gpio3 implemented that you access it via - thus taken you out of reach of direct metal contact.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
I use it to mean that I...

 

a) Read, study and inwardly digest the datasheet/reference manual

b) Work out how I want my peripherals configured

I have yet to find a manufacturer's "HAL" where that can be dispensed with - so I think I'm still justified in saying "bare metal" and using a "HAL"?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess that it just mean a layer lower! 

 

With a program on an OS on top and all the way down to full custom VLSI, with some n steps between. 

 

And for me personally it means that it's time to change brake pads. 

Last Edited: Wed. Aug 12, 2015 - 12:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can we say there's varying degrees of 'metal'? Heavy metal, thrash metal, Lemmy..........

Recently, i wanted to bash some bits reasonably fast on a m0. It was sluggish using the hal code that was provided, so that sent me down a path to see what is really happening and what could be achieved. Along the way I learnt a little about cortex architecture. In one instance i used the hal as i needed delays.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...are there varying degrees of "bareness" ... ?

LOL.  Around here, in Wisconsin USA there is Illinois to the south and upper Michigan to the north. There is an often heard phrase "up north", as in "I'm going Up North for a long weekend."

 

I've decided that "up north" is relative. ;)  Central Illinois people might mean going to the lake country near the northern border of the state.  Those from that area might mean traveling to southern Wisconsin; e.g. Lake Geneva.  Southern Wisconsin people might mean central Wisconsin; and so forth.

 

On a family vacation in Upper Michigan, very near Lake Superior, I overheard locals in the motel say that they were heading "up north".  Now, that one puzzled me a bit.

 

==============

Google indeed finds references for 'definition "bare metal" programming', very much along the lines of the responses here.  My first thoughts included "awareness"--do I really know what is happening throughout my app?  E.g., I can write an Arduino sketch and not know how things are happening under the hood.  If, however, I know that the mentioned gpio_set_mode() resolves directly to GPIO3_CTRL = 0x55, then I'd still consider that bare metal and the HAL is just organization.

 

Degrees of bareness.;)  If one uses a C compiler and hasn't studied and "agreed with" the prologue sequence, can you say you are "bare metal"?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Can we say there's varying degrees of 'metal'?

Or, as I suggested earlier, varying degrees if "bareness"

 

laugh

 

Quote:
Along the way I learnt a little about cortex architecture. In one instance i used the hal as i needed delays.

 

Yes - my "bare metal" tends to be a combination of both "stark naked" (direct register) where required, and "scantily clad" (HAL) otherwise.

 

I think these metaphors could be getting a bit risqué ...

 

blush

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Aug 12, 2015 - 01:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

Can we say there's varying degrees of 'metal'? Heavy metal, thrash metal, Lemmy..........

I think that we can all agree that nothing and no one is more metal than Lemmy.

 

 

 

 

 

×

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's a question of whether you are making direct writes to control registers in the silicon (metal) or not.

Yeah.  What Clawson said.  I wouldn't say that either Arduino or ASF was "bare metal programming", but I wouldn't really consider either one as providing an "OS", either.  (although, defining "OS" gets to be another problem.)

 

I guess you can tell whether you're programming "bare metal" by whether you spend more time referring to the hardware documents, or to software documents...