- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone,
I an trying to create a custom component using UART. After watching the training videos and the Component Author Guide,I was able to create the Schematic and the Symbol only. I tried to create the API's but i don't think its the right way to do so.
What i did was, I tried to use to use the commands like "UART_Start()" in the API ; The compiler is giving me warning implicit declaration f function "UART_Start()" is invalid in C99.
Kindly give your feedback as many other out there would be wishing to create their own component.
Regards,
Joji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Joji, without looking into your project, check the "..._Start()" line, instead of "UART_Start()" it should be something like "UART_1_Start()", where "UART_1" - is actual name of UART component on the schematic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had changed the name of the component used in the schematic to UART. So its clear from that point of view.
I have a doubt if we can declare it that way?
Anyways thanks for the reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I currently have no access to computer to check your project, .. include header file at the top of UART_test.c file
#include <`$INSTANCE_NAME`.h>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried writing #include <`$INSTANCE_NAME`.h> but the error still persist.
Earlier I was writing #include <project.h>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you place your generates component onto your topdesign sheet and start a build you will see what you have to correct.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Its showing that there is problem in the c file.
The problem is that my way for defining the function like UART_Start() or UART_Enable() is not correct. And don't know the correct way to do so. Thats what i need to know.
If you have any example regarding the component creation of UART then it would be helpful, as i need to see how the API files are created.
Regards,
Joji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Joji,
... replace as:
void `$INSTANCE_NAME`_Start(){
//UART_Start(); //missing component instance name
`$INSTANCE_NAME`_UART_Start();
}
also in header file add separator after 'void'
//void`$INSTANCE_NAME`_Start(); //typo
void `$INSTANCE_NAME`_Start();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply, it solved my error . I had lost hope, thanks again.
I will create the custom component and will post it. If someone can benefit from this then its good
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are welcome, I learned something too 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi again,
This time its the interrupt!! The custom component that we were discussing above had an Interrupt attached with it. Its going into the ISR routine but now its not clearing the interrupt status, hence its not coming out of the ISR routine. Here I have registered the ISR in the c file.
I am attaching the project file if someone could help then it would be great.
Regards
Joji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attaching project?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Joji,
there is not much code in your project and ISR routine. Other thought: you send UART_Tx message inside ISR routine, which is blocking operation, which is not good. I am attaching an example of UART_Rx which you can wrap into component or use it as working example.