Getting error with uartStartSend function
Moderator: RoccoMarco
-
ep.hobbyiest
- Posts: 94
- Joined: Sun Jun 26, 2016 5:22 pm
- Has thanked: 4 times
- Been thanked: 1 time
Getting error with uartStartSend function
Hi,
I am using STM32F3xx processor and chibios-uart functionality.I configure uart at 9600.
The function uartStartSend is printing for only once and after that os goes in halt state and shutdown reason is uartStartSend function only.
May be it is taking some time to send string but i gave some delay after 1st use of uartStartSend function.
But still result is same.
How to overcome this error?
I am using STM32F3xx processor and chibios-uart functionality.I configure uart at 9600.
The function uartStartSend is printing for only once and after that os goes in halt state and shutdown reason is uartStartSend function only.
May be it is taking some time to send string but i gave some delay after 1st use of uartStartSend function.
But still result is same.
How to overcome this error?
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Getting error with uartStartSend function
Hi,
Enable the debug options in chconf.h (assertions, checks, state checker), you are likely doing some detectable error. After system halts retrieve the error message using the debugger.
Debugging hints: http://www.chibios.org/dokuwiki/doku.ph ... ebug_guide
Giovanni
Enable the debug options in chconf.h (assertions, checks, state checker), you are likely doing some detectable error. After system halts retrieve the error message using the debugger.
Debugging hints: http://www.chibios.org/dokuwiki/doku.ph ... ebug_guide
Giovanni
-
ep.hobbyiest
- Posts: 94
- Joined: Sun Jun 26, 2016 5:22 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: Getting error with uartStartSend function
Hi,
Here is screenshot with some extra details.

and last pointing in chSysHalt function and reason is uartStartSend.
Here is screenshot with some extra details.
and last pointing in chSysHalt function and reason is uartStartSend.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Getting error with uartStartSend function
Hi,
Most likely you are starting a transmission while the previous one is still in progress.
You could use uartSendTimeout() instead of uartStartSend(), the former returns when the transmission is complete.
Giovanni
Most likely you are starting a transmission while the previous one is still in progress.
You could use uartSendTimeout() instead of uartStartSend(), the former returns when the transmission is complete.
Giovanni
-
ep.hobbyiest
- Posts: 94
- Joined: Sun Jun 26, 2016 5:22 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: Getting error with uartStartSend function
yeah, i tried uartSendTimeout too..
following is wrapper i m using
But still i got following character on terminal for send_string("Com Init-");
following is wrapper i m using
Code: Select all
void send_string(uint8_t *str)
{
uint8_t size;
size = strlen(str);
// uartStartSend(&UARTD1, size+1, str);
uartSendTimeout(&UARTD1, size+1, str,2000);
}
But still i got following character on terminal for send_string("Com Init-");
Code: Select all
@X@@l@ @▒@@- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
-
ep.hobbyiest
- Posts: 94
- Joined: Sun Jun 26, 2016 5:22 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: Getting error with uartStartSend function
I am using 19200 baud rate and uart it throughing data now. but driver is not considering size i m giving.
it continously printing some statements.
i am prinitng "sysInit" and i got following as output.
sysInit-chSysUnlock@.
i am apending '\0' also and giving size also.
it continously printing some statements.
i am prinitng "sysInit" and i got following as output.
sysInit-chSysUnlock@.
i am apending '\0' also and giving size also.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Getting error with uartStartSend function
Question, why are you using the UART driver and not the Serial driver? the serial driver is more suited for printing text and easier to use.
Both drivers use 38400 as default speed, if you want to use a different speed then you need to configure them properly.
Giovanni
Both drivers use 38400 as default speed, if you want to use a different speed then you need to configure them properly.
Giovanni
-
ep.hobbyiest
- Posts: 94
- Joined: Sun Jun 26, 2016 5:22 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: Getting error with uartStartSend function
i am bit confused here.
is there any different api's for Serial driver. If yes, please tell me the filename.
I want to print text only.
is there any different api's for Serial driver. If yes, please tell me the filename.
I want to print text only.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Getting error with uartStartSend function
The serial driver is used in most demos, you can use chprintf() to print text. See the channels section in the manual for the API.
Giovanni
Giovanni