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: PRU: ECC Error event impossible to enable

Part Number: AM2634

Hi,

I am trying to activate the event generation when an ECC event occurs in the RAM of the PRU-ICSS. According to my understanding based on AM335x TRM, this is configurable trough the CFG registers of the PRU and more specifically the ISRP, ISP, IESP and IECP registers.

I tried the following code:

/* enable all ECC error events */
PRU_CFG.IESP = 0x000FFFFF;

/* read back IESP register */
uint32_t iesp = PRU_CFG.IESP; // I read back 0x00000000

/* test enabling - fake event */
PRU_CFG.ISRP = 0x000FFFFF;

/* read back raw event */
uint32_t isrp = PRU_CFG.ISRP; // I read back 0x000FFFFF

/* read back ecc error event */
uint32_t isp = PRU_CFG.ISP; // I read back 0x00000000

Unfortunately, the configuration looks pretty simple but writing into IESP seems to do nothing. So I double-checked and this register is (for my code) at address 0x0002601C, which looks good according to the information I have access to.

Could someone please help me with that issue? My guess is that ECC error event is not behaving on AM263x as on AM335x or that the register offset as changed between AM335x and AM263x.

Thank you and Regards

Nicolas

  • Hi Nicolas,

    I'm looking into this and will get back with you shortly.

    Regards,
    Frank

  • Hi,

    thank you. I'm looking forward to your answer.

    Regards, Nicolas

  • Hello Nicolas,

    I am from the Sitara MPU team (we support slightly different parts than Frank does, he's on the Sitara MCU team). So I'll be commenting from the perspective of Sitara MPU parts, like AM62x/AM64x.

    Summary 

    If you are using PRU Software Support Package (PSSP) as a reference, use AM62x as your template instead of AM335x. https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/  Additional details about AM263x vs AM62x will be in my next reply.

    Details

    Yes, the interrupt register names did change between the version of PRU-ICSS on AM335x and the version of PRU-ICSS on AM263x.

    It looks like you are using the header files provided in the PRU Software Support Package? If so, please reference the AM62x header files instead of the AM335x header files. AM62x should have the same register set as AM263x. I would start by checking PRU_INTC: https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/include/am62x/pru_intc.h

    Please double-check the AM263x Technical Reference Manual (TRM) for accuracy 

    There was an issue in the text used to generate the PRU chapters for both AM263x and AM62x where the wrong register names were documented. I fixed the issue for AM62x, but I am not sure whether the AM263x TRM got fixed. Can you please check the AM263x TRM to see if it was updated properly? If not, please tell Frank so he can file a bug.

    In chapter PRU > PRU Local INTC:

    Interrupt Status Checking
    Reading ICSS_INTC_ENABLE_CLR_REGx shows the enabled status of interrupts --> Should say ICSS_INTC_ENA_STATUS_REGx

    Interrupt Status Clearing
    Writing ICSS_INTC_ENABLE_CLR_REGx will clear the status of an interrupt --> Should say ICSS_INTC_ENA_STATUS_REGx

    Interrupt Controller Basic Programming Model
    When configuring the interrupt controller, clear interrupt by writing 1h to ICSS_INTC_ENABLE_CLR_REGx --> Should say ICSS_INTC_ENA_STATUS_REGx

    Regards,

    Nick

  • Other information: PRU resources, AM263x vs AM62x, etc 

    Most of the PRU resources are hiding in the Sitara MPU Linux SDK docs: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/08_04_01_03/exports/docs/linux/Foundational_Components_PRU_Subsystem.html 

    There is very little documentation in the MCU+ SDK for PRU development. Currently, only the PRUICSS host driver is documented: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/08_04_00_17/exports/docs/api_guide_am263x/DRIVERS_PRUICSS_PAGE.html

    AM263x uses a PRU-ICSS which is an updated version of the AM335x/AM437x PRU-ICSS. For a list of differences, please reference the PRU Feature Comparison app note: 
    https://www.ti.com/lit/sprac90 

    AM62x and AM263x use the exact same PRU-ICSS version (we call it PRU-ICSSM v2.3), but the "ICSS" part is not enabled on AM62x: 

    o Industrial Communications Subsystem features not supported:
     Ethernet (MII signals and MDIO signals are not pinned out)
     Three Channel Peripheral Interface (EnDat 2.2 and BiSS not supported)
     Sigma-Delta (SD)

    One other difference between AM62x & AM263x is max clock frequency: AM263x PRU core frequency has a max of 200MHz (5ns per instruction), while AM62x PRU core frequency has a max of 333MHz (i.e., exactly 3 ns per instruction). This does not affect the linked PRU examples or the PRU SW Support Package examples.

    What PRU Software examples do we have?

    https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/  (PSSP)

    In particular, new PRU developers should look at the examples and labs/Getting_Started_Labs.

    AM64x & AM24x
    PRU projects should be interchangeable as long as there is nothing Linux specific (i.e., the RPMsg project does not apply, and the Direct_Connect example would need to do INTC setup from the PRUICSS driver or within the PRU firmware as per the project ReadMe doc). Everything else should be the same (i.e., same Linker command file, same C code header files). Make sure to build the project in a binary format that the PRUICSS driver understands.

    AM62x & AM263x
    PRU projects should be interchangeable as long as there is nothing Linux specific, or specific to the SoC outside of the PRUSS. (so in addition to the notes for AM64x/AM24x, the AM62x header files named sys_PERIPHERAL may not apply to AM263x). Everything else should be the same (i.e., same Linker command file, same C code header files). Make sure to build the project in a binary format that the PRUICSS driver understands.

    OK that looks like fun getting started code for AM62x/AM64x. But where's the AM263x code & documentation? 

    AM263x:
    for now, I am focusing on Sitara MPU products (AM64x, AM62x). AM263x-specific docs will have to come from the Sitara MCU team. HOWEVER, any non-Linux documentation for AM62x generic PRU should apply to AM263x since they use the same version of the PRU-ICSSM v2.3 IP. Note that even though the IP inside the chip is the same, the PRU Ethernet signals are not pinned out on AM62x.

    AM62x code:
    I added AM62x support to PSSP v6.1.0. So make sure you are using that tag or later. 

    AM62x documentation:
    In particular, the Getting Started Labs should be helpful for new customers. The documentation is here: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/08_04_01_03/exports/docs/common/PRU-ICSS/PRU-Getting-Started-Labs.html 

    Regards,

    Nick

  • Hi Nick,

    Thank you very much for your exhaustive answer! I appreciate it very much.

    That is an extremely valuable info that I should take AM62x as example instead of AM335x. I guess there are no major differences with AM335x (except ICSS part) because until know I never met any incompatibility except for ECC error configuration.

    Therefore, I just downloaded PSSP v6.1.0 (I had the 6.0.1), the TRM of AM62x and I will dive in the documentation to update my code and dive deep in the documentation and I will use your inputs as starting point. I already have seen that the part about ECC errors has changed in comparison with AM335x.

    Once again, thank you very much for your valuable answer.

    Have a nice day.

    Regards, Nicolas

  • Hmm, I do not see the PRU registers listed in the AM263x TRM or TRM register addendum. The Sitara MCU folks tell me that they will be added in the next TRM revision (which I think goes live in the next week or so).

    The AM62x TRM lists a bunch of registers, but they are not formatted well in Revision A of the TRM. I have filed a ticket with the team to get the registers reformatted and to get the register names to match.

    When searching for a PRU register in Rev A of the AM62x TRM, please don't use the full register name.

    e.g., section " Interrupt Enabling" lists registers that you may be interested in using. (note that you can also use the PRUICSS driver to configure the INTC if desired)
    Let's take register  ICSS_INTC_ENABLE_SET_INDEX_REG as an example.
    To find the register definition, search for "ENABLE_SET_INDEX_REG"
    The register definition is currently renamed to ICSSM0_COMMON_0_ENABLE_SET_INDEX_REG

    And then if you search in the AM62x header files (only usable if using C code, not assembly), you can find the register defined with the same search "ENABLE_SET_INDEX_REG":
    https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/include/am62x/pru_intc.h 
    You can find more information about how the header files work (if needed) here:
    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/08_04_01_03/exports/docs/common/PRU-ICSS/Header_Files.html 

    Regards,

    Nick

  • Hi Nick,

    Thank you for the update. I am looking forward for the update of the AM263x TRM. It will make life a bit easier but in the meantime, there is always a workaround. I found the headers of PSSP quite readable and well written. Even if the register' names are not exactly the same as in the doc, there is a logic (as you explained) that makes it easy to find the right register. So I haven't even checked the documentation! Thank you (and all involved persons) for the good job.

    In the meantime, I have seen that the ECC module is more complex on PRU-ICSSM v2.3 as on the PRU-ICSS of AM335x. So I have postponed its integration. But now that I have the right infos, it will not be a nightmare to integrate it.

    Regards, Nicolas

  • Nicolas,

    In the meantime, I have seen that the ECC module is more complex on PRU-ICSSM v2.3 as on the PRU-ICSS of AM335x. So I have postponed its integration. But now that I have the right infos, it will not be a nightmare to integrate it.

    I gather you're ok on this topic for now (thanks ), so I'll close the thread.

    Regards,
    Frank