- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I am trying this two functions (line 6 and 7) and both gave different results!
# define MyString ("AT\r\n")
.
.
.
qm_uart_write_buffer(QM_UART_0, (uint8_t *)MyString, sizeof(MyString));
QM_PRINTF("AT\r\n");
qm_uart_write_buffer(QM_UART_0, (uint8_t *)aString, sizeof(aString)); output : AT\r\n0
while QM_PRINTF("AT\r\n"); output : AT\r\n
FYI, I have used QM_UART_LC_8N1 = 0x03, /**< 8 data bits, no parity, 1 stop bit */ for Configuration. And there shouldn't be additional 0 at the end.
Wasted few hours debugging hardware while apparently it was software error!!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi ByteMaster,
I tried to reproduce back your issue but it seem like there no issue on my machine. Could you try to repair/reinstall back the ISSM 2016 to see if the issue still persist. If yes, please help to provide more details on the setup to reproduce back the issue.
Thanks.
Soffi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Soffi,
Try with Logic analyzer or oscilloscope..it appears in there.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi ,
It seems you are also seeing the null character that marks the end of the string -- Do you see the same issue is you use strlen rather than sizeof to calculate the length ?
It seems ok for me ..
# include
# include
# include
# define MyString ("AT\r\n")
int main(void)
{
qm_uart_write_buffer(QM_UART_0, (uint8_t *)MyString, strlen(MyString));
QM_PRINTF("AT\r\n");
return 0;
}
regards,
Michelle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Michelle,
This make sense.
it works with strlen instead of sizeof
Please check the output of this three lines in attached pic.
qm_uart_write_buffer(QM_UART_0, (uint8_t *)MyString, sizeof(MyString)); /* Send "AT\r\n" */
qm_uart_write_buffer(QM_UART_0, (uint8_t *)MyString, strlen(MyString)); /* Send "AT\r\n" */
QM_PRINTF("AT\r\n"); /* Print "AT\r\n" */

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page