- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've created my own component which internally uses an SPI master component (v2_50).
I've added an API and can access the functions of the SPI ok for example `$INSTANCE_NAME`_SPI_ClearRxBuffer() works fine.
But using a definition of the component creates an error message - example: `$INSTANCE_NAME`_SPI_STS_TX_FIFO_NOT_FULL would result in an error message: undeclared (first use in function).
If i comment out the line of code and compile the project, i can access the definition in main - auto completion shows it to exist.
In my component API i have included cytypes.h and cyfitter.h.
I've tried including <project.h> but this also causes a compile error.
Any help would be appreciated.
kind regards,
Damian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi damian,
I'm also making a component with a SPI Master in it, you can see my API implementation here:
https://github.com/C47D/PSoC_nRF24_CustomComponent/tree/master/nRF24.cylib/nRF24/API
To read the status of the SPI i'm using `$INSTANCE_NAME`_SPI_STS_SPI_IDLE, i think your `$INSTANCE_NAME`_SPI_STS_TX_FIFO_NOT_FULL is fine, maybe the problem is including the header files, i'm placing <project.h> and <cytypes.h> on the source file (funcs.c) and <cyfitter.h> on the header file (funcs.h).
Hope it helps
Carlos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Probably not the cause, but did you #include the corresponding .h file?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
do you mean the SPI.h file? eg #include "`$INSTANCE_NAME`_SPI.h"
This generates an error similar to if i include the <project.h> file: Build error: the command 'arm-none-eabi-gcc.exe' failed with exit code '1'.
I am including my own API header file.
thanks,
Damian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
arm-none-eabi-gcc.exe' failed with exit code '1' This error message just shows the final giving up of the compiler. Of quite more interest would be the first error that occurred in all your tries.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
Yes I've noted that usually i see more than one error but in this instance this is the only error i receive
regards,
Damian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi damian,
I'm also making a component with a SPI Master in it, you can see my API implementation here:
https://github.com/C47D/PSoC_nRF24_CustomComponent/tree/master/nRF24.cylib/nRF24/API
To read the status of the SPI i'm using `$INSTANCE_NAME`_SPI_STS_SPI_IDLE, i think your `$INSTANCE_NAME`_SPI_STS_TX_FIFO_NOT_FULL is fine, maybe the problem is including the header files, i'm placing <project.h> and <cytypes.h> on the source file (funcs.c) and <cyfitter.h> on the header file (funcs.h).
Hope it helps
Carlos
- 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
You did not #include <sx1272_SPI.h>, this should be generated automatically into your #include sx1272.h file. Inserting this manually leads to an error-free compilation, but a handful of warnings.
It is very uncommon to use the #ifndef - pattern for .c files, I would suggest you to use that for .h files only. Normally only the .h file is #included and the corresponding .c is handled by the compiler and its path declarations.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fantastic thanks Bob, i thought i had already tried that but obviously not.
really appreciate it
regards,
Damian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome!
Greetings to Down Under, where are you located?
Bob