Forums

Missing volatile qualifiers in MCU vendor header files?

Started by Dave Nadler April 5, 2020
On 07/04/2020 00:18, Dave Nadler wrote:
> On Monday, April 6, 2020 at 6:09:56 PM UTC-4, David Brown wrote: >> Hey! A cite! I'm famous :-) > > We already knew that ;-) >
Yes - my name is on tractors around the world, the credits of "Jaws", and several dozen Wikipedia entries. All my work :-) More realistically, I have made comments about "volatile" in quite a few places over the years.
On 4/7/2020 04:36, David Brown wrote:
> On 07/04/2020 00:18, Dave Nadler wrote: >> On Monday, April 6, 2020 at 6:09:56 PM UTC-4, David Brown wrote: >>> Hey!  A cite!  I'm famous :-) >> >> We already knew that ;-) >> > > Yes - my name is on tractors around the world, the credits of "Jaws", > and several dozen Wikipedia entries.  All my work :-) > > More realistically, I have made comments about "volatile" in quite a few > places over the years. > >
Remember that fame is volatile. -- Best wishes, --Phil pomartel At Comcast(ignore_this) dot net
On Tuesday, April 7, 2020 at 12:30:56 PM UTC-4, Phil Martel wrote:
> Remember that fame is volatile.
Very nice Phil! We're breathlessly awaiting David Brown's definitive treatise on memory barriers...
On 7.4.20 11:36, David Brown wrote:
> On 07/04/2020 00:18, Dave Nadler wrote: >> On Monday, April 6, 2020 at 6:09:56 PM UTC-4, David Brown wrote: >>> Hey!  A cite!  I'm famous :-) >> >> We already knew that ;-) >> > > Yes - my name is on tractors around the world, the credits of "Jaws", > and several dozen Wikipedia entries.  All my work :-) >
And the 'DB' in Aston Martins. -- -TV
On 04/06/20 15:14, Dave Nadler wrote:
> On Monday, April 6, 2020 at 3:05:47 AM UTC-4, Tauno Voipio wrote: >> Just stay away from the hardware guys' software, write your own. > > Yup, I had to write my own drivers for ST DMA, timer, SPI. > > But it gets quite impractical to write one's own drivers for every > ethernet and USB peripheral set etc... And lots of the vendor > stuff absolutely does not work (ST for example). > > Now if I could only figure out why my release build works, > but not the debug build (reverse of the usual puzzle!)... > Off to check the timing on the scope!
Always write separate header files for the cpu and each of the on chip peripherals as a first task for every new processor. It's a good way to get a top level overview of the machine and capabilities. Had a look at the ST code examples and their obscure header file mess for cortex years ago. Our way or the highway and unusable as presented. Code examples were rubbish as well. May be better now, but still useless if you have a house standard for form and function...
On 2020-04-08, Chris <xxx.syseng.yyy@gfsys.co.uk> wrote:

> Had a look at the ST code examples and their obscure header file > mess for cortex years ago. Our way or the highway and unusable as > presented. Code examples were rubbish as well.
I bet they're no worse than NXP. The header files and demo sources for the KL03 family were an utter disaster. The simple "hello world" and LED flash apps were so huge due to the bloated libraries that they wouldn't even fit in the flash memory of the smaller members of the family.
> May be better now,
Probably worse. AFAICT, uController demos are all written by people who think a Raspberry Pi 3 is a tiney embedded system and can't do anything unless there's a button for it in the Eclipse toolbar. You'll have to excuse me now, those darn are kids on my lawn again... -- Grant
On 4/7/2020 14:38, Tauno Voipio wrote:
> On 7.4.20 11:36, David Brown wrote: >> On 07/04/2020 00:18, Dave Nadler wrote: >>> On Monday, April 6, 2020 at 6:09:56 PM UTC-4, David Brown wrote: >>>> Hey!&nbsp; A cite!&nbsp; I'm famous :-) >>> >>> We already knew that ;-) >>> >> >> Yes - my name is on tractors around the world, the credits of "Jaws", >> and several dozen Wikipedia entries.&nbsp; All my work :-) >> > > And the 'DB' in Aston Martins. >
and the ubiquitous dB -- Best wishes, --Phil pomartel At Comcast(ignore_this) dot net
On 8.4.20 18:20, Phil Martel wrote:
> On 4/7/2020 14:38, Tauno Voipio wrote: >> On 7.4.20 11:36, David Brown wrote: >>> On 07/04/2020 00:18, Dave Nadler wrote: >>>> On Monday, April 6, 2020 at 6:09:56 PM UTC-4, David Brown wrote: >>>>> Hey!&nbsp; A cite!&nbsp; I'm famous :-) >>>> >>>> We already knew that ;-) >>>> >>> >>> Yes - my name is on tractors around the world, the credits of "Jaws", >>> and several dozen Wikipedia entries.&nbsp; All my work :-) >>> >> >> And the 'DB' in Aston Martins. >> > and the ubiquitous dB >
Aston Martins are built by David Brown, but dB is named after Alexander Graham Bell. -- -TV
On 8.4.20 16:58, Chris wrote:
> On 04/06/20 15:14, Dave Nadler wrote: >> On Monday, April 6, 2020 at 3:05:47 AM UTC-4, Tauno Voipio wrote: >>> Just stay away from the hardware guys' software, write your own. >> >> Yup, I had to write my own drivers for ST DMA, timer, SPI. >> >> But it gets quite impractical to write one's own drivers for every >> ethernet and USB peripheral set etc... And lots of the vendor >> stuff absolutely does not work (ST for example). >> >> Now if I could only figure out why my release build works, >> but not the debug build (reverse of the usual puzzle!)... >> Off to check the timing on the scope! > > Always write separate header files for the cpu and each of the on chip > peripherals as a first task for every new processor. It's a good > way to get a top level overview of the machine and capabilities. > > Had a look at the ST code examples and their obscure header file > mess for cortex years ago. Our way or the highway and unusable > as presented. Code examples were rubbish as well. May be better > now, but still useless if you have a house standard for form and > function...
At least Atmel and ST made the mistake by attempting to cover all the processors types with one set of sources. This led to a sorry mess of conditional code, which is undecipherable even for a seasoned programmer. (me: over 50 years of embedded code). -- -TV
On Wed, 08 Apr 2020 14:58:08 +0100, Chris <xxx.syseng.yyy@gfsys.co.uk>
wrote:

>Had a look at the ST code examples and their obscure header file >mess for cortex years ago. Our way or the highway and unusable >as presented. Code examples were rubbish as well. May be better >now, but still useless if you have a house standard for form and function...
We agree. In the end we wrote a (sort of) parser for ARM's SVD file format to produce our header file equivalents. Several others have gone down this route too. Stephen -- Stephen Pelc, stephen@mpeforth.com MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612 web: http://www.mpeforth.com - free VFX Forth downloads