Hello there,
I am using the BLE example design "private_profile_server" and I would like to add a UART communication to the design.
After removing the default pins configuration for the UART_1 on (pins11-10) and the SPIF (pins17-21) , I set-up the pins for the UART_1 at pins 19-20
Then I use as UART example designs , two options:
- A) UART_0 set-up on the same "private_profile_server" example design. This uses the Serial Manager Interface functions
- B) UART_0 set-up on "usart_interrupt" example design. This uses the UART Drivers functions
Inside BleAppInit(), I initialize the UART_1 using option A) Serial Manager Interface functions:
Following the Serial Manager Interface functions, and changing their parameters to the UART_1 like:
Serial_InitInterface(&gImp_UARTMsg, gSerialMgrUart_c, DEBUG_SERIAL_INTERFACE_INSTANCE);
Serial_SetBaudRate(gImp_UARTMsg, gUARTBaudRate115200_c);
Serial_Print(gAppSerMgrIf, "\r\nBleApp_Init(), UART_1 initialization value: ", gNoBlock_d);
Serial_PrintDec(gAppSerMgrIf, report_UART_1);
I would be expecting to get reported the same value than it does for the DEBUG_UART @ UART_0, this is '0':
BleApp_Init(), App UART initialized: 0
However, the Serial Manager reports that can not deal with 2 UARTs at the same time!!
BleApp_Init(), IMP UART initialization value: 3 ( gSerial_MaxInterfacesReached_c = 3)
As a second chance, inside BleAppInit(), I initialize the UART_1 using option B) UART drivers functions:
Following the UART Driver functions defined in the "uart_interrupt" example design and changing their parameters to the UART_1 like:
The USART_Init() returns an status of the initialization process, which this time is as expected, '0':
BleApp_Init(), App UART initialized: 0
IMP_Init_UART(), IMP UART initialization value: 0 (Great I though!!)
But when the next command sends a string to be printed in the UART_1 port, my COM terminal does not print out anything.
I have checked the UART adapter on the Debug port where I can see the same message than at the MCUXpresso IDE
Attached the provate_profile-server.c file I am using for your review
Any ideas why:
- Serial Manager Interface functions, do not allow more than 1 UART to be managed?
- UART Drivers functions seem to set-up UART_1 correctly but no message is being send via Tx port/pin?
Solved! Go to Solution.
I found out the problem was due to the HW pin initialization not being applied.
After updating the pins via the MCUXpresso 'Config Tool' using my own Pins Group = PinsFunc_1, the function created by the tools with the new pins configuration needs to be called on the SW App code.
Calling the additional UART pins configuration on the code
I found out the problem was due to the HW pin initialization not being applied.
After updating the pins via the MCUXpresso 'Config Tool' using my own Pins Group = PinsFunc_1, the function created by the tools with the new pins configuration needs to be called on the SW App code.
Calling the additional UART pins configuration on the code