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.

AM3358: UART pins don't work with PRU

Part Number: AM3358

Hi,

I have succesfully managed to run a simple application on PRU, which turns on and off some GPIO outputs.

Now I wanted to try the "PRU_Hardware_UART" example, but when measuring the voltage at PIN pr1_uart0_txd (D16), I see no changes.

In my device tree overlay the pinmux looks like this:

AM33XX_IOPAD(0x834, PIN_OUTPUT_PULLUP | MUX_MODE6)   /* gpio1_13 */
AM33XX_IOPAD(0x980, PIN_INPUT | MUX_MODE5)           /* pr1_uart0_rxd */
AM33XX_IOPAD(0x984, PIN_OUTPUT | MUX_MODE5)          /* pr1_uart0_txd */

I configured gpio1_13 as normal PRU gpio, which works quite well. But from pr1_uart0_txd I get no output when running the "PRU_Hardware_UART" example of the pru software support package.

Then I let gpio1_13 toggle every time, when a byte is sent and the timing of the UART seems OK. So the application is running correctly.

I tried it with both Beaglebone Green and Octavo Systems OSD335x-SM using Debian 9 with Kernel 4.14 and it behaves the same.

What am I doing wrong?

  • Hello Gianluca,

    Did you disable loopback?

    Look at the Technical Reference Manual (TRM) PRU_ICSS_UART registers, register MCR bit 4 (LOOP).

    If you disabled loopback and it is still not working, we should back up and made sure the unmodified program is working as expected. Inspect the "buffer" array of an unmodified version of the code to verify that all the bits were successfully received.

    How to inspect the array variable? If using Code Composer Studio (CCS), you can just inspect it there. If using Linux, you can save variable values to a known location by adding test code to your program similar to below.

    #define TESTA    (*((volatile unsigned int *)0x100))
     
    main(void){
                  TESTA = 0xDEADBEEF;
    }

    Note that the absolute memory address is different than the memory address from the PRU’s perspective, e.g. TESTA is at 0x4a300100 when you are trying to look at it from the Linux command line on an AM335x. So you would probe the memory location using devmem2 0x4a30100

    Regards,

    Nick

  • Many thanks, enabled loopback was the problem.