Serial port reading and writing character substitution

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Serial port reading and writing character substitution

615 Views
ramstell
Contributor III

I'm using a TWR-K64F-120M Tower Module together with a TWR-SER module.

I'm running the Ethernet to Serial demo, but have noticed there is some character substitution occurring. Depending in what direction you are going 0x0D to 0x0A etc. I've tried changing the serial port open mode to "rb" and "wb" without any success.

How can I stop this substitution from occurring?

Kind regards

Roger

0 Kudos
4 Replies

433 Views
matthewkendall
Contributor V

The option that controls this is IO_SERIAL_TRANSLATION. You are either passing this option directly when opening the serial device, or it is in the definition of BSP_DEFAULT_IO_OPEN_MODE in user_config.h.

You can always turn it on or off after the port is open using ioctl().

0 Kudos

433 Views
soledad
NXP Employee
NXP Employee

Hello Roger,

Which MQX version are you using??

Regards

Soledad

0 Kudos

433 Views
ramstell
Contributor III

Hi Soledad

I'm using MQX 4.2.

Kind regards

Roger

0 Kudos

433 Views
soledad
NXP Employee
NXP Employee

Hello Roger,

Sorry for the delay, I tested the eth_to_serial located at  the path C:\Freescale\Freescale_MQX_4_2\rtcs\examples without issues.

Could you please check the default jumper settings?

Important Jumper Settings (board Rev. B)

• The default jumper settings for TWR-K64F120M standalone operation:

• J1, J16, J18, J19, J20, J31, J38 on position 1-2

• J6, J7,J8, J22, J23, J24, J25, J26, J27, J28, J33, J31, J34, J35, J36 and J39 closed

• J32 open

• J29 on position 5-6

• J10 and J15 on position 2-3

• To enable Ethernet communication (use with TWR-SER):

• TWR-K64F120M - Jumper J32 on position 1-2 - processor clock taken from the TWR-SER board

• TWR-SER - CLK_SEL 3-4

• TWR-SER - CLKIN-SEL 2-3 (processor clock is taken from PHY)

• TWR-SER - ETH-CONFIG J12 9-10 to select RMII communication mode

• Important: Plug both the processor and the serial board (TWR-SER) into the Tower. Processor is using external

clock from Ethernet PHY on the serial card.

Regards

Sol

0 Kudos