cancel
Showing results for 
Search instead for 
Did you mean: 

bool is undefined

joe.lopilato
Associate II
 
9 REPLIES 9

So define it with a typedef, or #include the file defining it....

Perhaps you can provide some context, and ask a question, rather than just a title as a declarative statement...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
joe.lopilato
Associate II

What a surprise!!! - I wasn't expecting an answer because I used the title as a search term. Somehow (obviously a mistake on my part) I must have mistakenly added it as a question to the forum. Gotta RTFM.

I found the answer when I realized that the header file had to be included.

However, having said that I must thank you for taking the time to respond (especially on a Sunday!!!).

I am a retired Electrical Engineer and trying to finally learn how to program in C/C++. It is quite a turn-around from designing with hardware op-amps, TTL gates, bit shifters, etc to software memory locations, registers, variables, pointers, bit-shifting, etc..

I am pleased that there are folks like you that will help to get me there. Thanks...

joemccarr
Senior

Start with an Arduino, faster learning curve. Then when your comfortable with it move to a STM32. You'll probably be able to do nearly everything you want with an arduino anyways.

AvaTar
Lead

> You'll probably be able to do nearly everything you want with an arduino anyways.

Only if somebody else wrote/ported it already for you.

And usually about one order of magnitude slower than accessing the MCU directly.

joemccarr
Senior

It's about a better starting place if you don't have any embedded programming experience. The community aspect of the Arduino is much more helpfull for beginners. You write everything yourself? You don't use libraries ?

AvaTar
Lead

> You write everything yourself?

If necessary, yes.

Arduino is a good start for beginners, true. Professionals might use it for prototyping occasionally.

But commercial projects use to prohibit the waste of resources that comes with the "easy for beginners" approach. I'd worked on projects where not even clib functions were allowed. BOM cost above all.

joe.lopilato
Associate II

just want you guys to know that I am not entirely new to programming. For more years than I care to admit, I wrote code for the F-18 mission computer entirely in Assembly (high-level languages were taboo). The slightest hardware/firmware change/mod took days/weeks because of all the associated analysis, simulation, design, paperwork, reviews, and testing. I've also programmed FPGA's along the way. But never in C/C++. So, I do have some idea about styles, languages, etc. I've been using a Raspberry Pi for a while and have become pretty proficient in Python. I purchased an Arduino Uno and wrote some sketches, but now I want to do a FFT project and I purchased a Nucleo board to leverage the DSP and math co-processor in the F4.

Playing around with other people's code is difficult to say the least - many people don't seem to understand the concept of commenting lines of code. Some people just put the code on GitHub without even bothering to remove the superfluous CubeMX comments and then seem to get annoyed when others pose questions or don't even answer the questions. It gets pretty frustrating to try to understand the author's thinking process.

In my day, we did not have CMSIS or HAL or SPL's. EVERY line of code had to have a comment explaining the design, who designed it, the why, and for some functions, Alternates. I'll say it again. I very much appreciate the feedback and am happy that such a community exists with so many people willing to help.

AvaTar
Lead

> Playing around with other people's code is difficult to say the least - many people don't seem to understand the concept of commenting lines of code.

I very much agree. Currently dealing with long-living safety related code, I am more or less "forced" to properly document the code, as it is part of the certification documentation.

> Some people just put the code on GitHub without even bothering to remove the superfluous CubeMX comments ...

OTOH, if you use a code generator in a professional environment (not speaking about CubeMX...), you don't want to touch auto-generated code each time, and create pseudo changes for the version control system.

> ... but now I want to do a FFT project and I purchased a Nucleo board to leverage the DSP and math co-processor in the F4.

I would suggest to check out the ARM DSP Library, which uses the contain a proper FFT example in C. At least for the F407 / F4 Discovery, it is available without Cube.

bool is defined in <stdbool.h> (C99, 7.16)

JW