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,048 次查看
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 回复数

888 次查看
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 项奖励
回复

888 次查看
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 项奖励
回复

888 次查看
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 项奖励
回复

888 次查看
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 项奖励
回复