2016-12-09 04:36 AM
My IDE has a feature that uses less contrasting text for code that is 'inactive' (not included)
from this I found that some code is not being included that i had expected to be.For instance stm32f0xx_ll_tim.c &sharpincludes stm32f0xx_ll_tim.h, which in itself &sharpincludes stm32f0xx.h, which &sharpincludes stm32f030x8.h which &sharpdefines TIM3. There is a line in stm32f0xx_ll_tim.c that reads ...
&sharpif defined (TIM1) || defined (TIM2) || defined (TIM3) { then do this } but the 'then do this' code is not highlighted I would of thought stm32f0xx_ll.c would know of TIM3 existance because of the nested includes but it doesnt. Am I missing something?#c-language2016-12-09 06:19 AM
Hi
McCarron.Joseph
,1- Do you have any compilation issue?
2- Is there any expected behavior not working?
3- Are you using a particular Cube example? If yes, which one?
-AMel-
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2016-12-09 07:35 AM
The
#include stm32f0xx.h looks for an stm32f0xx_conf.h file in your project with a lot of selective defines about what is and isn't pulled in.
2016-12-09 08:01 AM
I am not using the hal drivers just the low level (LL drivers).
My problem is functions in stm32f0xx_ll_tim.c are not getting pulled in. They should because
stm32f0xx_ll_time.c #includes stm32fxx_ll_tim.h which #includes 'stm32f0xx.h' which defines
stm32f030x8 and #includes 'stm32f030x8.h' in which TIM3 is defined.
So stm32f0xx_ll_tim.c should know TIM3 is defined, but it doesn't.
Wierd, because the program compiles but the functions do not end up modifying registers or doing
what they are suppose to do. You would think I would get errors, not found, not defined whatever.
When i am editing and right click the editor can find the declaration but not the implentation. That
gives me a clue as the function itself is not being rolled in to the program.
2016-12-09 09:22 AM
,
,
Well '
♯ if defined (TIM1) || defined (TIM2) || defined (TIM3)
' type constructs aren't going to stop things compiling, just jettison a lot of code that might stop in compiling. If the linkage succeeded enough function body code was supplied to get closure.At this point you are going to need to walk the code to understand why certain things aren't getting defined, or use some static analysis tools to do it, ie ,
,There is usually a ♯ ifdef at the top of the include files that jettisons the entire content, I'd look at those first.
2016-12-09 11:31 AM
Gads...This sound like a question I had when using TrueStudio. Turns out if you edit something in an active session, Id get results like that. Hightlighting ( and SEARCH for that matter) were all fouled up. Turns out TS only SCANS the code for this auto highlighting, including, defining, and jumping from function to function or anywhere else in the project only at IMPORT time. Have you tried just closing the whole thing then re-opening it as NEW. ?
2016-12-10 10:18 AM
So I got the project to compile and run successfully.
I had to comment out defines that the compiler could not reconcile.Although it should of been able to.It seemed the problem came from using nested includes. If what the compiler
needed was in a nested include statement it had problems finding it.So to just move on I commented out the '#if XXXXX defined' statements so that
all the code was accessible to the compiler. I know this isn't the right thing to do.I set up the same project in True Studio and I did not have the problem.
As far as functions returning nothing as I posted before, that was my bad
The ADC enable statement should come AFTER the assignment to struct members, not before.So registers were not set up correctly. LOLThanks for your help everyone, I appreciate it.
BTW - I think the LL drivers are pretty good way to go and are completely independent of
anything HAL.
2016-12-10 10:51 AM
It DID stop things from compiling because I had the IDE telling me things were THERE ( the code was NOT greyed out) when in fact it wasn't.
You obviously have an Eclipse-based IDE. It uses it's own parser for such things, and NOT the target compiler. They tend to disagree from time to time ...
One of the reasons I don't like Eclipse.
2016-12-10 11:01 AM
Guilty.... But feel free to nudge me in a different direction. I'm not married to it. Just the 'no code size limits' and the price of FREE really seem to matter to the bosses here. I came here from a much Much MUCH more simplistic dev environment so all these new toy -- er uh TOOLS are mind boggling to me. Well and I'm OLD.... That doesn't help.
2016-12-10 11:27 AM
Good. Glad your moving forward again. Yeah my HILIGHTING problem arose from the opposite of clive1's perspective. It DID stop things from compiling because I had the IDE telling me things were THERE ( the code was NOT greyed out) when in fact it wasn't. These IDE's are nice and fancy but now you have to keep an eye on how *they* trip you up, along with how I trip myself up in my code. Simple is still good.