- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm developing some UART communication with PSoC 1 and I'm getting this error:
type error in argument 2 to `strstr'; found `pointer to __flash char' expected `pointer to char'
Code is as simple as this:
if (strstr(rx_buff,"OK") != NULL)
{
LED_On();
}
Am I missing something? this "__flash" thing it's new to me on C.
also apears when I try to compare some char on an IF.
char test[3] = "OK"
if ( test == "OK") ---> this lines gives again __flash error.
Have been trying and reading texts but I don't get it, any documentation on __flash or an advice?
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are here on a von Neumann machine which has different instructions when accessing data in flash ("OK") and data in sram (rx_buff). For some library routines there were replacements which took that into account. They would be named cstrstr() or strcstr(), but I do not know whether they have been implemented for PSoC1.
A good tip for you is really: get a CY8CKIT-043 and switch to a modern ARM CPU.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are here on a von Neumann machine which has different instructions when accessing data in flash ("OK") and data in sram (rx_buff). For some library routines there were replacements which took that into account. They would be named cstrstr() or strcstr(), but I do not know whether they have been implemented for PSoC1.
A good tip for you is really: get a CY8CKIT-043 and switch to a modern ARM CPU.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Bob!! Yeah, I have been developing on PSoC 5LP (CY8CKIT-059) and when some partner asked me to develop on PSoC 1 it was a huge change, and yes, switching to a modern ARM CPU it's a great tip. Again, thank you for your answer and time.