KBOOT LPUART baudrate estimation error?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

KBOOT LPUART baudrate estimation error?

1,448 次查看
jefdaems
Contributor I

Dear all,

 

I'm using an MKL17Z128V chip that's built into a sealed enclosure. It can be accessed via LPUART0, and I want to update the firmware using the KinetisFlashTool. When trying to update the flash, the tool attempts to send a ping message to detect the bootloader first. The user code will detect this ping message and enter the bootloader as described in the reference manual:

uint32_t runBootloaderAddress;
void (*runBootloader)(void * arg);
runBootloaderAddress = **(uint32_t **)(0x1c00001c);
runBootloader = (void (*)(void * arg))runBootloaderAddress;
runBootloader(NULL);

The flash tool will of course display that the first ping attempt fails, but should work on the second attempt. The bootloader is successfully executed and attempts to respond to the incoming ping message. The following image shows what happens on the TX and RX lines on the second ping attempt:

174899_174899.PNGbootloader.PNG

The baudrate is configured to be 9600 baud. The ping messages are sent at almost exactly this rate, but the response is sent at a lower rate, in this case 9070 baud. As a result, framing errors occur and the flash tool displays the "Connect device failed" error for each attempt. This happens for every standard baudrate I tried to configure (9600, 19200, 38400, 57600).

 

After some experimenting, I managed to get everything to work as expected by setting the baudrate in the flash tool to 9070 (and reconfiguring baudrate in user code as well). The baudrate of the microcontroller is 8600 baud in this case. Again too low, but this does not seem to create framing errors.

 

Is there any apparent reason why the baudrate estimation fails in this situation? I currently do not write anything to the BCA, so the bootloader works in its default configuration.

 

Thank you!

 

Jef Daems

标签 (1)
标记 (2)
0 项奖励
回复
2 回复数

1,260 次查看
ramboyang
NXP Employee
NXP Employee

Hi Jef,

There is an Errata mentioned this issue, to avoid such issue, please connect the UART_RX pin with a pull-up resistor. 

Have a great day!

0 项奖励
回复

1,260 次查看
jefdaems
Contributor I

Hi,

I tried adding a 2.5k pull-up resistor. The RX pin is pulled high as soon as the supply voltage comes up. This did not fix the problem though, the results are still the same.

Jef

0 项奖励
回复