Delay routines (service) - Errors

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

Hi there,

Another day trying to get along with ASF.

 

I started a completely new project, compiling successfully. By only adding the "Delay routines (service)" module with the ASF Wizard errors pop up:

Error: 'BOARD_OSC0_HZ' undeclared (first use in this function)  

 

defining it

 


#define BOARD_OSC0_HZ 1
#include <asf.h>

int main (void)
{
	/* Insert system clock initialization code here (sysclk_init()). */

	board_init();

	/* Insert application code here, after the board has been initialized. */
}

 

it then says

 

Error: '#error BOARD_OSC0_STARTUP_US must be defined by the board code

 

So, now I'm confused: Is there any implementation missing on ASF side?

 

Info - What I did:

 

  1. Setup Project: File -> New -> New Project -> GCC C ASF Board Project
    MCU: AT32UC3C1256C
     
  2. Compiled => success
     
  3. ASF Wizard: Added "Delay routines (services)"
     
  4. Compiled => 11 Errors (I described the first above!)

 

That shouldn't happen? In an other project that I am currently setting up, I already added EIC, GPIO, INTC, PM, TC, USART and Generic board support successfully without any issues until trying to add "Delay routines (services)" where even more issues occur. So whats the matter with the "Delay routines (services)" module?

 

Thx for any help.

 

cheers Nik

 

 

 

 

 

 

This topic has a solution.
Last Edited: Wed. Jul 10, 2019 - 01:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try making it as a -D not just on one file (that is "Symbols" in the AS7 project setup).

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

Thank you for reply. Actually I solved the problem in the most classic way to engineers. Stopped working, went for a beer... the next day the problem was solved. So I simply asking my self WTH I did spend time for the day before.angry

 

Eventually yes

 

thx

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

radioman85 wrote:

Thank you for reply. Actually I solved the problem in the most classic way to engineers. Stopped working, went for a beer... the next day the problem was solved. So I simply asking my self WTH I did spend time for the day before.angry

 

Eventually yes

 

thx

 

 

I used to solve perplexing problems by going out to my dock and putting my feet in the water. If that didn't help, my whole self in the water. In an hour or so, problem solved!

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

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

laugh good to here

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


Well, just got the same problem again: Added "Delay routines (services)" in the ASF Wizard pops up 53 Errors, all relating to the new included files:

  • Error        static declaration of 'osc_wait_ready' follows non-static declaration    ...    C:\...\ASF\common\services\clock\osc.h    162
  • Error        implicit declaration of function 'osc_is_ready'    ...    C:\...\ASF\common\services\clock\uc3c\genclk.h    142
  • Error        'OSC_ID_OSC32' undeclared (first use in this function)    ...   C:\...\ASF\common\services\clock\uc3c\genclk.h    142
  • ... and so on

     

clawson: "Try making it as a -D not just on one file (that is "Symbols" in the AS7 project setup). "

Because last time it could be solved with beer I didn't thought to much more about it. Experiencing the same problem again, I need to ask what you meant with that "-D" surprise.

What should I do with it? 

Do you mean in "Project -> Properties -> Toolchain" ? There I could find "Symbols" in "AVR32/GNU C Compiler" and in "AVR32/GNU Preprocessing Assembler". But I don't know what you want me to do indecision

 



 

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

radioman85 wrote:
o you mean in "Project -> Properties -> Toolchain" ? There I could find "Symbols"
Yup, that's what I meant (notice the section for "Defined Symbols" even gives the clue that it will be passing these as -D's ;-)

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

Ah, now I understand (I guess). You want me to define these missing definitions in the -D field, e.g. that blamed "BOARD_OSC0_HZ"?! Well, so much I did understand that if the definition is missing, it should mostly be added. But I am talking about the code provided by Atmel respectively stuff that is added using the ASF Wizard. This definitely shouldn't throw any such errors?! When being added. Unless one is using same definitions as the ASF code does. 

 

Somehow I get the feeling that ASF is a little messy? I mean, providing source code shouldn't miss definitions!?

 

My source code including ASF modules like

  • GPIO
  • PM
  • SPI
  • TWI
  • USART

work fine. Only when adding "Delay routines" 53 Errors are thrown => Great. Well I often find the mistake on my side, but here I don't think I have to blame my self?

 

Puh, I just went through a few errors and I found this:

 

 

 

So far I haven't figured out a way to find out, which of the thrown errors are relevant and which just occurred implicitly. In other IDEs the first error used to be the issue to look at. This is, very unfortunately, not the case with the AtmelStudio that makes it nearly impossible to get to the point of interesst => finding the cause of the 53 errors.

 

Well. this time it did't get solved drinking a beer. So I go over to Whisky this time. It may help.
 

Any idea what my problem could be? (Not the drinking one!!)

 

Cheers

 

 

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

OK, after I was forced to setup the entire project step by step again, I eventually resolved the problem. So what was the issue?! =>

 

  1. I didn't uncomment the definitions in "user_board.h" (../src/ASF/common/boards/user_board/..
    => My fault: didn't read the manual. This was propably what clawson wanted me to tell! Sorry, I didn't thought that there are code sections to uncomment to make it work.
  2. BOARD_OSC0_IS_XTAL  vs BOARD_XOSC_TYPE: the first is requested by the ASF module "Delay routines (service)", the second is predefined (to be uncommented) in the already mentioned "user_board.h" file. 
    => frown AS7 fault!(?): Well, it would help to find the problem if wordings used in provided source code would be consistent! Using Ctrl-F (that part of the tool chain to search problems like these) on the entire solution would have given me a clue what the problem is. And yes, the same with BOARD_OSC0_HZ and BOARD_OSC0_STARTUP_US, which are provided (commented) as BOARD_XOSC_HZ and BOARD_XOSC_STARTUP_US. And yes, it is a troth that I would have saved about 2 days of problem searching!
  3. Well, there have even bean another problem which I couldn't track anymore, and time is running so I stopped at this stage for searching answers (the point where it works but nobody knows why!).

 

Request to ASF developer: Get consistent! (This is stated in my bible, that I haven't written yet)

Request to AS7 developer: Rework compiler error output messages! They are really misleading!indecision

Request to my self: RTFM angry

 

 

 

So thats it. End of problem/solution description. Happy debugging.
Cheers

 

 

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

radioman85 wrote:
Request to AS7 developer: Rework compiler error output messages! They are really misleading!
The compiler is nothing to do with Atmel - take that up with GNU GCC (but there are millions of GCC users who have never had any problem with its errors so it'd be a hard argument to get anything changed!)

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

clawson wrote:

The compiler is nothing to do with Atmel - take that up with GNU GCC ...

Well, that's through yes