jenswi-linaro / lcu14_optee_hello_world

22 stars 16 forks source link

TA log #16

Closed Miraje closed 8 years ago

Miraje commented 8 years ago

Hi, I just tried this example and when analysing the source code of the trusted application I saw the following:

    /*
     * The IMSG() macro is non-standard, TEE Internal API doesn't
     * specify any means to logging from a TA.
     */
    IMSG("Hello World!\n");

I was wondering where does this macro (IMSG) logs to. Where is the file that IMSG prints "Hello World" located?

Thanks in advance.

vchong commented 8 years ago

Before you can build a TA, you need the TA development kit generated by building optee_os. The dev kit is generated in optee_os/out/arm-platform-$PLATFORM/export-ta_arm{32,64}. IMSG and others are defined in export-ta_arm##/include/trace.h. You can also find the original copy in optee_os/lib/libutils/ext/include/trace.h.

Miraje commented 8 years ago

@vchong Thank you very much for your response. But I checked the those files and I still can't figure out where is the log is. There is some kind of file that has the prints: "Hello World!" and "Goodbye!" right? I though it would be in the folder /var/log but I didn't saw anything there.

vchong commented 8 years ago

@Miraje Sorry, I misunderstood you. It just prints to the secure world terminal console, not a file. Do you not see it?

Miraje commented 8 years ago

@vchong When I execute hello_world I get the following output:

root@FVP:/ hello_world
Invoking TA to increment 42
TA incremented value to 43
root@FVP:/ 

How can I access the secure world terminal console?

Note: I am running this example on the juno-r2 board.

Once again thank you for your response.

vchong commented 8 years ago

I'm not really sure since I don't have a Juno board. Looking at the code, it should be uart3, or perhaps labeled as 'SoC UART1'. Do you see any console port with that label at the back of the board?

Miraje commented 8 years ago

Yes that's it!

@vchong thank you very very much for your help!!!.