System halts on assert when declaring a serial object that one of the pins is declared as NC (according to official Mbed OS reference)
For example: simple declaration of: Serial tx_only_ser(PE_8, NC);
Hangs on assert at: https://github.com/ARMmbed/mbed-os/blob/bacf37894945a5c9b7619b709eeabeeb68d25d9c/targets/TARGET_STM/pinmap.c#L62
That is called from: https://github.com/ARMmbed/mbed-os/blob/bacf37894945a5c9b7619b709eeabeeb68d25d9c/targets/TARGET_STM/serial_api.c#L161
STM
IAR 8.40
mbed-os-5.15.0
mbed-cli
main()
{
Serial tx_only_serial(PE_8, NC); // halts here
tx_only_serial.putc('A');
}
Internal Jira reference: https://jira.arm.com/browse/MBOTRIAGE-2487
cc @ARMmbed/team-st-mcd
Hi
@mprse @kjbracey-arm
I think issue came with static pinmap feature.
Before that pinmap_pinout was called for each uart pin, which is OK when pin is "NC".
Now serial init calls pin_function which goes to assert when pin is "NC".
Looking into this.
The patch can be found here: PR https://github.com/ARMmbed/mbed-os/pull/12186.
Fixed via 12186