Callback attach method?

No I mean, the line of code what give you the error or the line what you want to convert from old system to new one.

Hmm, in case of SoftSerial I remember there were some issue about it. Try to check this topic - SoftSerial problem L432KC - Mbed OS / Hello world! - Arm Mbed OS support forum

BR, Jan