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.

How the PRU events 16-31 are set to appropriate sources of ADC or EnDat in FOC example from Sys/Bios SDK?

Other Parts Discussed in Thread: AM4379

Hi,

I've tried to do an example of FOC control from Sys/Bios SDK (named: motor control). At the stage of PRU-ICSS initialization, the appropriate struct pruss0_intc_initdata generated in main.c is equal to constant PRU_ICSS0_INTC_INITDATA defined in file pruss_intc_mapping.h. Most of the PRU System Events are detailed in Table 30-28. "PRU-ICSS0 System Event" from AM4379 TRM what seems preety easy so far. However, four interrupts (ICSS0_PRU_ENDAT_TRIGGER, ICSS0_PRU_ADC_MAN_TRIG, ICSS0_PRU_ARM_FOC_TRIG, ICSS0_PRU_ENDAT_COMPLETE) are of the numbers 16-19 so they should be generated by the PRU itself. I cannot find any hint where the signals from ADC or Encoder are connected to those events. Is there any function or definition in the code where those sources are set to activate the events 16-19 of the PRU?

I use the IDK AM437X together with SYS/BIOS SDK 2.1.1.2

Thank you in advance.

Jacek

  • Hi,

    I will forward this to the ISDK team.
  • Hi,

    Firmware running in ADC PRU (ICSS0 - PRU1) causes it to happen, see sources @sdk/interfaces/[sddf, pru_onchip_adc_sampling]

    Regards
    afzal
  • Hi,
    Thanks for response.
    Is this firmware already downloaded on my board or I somehow send it to PRU1 everytime I load the program 'motor control' to Cortex A9?
    I saw function PRUICSS_pruExecProgram in foc.c so a code must exists somewhere but I cannot localize it anywhere in the project.

    System events of numbers from 16 to 31 (pr0_pru_mst_intr_intr_req) must be programmed within PRU, so this unit actually activates itself?

    Regards,
    Jacek
  • Hi,

    PRU firmware is loaded upon running motor control application (by FOC part). Before "PRUICSS_pruExecProgram()", there is "PRUICSS_setPRUBuffer()", and this points to PRU firmware binary in array (e.g. SDfirmware[], in "sdk/interfaces/sddf/firmware/sddf_bin.h") format. The above mentioned header file is created upon building PRU firmware (CCS PRU project can be used to build it from sources, e.g. like sdk/interfaces/sddf/firmware).

    For the other, see whether TRM section 30.4.1.2.2 "Event Interface Mapping (R31): PRU System Events" helps you.

    Regards
    afzal