5 years, 10 months ago.

How do I stop serial dropping characters on Nucleo F411RE or F401RE when tickless is enabled.

I can not get all characters via serial reliably from Nucleo F411RE or F401RE when I have tickless enabled. I am talking to a cellular modem at 115200 baud. This seems to be a similar or the same problem listed in https://github.com/ARMmbed/mbed-os/issues/8714 except for a different board. This issue has been closed and looks like it has been merged but I am loosing characters with the F411RE.

As soon I as I remove

"target.macros_add": ["MBED_TICKLESS","DEVICE_LPTICKER"],

#include "mbed.h"
 
RawSerial Modem(PA_9, PA_10,115200);
DigitalIn mybutton(USER_BUTTON);
DigitalOut led2(PA_5,0);

int main()
{
	LowPowerTimer t;
	char c;
	bool found = false;
	char respBuffer[500]="";
    int bsize = sizeof(respBuffer);
    Modem.set_flow_control(Serial::RTS,PA_12,PA_11);
    printf("Ready...\n");
    while(1) {
		if(mybutton == 0) {
			led2=1;
			wait(1);
			led2=0;
			printf("Sending ATI1\n");
			Modem.puts("ATI1\r");
			t.start();
			char test[10] = "OK\r";
			int eLen = strlen(test);
			int i=0;
			while(t.read_ms() < 10000){
				while (Modem.readable()) {
					c = Modem.getc();
					if(i<bsize) {
						respBuffer[i] = c;
						respBuffer[i+1]=0;
					}
					i++;
				}
				if(i>eLen){
					int match = memcmp(test,&respBuffer[(i-eLen)],eLen);
					if(match == 0 ){
						found=true;
						break;
					}
				}
			}
			t.stop();
			printf("Found:%d\nOUTPUT:\n$$%s$$\nmilliSec: %d\n",found,respBuffer,t.read_ms());
		}
		ThisThread::sleep_for(1000);
	}
}

from my mbed_app.json file, no characters are lost.

Output with tickless

Sending ATI1
Found:1
OUTPUT:
$$
ATI1

CinterionELS31-V
REVISION 4.3.0c
A-REVISION 4.3.3.0-36343
L-REVISION 3.7.6

OK
$$
milliSec: 218
Sending ATI1
Found:1
OUTPUT:
$$
ATI1

Cinterion
ELS31-V
VISION 4.3.0c
A-REVION 4.3.3.0-36343
L-REVISION 3.6

OK
$$
milliSec: 327
Sending ATI1
Found:1
OUTPUT:
$$
ATI1

Cinterio
ELS31-V
REVISION 4.3.0c
A-RESION 4.3.3.0-36343
L-REVISION 3.6

OK
$$
milliSec: 436

Output without tickless

Sending ATI1
Found:1
OUTPUT:
$$
ATI1

Cinterion
ELS31-V
REVISION 4.3.3.0c
A-REVISION 4.3.3.0-36343
L-REVISION 3.7.6

OK
$$
milliSec: 314
Sending ATI1
Found:1
OUTPUT:
$$
ATI1

Cinterion
ELS31-V
REVISION 4.3.3.0c
A-REVISION 4.3.3.0-36343
L-REVISION 3.7.6

OK
$$
milliSec: 423
Sending ATI1
Found:1
OUTPUT:
$$
ATI1

Cinterion
ELS31-V
REVISION 4.3.3.0c
A-REVISION 4.3.3.0-36343
L-REVISION 3.7.6

OK
$$
milliSec: 532

Any ideas on what I should try? Is this bug not fixed or is it just fixed for a specific board?

Thanks,

Hi Paul,

There is another issue specific to the Nucleo F411RE here:

We think this will help you. If not, please create a new GitHub issue as that will get you a response from the ST team.

Regards,

Ralph, Team Mbed

posted by Ralph Fulchiero 05 Feb 2019
Be the first to answer this question.