pypruss.open(0) throws SystemError: error return without exception set

Issue #4 new
James Choi created an issue

Running even the most basic example or from the interpreter, every time pypruss.open(0) called

Traceback (most recent call last):
  File "ddr_write.py", line 23, in <module>
    pypruss.open(0)                                                     # Open PRU event 0 which is PRU0_ARM_INTERRUPT
SystemError: error return without exception set

Comments (1)

  1. Laughing Cavalier

    Hello there.

    I have replicated this issue, and determined that the problem was that the PRUs were not enabled in my device tree binary.

    Is it a safe assumption you're working on a beaglebone? If you can find the ".dtb" file you're using in /boot, you can decompile that with

    dtc -I dtb -O dts  <your device tree blob>.dtb > device_tree_source.dts
    

    I'll let you read the manual to see what those flags do.

    Now that you have the source, scroll down to the node that says "pruss@4a30000 { ..." or something similar. There is a value in there called "status," which may be set to "disabled." Do NOT set it to "enabled." Set it to "okay." Once that's done, recompile your device tree by swapping the "-I" and "-O" flags, and pipe the data back to the original ".dtb" file. It should go without saying that you should make backups of the dtb.

    After that, it worked for me, but of course, all of this only works if you're on a beaglebone. I must stress that if you're on some other machine, do not trust me. Verify from some other source. You can probably brick your device by screwing that file up.

    You can probably make use of this writeup: https://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone//blog/2013/05/22/bbb--working-with-the-pru-icssprussv2

  2. Log in to comment