Hello,
For simple use cases, you don't need functions from ecp.h, except maybe the read/write functions if you want direct access to the mathematical values (as opposed to import/export in DER/PEM, which is done in with functions from pk.h).
I recommend using the PSA crypto API (psa_xxx()), which is simpler than the legacy crypto API (mbedtls_ecdsa_xxx()). Unfortunately we don't have a demo application for signature via PSA yet. There is one in https://github.com/Mbed-TLS/mbedtls/pull/5064 (psa_sign_verify program calling psa_sign_hash() and psa_verify_hash(), see also psa_key_agreement which shows how to generate a key with psa_generate_key()). If you need to export the keys in DER/PEM, use the pk module, see the PSA transition guide: https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-3.6.0/docs/psa-transition.m... .
With the legacy API, use functions from pk.h (sign, verify, import, export) or ecdsa.h (sign, verify, generate) or both. There are examples in programs/pkey: ecdsa.c with the low-level ecdsa.h API, and gen_key.c, pk_sign.c and pk_verify.c with higher-level pk.h APIs.
Best regards,