Author Topic: Register Tinkering or Vendor Library for products  (Read 1480 times)

0 Members and 1 Guest are viewing this topic.

Offline BlackwhIspTopic starter

  • Newbie
  • Posts: 1
  • Country: dk
Register Tinkering or Vendor Library for products
« on: August 30, 2016, 07:19:53 am »
Hey Guys

I've not done much in micrcontroller development for the past five years, but have just decided to develope a prototype of a potential product.

I've aquired one of those arm m0 development boards and looked at the (stm) HAL library which is at a very high abstraction level.
So my question is, have any of you guys ever used any of these High level libraries for any products, beyound the proof of concept stage?
When i did microcontroller work previously, it was register tinkering and our own libraries for each chip, so I'm not sure whether or not these vendor supplied libraries are just for Proof of concept type stuff?
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4223
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Register Tinkering or Vendor Library for products
« Reply #1 on: August 30, 2016, 07:34:38 am »
ST's HAL isn't useful, at all, IMHO.

A genuinely useful vendor library provides at least one of two things:

- compatibility between related (but different) components, to ease code portability

and/or

- a level of abstraction which allows useful objectives to be specified without having to delve into the underlying register map

ST doesn't achieve this. Code written for one processor doesn't run without substantial modification on other parts. Worse still is that the parameters which have to be supplied to the HAL functions closely mirror the register map, so it's really just obfuscating the underlying hardware accesses. I'm afraid I don't agree with you that the HAL library is at a high abstraction level.

Some parts can be useful. You'll need the per-device header files which define the register map, and you can extract these from the projects created by STM32 CubeMX. The auto-generated code to set up the CPU's clock source and PLLs might be useful, though I still elect to replace it with my own code.

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8264
Re: Register Tinkering or Vendor Library for products
« Reply #2 on: August 30, 2016, 10:39:41 am »
I think the ST HAL is certainly at a high abstraction level because of all the indirections alone. Making everything an "object" is part of that. It just isn't a useful level of abstraction.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Register Tinkering or Vendor Library for products
« Reply #3 on: August 30, 2016, 10:54:33 am »
This topic has been discussed extensively and opinions on it vary greatly.

My solution is tobuse vendor libraries but only through s middle layer.

This allows you to swap out vendor libraries for your own for example.
================================
https://dannyelectronics.wordpress.com/
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1668
  • Country: us
Re: Register Tinkering or Vendor Library for products
« Reply #4 on: August 30, 2016, 08:13:32 pm »
Vendor libraries only if you need to deliver something next week. Otherwise write your own from scratch.
Complexity is the number-one enemy of high-quality code.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf