How to generate server certificate?

Hello, i’ve run SSL server on stm32f407 and now i’m trying to generate my own 3 arrays of certificate and keys instead of test from mbed. Here they are for example:
-TEST_SRV_CRT_EC_PEM
-TEST_CA_CRT_EC_PEM
-TEST_SRV_KEY_EC_PEM
As far as i understood last 2 can be generate like here(How to generate a self-signed certificate — Mbed TLS documentation)
Key(3-rd line) can be obtained: programs/pkey/gen_key type=rsa rsa_keysize=4096 filename=our_key.key
2-nd: programs/x509/cert_write selfsign=1 issuer_key=our_key.key
issuer_name=CN=myserver,O=myorganization,C=NL
not_before=20130101000000 not_after=20151231235959
is_ca=1 max_pathlen=0 output_file=my_crt.crt
and that file (my_crt.crt) also should be inserted into browser(import into trusted certificate)?
But what about the first?
Can you describe how to obtain 1-st line and is it correct about the other files?