Serial malfunctions when changing baud rate of other serial port for mBed LPC1549

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Serial malfunctions when changing baud rate of other serial port for mBed LPC1549

1,175件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zhjcpi on Wed May 21 00:03:51 MST 2014
Dear,

I am working on mBed LPC1549 platform and try to enable 2 serial ports, one is for debug port and the other is for functional port.

After debugging port is initialized, the debug information can output normally.
However, when I change the function port baud rate,  the debug port will output unkown code and work abnormally.
When I switch the function baud rate back to the SAME baud rate(115200) as debug serial port, the debug serial port works normally again.
When I switch the function baud rate back to another baud rate(57600 or 4800) different from the debug port baud rate, the debug serial port still works abnormally.

Below is my test code and log information for your reference(Please note it is based on mBed platfrom):
#include "mbed.h"

#define DBG_PORT_BAUD   115200
#define FUNC_PORT_BAUD1 4800
#define FUNC_PORT_BAUD2 115200 //57600

static Serial  sSerialDebug(D1, D0);
static RawSerial  sSerialFunc(D8, D2);

int main(void)
{
    int cnt = 1;
    int br = FUNC_PORT_BAUD2;

    sSerialDebug.baud(115200);

    while(1)
    {
        if((cnt & 0x7) == 0)
        {
            br = br==FUNC_PORT_BAUD2?FUNC_PORT_BAUD1:FUNC_PORT_BAUD2;
            sSerialDebug.printf("set br %d\r\n", br);
            sSerialFunc.baud(br);
        }
        sSerialDebug.printf("test cnt = %d\r\n", cnt++);
        wait_ms(1000);
    }  
}


The output log is attached.

Original Attachment has been moved to: demo_01.txt.zip

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,015件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed May 21 00:43:00 MST 2014
The mbed drivers are provided by the mbed community (with help from NXP). All the mbed'ers hang out on the mbed forums (and not here).
0 件の賞賛
返信

1,015件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zhjcpi on Wed May 21 00:31:27 MST 2014

Is the mbed drivers provided by NXP or by mBed community?
Thanks.
0 件の賞賛
返信

1,015件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed May 21 00:24:15 MST 2014
For mbed specific questions like this, you would probably get more assistance by asking the mbed community:

http://mbed.org/forum/

Regards
LPCXpresso Support
0 件の賞賛
返信

1,015件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zhjcpi on Wed May 21 00:11:57 MST 2014
The log is shown as below:
test cnt = 1
test cnt = 2
test cnt = 3
test cnt = 4
test cnt = 5
test cnt = 6
test cnt = 7
set br 4800?磂s?c畉 ?8?磂s?c畉 ?9?磂s?c畉 ?1?
磂s?c畉 ?1?
磂s?c畉 ?1?
磂s?c畉 ?1?
磂s?c畉 ?1?
磂s?c畉 ?1?
砮t燽r€?5?0
test cnt = 16
test cnt = 17
test cnt = 18
test cnt = 19
test cnt = 20
test cnt = 21
test cnt = 22
test cnt = 23
set br 4800?磂s?c畉 ?2?
磂s?c畉 ?2?
磂s?c畉 ?2?
磂s?c畉 ?2?
磂s?c畉 ?2?
磂s?c畉 ?2?
磂s?c畉 ?3?
磂s?c畉 ?3?
砮t€br€?5?0
test cnt = 32
test cnt = 33
test cnt = 34
0 件の賞賛
返信