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.

C based DCAN PRU

Other Parts Discussed in Thread: AM3358

1205.Am335xCansendPRU.cHi,

I'm trying to initialize and send data via DCAN of AM3358 using PRU of the same SOC for the same I have referred DCAN driver "dcan.c" from https://github.com/BeaglePilot/PRUSS-C/tree/master/PRUSS_LIB/AM335X_StarterWare_02_00_01_01/drivers. Here I'm not exactly aware of sequence to initialize DCAN core and send daa.


I was able to succeed the same using ARM core running on Linux but my requirement is to do the same using PRU under C based environment. Attached a sample file written in C, which uses DCAN functions from dcan.c, which is not working at this moment, can some one help me here?

I see some here, https://github.com/embest-tech/AM335X_StarterWare_02_00_01_01/tree/master/examples/evmAM335x/dcanTxRx.


Thanks,

Suresh

  • Moving this to the Starterware forum.

  • Suresh Kalidasan said:
    Attached a sample file written in C, which uses DCAN functions from dcan.c, which is not working at this moment, can some one help me here?

    We'd need more details as to how it's "not working." You've enabled the OCP port meaning you can write outside of the subsystem.

    As you step through the functions (to which we don't have source) do you see the peripheral registers updating at all?

    Does the peripheral look like it's turned on and running?

  • 2627.dcanDebug.zip


    Hi Tim,

    Yes, after the code execution we are able to see the update in CTL register as below

    Read Value from 481cc000 is 140e


    can you guide me on verifying your question "Does the peripheral look like it's turned on and running?"

    attached code snippets which flows from main.c file. I load the PRU engine from Linux env which will execute the above files, then using a small debugging env under Linux we see the above value being updated on CTL register.


    Pls let me know if you have set of registers to be verified, also share if any trials in modification of code to be done. As I mentioned already I have used information from ttps://github.com/embest-tech/AM335X_StarterWare_02_00_01_01/tree/master/examples/evmAM335x/dcanTxRx.


    -Suresh

  • Hi TI Team,


    I was able to succeed data transmission over DCAN from PRU and now I'm on reception part where I need to register interrupt and process.


    The transmission side is still not stable, mostly one is 5 tries it is not working; after restart it may. I suspect some with compilation, I have attached related code snippets, Build Console log and map file. Can you share your thoughts.

    5773.dcanDebug_build.zip


    Thanks -Suresh