2020-02-25 02:18 PM
I experience a problem when the capacitor is fully discharge. When the program try to read from a UART port it stall on the read command and the application will not continue.If I put a delay before the read for the time that it takes the capacitor to charge to 1.8V then the read is successful and the application continue.
Is there is any explanation why the low voltage halt the reading from UART when VBAT voltage is below the 1.8V?
Thank you.
2020-02-25 02:30 PM
What BOR setting are you using? What chip? How far below 1.8V are you running?
There is a minimum voltage requirement and if you’re below it, operation is not guaranteed.
2020-02-25 05:47 PM
Hi Thank you.
The chip is STM32F765.
The capacitor can get almost to zero V if the unit stay for long time w/o power.
BOR is OB_BOR_OFF.
2020-02-25 09:22 PM
You mean, a supercap on the VBAT pin? Post relevant part of you schematics (power supply arrangement) or a sketch of it.
Try to change the BOR setting.
JW
2020-02-26 08:09 AM
Here is the schematic. If I increase the burn out I might have to wait even more until the capacitor charged.
The part I do not understand why the uart port on read command get stuck until the capacitor is charged. The capacitor should be charged in a 1 sec and the VBAT should have the threshold level in about 20mS.
Thank you.
2020-02-26 08:58 AM
2020-02-26 09:49 AM
I send a write command to a port and wait. If the wait is too short like here 250mS The read command and the app get stuck forever without any error.
If I increase the sleep to couple of second the read command will go through.
i8_err = write(pDeviceSetting->i8_tty2_fdThermalControl, "W 42a7 0\n", strlen("W 42a7 0\n")+2);
usleep(250000);
do
{
u8_cnt_start++;
if((i16_n = read(pDeviceSetting->i8_tty2_fdThermalControl, thermal_temp_buf , BUFFER_SIZE)) == -1)
{
printf("ERROR: %d\n", i16_n);
}else {
printf("READ NO. OF BYTES:%d\n", i16_n);
if(strlen(thermal_temp_buf) > 0)
{
if(strncmp(tbuf_rd2, thermal_temp_buf, 3) == 0 || strncmp(tbuf_ack, thermal_temp_buf, 3) == 0)
{
printf("SUCCESS BUFFER:%s\n", thermal_temp_buf);
printf("INIT FROM OK+++++++++++\n");
i16_returened = 0;
}else {
i16_returened = -1;
printf("FAIL BUFFER:%s\n", thermal_temp_buf);
}
}
}
if(u8_cnt_start > 100)
{
break;
}
} while (i16_returened == -1);
2020-02-26 10:00 AM
2020-02-26 12:18 PM
At this stage only main thread is open and only the serial ports are already configured.
The issue not that it try to read, it's that it get stuck not even performing read command, in other word if I use debug the software get to the read line and get stuck there. I cannot proceed from there to try to write again in the loop.
I checked and there is data coming out from the TX. Is there no way to timeout the read command?
2020-02-26 01:45 PM