- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I have the following code:
int main()
{
UART_Start();
int len = 6;
uint16 tx_array [len];
for (;;)
{
tx_array [0] = 0xFFFF;
tx_array [1] = 0x6C56;
tx_array [2] = 0x6461;
CyDelay (100);
UART_SpiUartPutArray (tx_array, len);
}
}
It works fine with Hyper Terminal, but IO have a warning of incompatible pointer type.
"passing argument 1 of 'UART_SpiUartPutArray' from incompatible pointer type"
According to the datasheet the function can take uint16 * or uint8 * as first parameter. What is more interesting GDB crashes when I want to look into the way UART transmits the data:
"/home/build/work/GCC-4-9-build/src/gdb/gdb/utils.c:1056: internal-error: virtual memory exhausted: can't allocate 1049375820 bytes.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nCreate a core file of GDB? "
The only thing on the TopDesign is the UART component (SCB type).
Does anyone have any ideas about the warning and the crash?
Thanks,
Stoyan
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file. You probably defined the UART as byte-wide, then you have to submit an array of bytes, not words.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file. You probably defined the UART as byte-wide, then you have to submit an array of bytes, not words.
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
The PSoC device you selected has a byte-wide UART only, so your data should be a (uint8*) or at least type-casted into that. Care using the right length, since that is counting bytes.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
Thanks for the prompt reply. I will take into consideration that. Can you please point to me where you are getting the information about the UART.
Do you think that this may be the cause for the GDB crash?
Thanks,
Stoyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
where you are getting the information about the UART.
Datasheet for UART, always just a mouse click away 😉
Do you think that this may be the cause for the GDB crash?
Might be. the SCB (Serial Control Block) is a (programmable) piece of hardware. When debugging, your program gets halted, but the hardware continues to run. That might lead to some curios behavior but I never saw a debugger crash. You are using Creator IDE and the integrated debugger, I presume?
Bob