This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2634: How to output UART log for each CORE

Part Number: AM2634

Tool/software:

Hello TI team,

In the example code, R5F 0-0 outputs UART logging using shared memory.
Instead of using shared memory, I would like to create a semaphore to control the UART and have each core output the UART log.
I want to reduce inter-core communication.
Please tell me how to implement this

environment:
CCS12.7.0
AM243x MCU+SDK 09.02.01.05
LP-AM2434

What should I do?

 .

Thank you and looking forward for your response.
Regards,
Yoshiki Koide

  • Hello Yoshiki,

    I am assuming you are trying to use UART to output for all the cores, although it is configured initially for R50. 
    I believe this can be done, allow me few business days to look into this.

    Regards,

    Vaibhav

  • Hello Yoshiki,

    Here are my thoughts on what looks like UART's dynamic allocation.

    So, my understanding of your usecase is as follows.

    You have a setup which will run an IPC and lets say the cores are R500, R501 and R511. And with just one UART instance lets say UARTx you would like to execute the DebugP_Log("SAMPLE") on all the three cores. It is obvious that this cannot be done simultaneously but one after another.

    So, as per my understanding, the UART is lets say configured for R500 so it goes ahead and prints for the R500 application but when it comes to other core's logging statements, we would need to reinitialize the UART for that specific core and make sure to deinitialize before intializing in different core's application. So the flow would like as follows:

    R500:

    UART opens and init done

    logging completed

    Uart deinit and close

    R501:

    Make sure UART is free to use and not initialized anywhere else

    Uart open and init

    logging completed

    Uart deinit and close

    This will also require the R500 to communicate to R501 using IPC Notify Sync All mechanism, this means R500 will say: "R501 I am done using UART, you can go ahead and use it".

    Let me know if this would work for you.

    Regards,

    Vaibhav 

  • Hello,Vaibhav
    I want to output UART from all COREs. Please give me some advice.

  • Hello,Vaibhav
    > "This will also require the R500 to communicate to R501 using IPC Notify Sync All mechanism, this means R500 will say: "R501 I am done using UART, you can go ahead and use it"."

    Your idea doesn't reduce inter-core communication.

    I want to output UART from all cores.
    Do you have any other ideas?

  • Hello Yoshiki,

    I understand that using IPC Notify Sync All will not reduce inter process communication, but that is just one of the way.

    Using semaphores could be another. But I have not yet tried this yet or checked the possibility of it yet.

    Please give me sometime to run few experiments and check if this is possible using semaphores given you do not want to use the shared memory.

    Regards,

    Vaibhav

  • Thank you for your answer.

    > "Please give me sometime to run few experiments and check if this is possible using semaphores given you do not want to use the shared memory."
    Yes. I am waiting. Please do.

  • Hello Yoshiki,

    Allow me few business days to get back on this.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    Could you update the current status?

    Best Regards,

    Kasai

  • Hello Tetsuro,

    As I was in a critical debug, hence posting responses after a week.

    I would suggest you to go through: C:\ti\mcu_plus_sdk_am243x_09_02_00_50\source\kernel\dpl\SemaphoreP.h

    Have you used any of the mentioned APIs to implement on your own?

    An example on how to construct a semaphore and use them can be found in the file: C:\ti\mcu_plus_sdk_am243x_09_02_00_50\examples\drivers\uart\uart_echo_callback\uart_echo_callback.c

    Note: Uart echo callback is also an example, so you would have good understanding on the usage of semaphores too.

    Regards,

    Vaibhav

  • Hello, Vaibhav
    Thank you for your response.

    I am thinking of using the IPC Notify echo sample to check.
    When I configure syscfg to use UART on each core, I get a conflict error.

    Sharing UART0_RXD/B10 and UART0_TXD/B11 between R5FSS0-0 and R5FSS0-1 will cause a conflict error. Figure PAT 1 below.
    If they are not shared, no error is generated. PAT 2.


    If PAT 2. is used, I think R5FSS0-1 will not output the UART log.
    If PAT 1. is used, I think the UART log will be output on R5FSS0-1.

    How can I resolve this? Please let me know the solution. Please.

    Regards.


    R5FSS 0-0

    R5FSS 0-1

  • Hello Yoshiki,

    Let me replicate your setup firstly.

    I am going to run IPC notify to check the behaviour of the uart logs.

    Regards,

    Vaibhav

  • Hello Yoshiki,

    You can simply go ahead and add UART1 as UART0 will not be possible as it is already configured for R50_0.

    Also, can you please clarify how you are going to specify which DebugP_log("Some print statement") is meant for x, y or z core?

    Because, please look at the below attached image.

    One common file among all of the applications is ipc_rpmsg_echo.c, used by r50_0, r50_1, r51_0 and r51_1.

    So, on this note, how will you differentiate the same?

    FYI, I just imported the system freertos nortos example from AM243x MCU PLUS SDK onto CCS. The directory for that is: C:\ti\mcu_plus_sdk_am243x_09_02_00_50\examples\drivers\ipc\ipc_rpmsg_echo\am243x-lp\system_freertos_nortos

    Regards,

    Vaibhav

  • Hello Vaibhav,

    I found it difficult to use the IPC environment, so I created an empty project and added UART to the syscfg. IPC is not used.
    The CORE configuration is R5F 0-0, 0-1, 1-0, 1-1, M4F 0-0.
    I want UART log output on all CORE.

    Specifying UART0 for all COREs will result in a CONFLICT error.

    "You can simply go ahead and add UART1 as UART0 will not be possible as it is already configured for R50_0."
    > To avoid conflict error, R5F 0-1 was changed to UART1.

    UART Interface for R5F 1-0, R5F 1-1, and M4F 0-0 is shown in Fig. 1.

    I checked the AM243x LaunchPadTm Development Kit User's Guide.
    I think only USART0 outputs log.
    With the settings in Fig 1, I think R5F 0-1, 1-0, 1-1 and M4F 0-0 do not log output.

    I understand the use of SemaphoreP_pend() and SemaphoreP_post().
    In the configuration shown in Fig. 1, each CORE controls a different UART, so no semaphore is needed.

    I want to log output to UART0.
    I want all COREs to share UART0, so I use SemaphoreP_pend(), SemaphoreP_post().
    How do I set up syscfg?

    "So, on this note, how will you differentiate the same?"
    I think this is the same question I have.
    I want to use UART0 on all CORE.
    How can I distinguish between them?

    Regards,

    Yoshiki

  • Hello Yoshiki,

    Please allow me sometime to read through and you can expect responses in several business days.

    Regards,

    Vaibhav