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.

dig--02715-001

Other Parts Discussed in Thread: TDA4VM

Hi,

I am trying to access MainUART from MCU domian on TDA4VM, I am updating the baseaddress on uartInitCfg[0] and with UART1 base address. In board configuration I have updated uartInst as BOARD_MCU_UART_INSTANCE and uartSocDomain as BOARD_SOC_DOMAIN_MCU. Please see the below snippet of code .

but I am not seeing any prints on Main domain. 

I have used the uartInst as BOARD_MCU_UART_INSTANCE so as to fetch the 0th configuration from uartInitCfg[], also I have commented UART_socInit() from uart_init() to avoid routing of main UART to MCU UART. But I have doubt regarding the interrupt configuration on UART_open_v1(). Does the driver has taken care of interrupt routing? Is there any document available to see how the interrupt router configuration should be?

Regards,

Alex  

  • Hi Alex,

    What's the intent behind using the main UART for mcu UART prints?

    Regards,
    Parth

  • The intention is not to get prints instead is to use a peripheral device which will be connected on main UART1 and the binary would be MCU domain. I was able to communicate with 115200 baudrate with above changes but I want to use 921600 and I am just seeing junk prints with 921600 baud rate. 

  • Hi Alex,

    Can you try adding params.baudRate = baudRate; before UART_open in UART_stdioInit at <PDK>\packages\ti\drv\uart\src\UART_stdio.c

    Regards,
    Parth

  • Hi Parth,

    Thanks for the response.

    I have tried new baudrate by modifying the baudrate in UART_defaultParams structure which I believe would have the same impact since UART_Params_init is fetching the configuration paramters based on UART_defaultParams structure. 

    . Please see the code snippet below. 

    I have observed the divisor calculation is based on the clock frequency, baudrate, operating mode and UART_MIR_OVERSAMPLING_RATE_42 (Over-sampling rate for MIR mode used to obtain the Divisor Values). Do we need to take care of any of these parameters. I am using the following for now

    • baudrate = 921600
    • frequency = 48MHz(also tried with 96Mz)
    • Operating mode = UART16x_OPER_MODE
    • Over-sampling rate for MIR mode used to obtain the Divisor Values = UART_MIR_OVERSAMPLING_RATE_42

    Regards, 

    Alex

  • Hi Alex,

    I believe that just changing the baudrate should be enough, the driver should take care of the rest. Did you get a chance to try this out? Are you seeing proper prints with this?

    Regards,
    Parth

  • Hi Parth,

    Can you try adding params.baudRate = baudRate; before UART_open in UART_stdioInit at <PDK>\packages\ti\drv\uart\src\UART_stdio.c

    I believe changing the baudrate in UART_defaultParams structure will have the same behavior as adding params.baudRate = baudRate.  

    I have even tried by the way you suggested but still I am only seeing junk prints.

    Do we need to take care of anything else in software?

  • Hi Alex,

    Can you please share a patch of changes that you have done? I'll check it and try to reproduce the issue on my end.

    Regards,
    Parth

  • Hi Parth,

    I also tried with different baudrate on MCU uart, there also I was getting junk prints. I am not using apputils here instead I am using UART_printf function.

    • In board_utils.c
      Modified highlighted  
      Board_initParams_t gBoardInitParams = {BOARD_MCU_UART_INSTANCE, BOARD_SOC_DOMAIN_MCU, BOARD_PSC_DEVICE_MODE_NONEXCLUSIVE, BOARD_MAIN_CLOCK_GROUP_ALL, v BOARD_MCU_CLOCK_GROUP_ALL};
                                            
    • In UART_stdio.c
      Added the highlighted line
      void UART_stdioInit(uint32_t value)
      {
          UART_Params         params;
          SemaphoreP_Params   semParams;
          char                semName[] = "uartStdio";

          if(uart_stdio.uart_handle==NULL)
          {
            UART_init();

            UART_Params_init(&params);
            
            params.baudRate = 921600;
            
            uart_stdio.uart_handle = UART_open(value, &params);

            /*
             * Construct thread safe semaphore for UART_printf
            */
            UART_osalSemParamsInit(&semParams);
            semParams.mode = SemaphoreP_Mode_BINARY;
            semParams.name = semName;
            uart_stdio.sem = UART_osalCreateBlockingLock(1U, &semParams);
          }
      }
    • In UART_drv.c
      Modified highlighted  
      void UART_init(void)
      {
          if (UART_count == (-((int32_t)1))) {
              /* Call each driver's init function */
              for (UART_count = 0; UART_config[UART_count].fxnTablePtr != NULL; UART_count++) {
                  UART_config[UART_count].fxnTablePtr->uartInitFxn((UART_Handle)&(UART_config[UART_count]));
              }
          }

      #if defined (BUILD_MCU)
          // UART_socInit();
      #endif
      }

    Thanks & Regards,

    Alex

  • Hi,

    Closing this one as this has been moved to private e2e.

    Regards,
    Parth