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.

RTOS/PROCESSOR-SDK-AM437X: Loading PRU image

Part Number: PROCESSOR-SDK-AM437X

Tool/software: TI-RTOS

Hi,

(IDKAM437x, pdk_am437x_1_0_6, processor_sdk_rtos_am437x_3_03_00_04, CCS v7)

maybe I didn't completed my homework, but I can't find information how make C array which contain program code for PRU.

I was planing to load PRU program with ARM and run it.
This should be done with:

PRUICSS_setPRUBuffer();
PRUICSS_pruExecProgram();
PRUICSS_pruEnable();

Right?

I see that in PRP/HSR instruction array is made with PDSP assembler.

I can't found any information how to make such file for C PRU code.

So far I load PRU cores with .out in CCS.... now I want to integrated loading and exe. in RTOS application....

Please direct me in right way...

Best Regards,

Mare

  • The RTOS team have been notified. They will respond here.
  • Mare,

    You can convert .out file to firmware header file .bin using PRU code generation tool ti-cgt-2.1.x hexpru, see e2e.ti.com/.../2231359

    Regards,
    Garrett
  • Hi Garrett,

    sorry but is not enough clear for me.

    1.)I compile SORTE but I can't figure out how to run it with CCS.

    2.) I see from (SORTE) main.c:

    extern uint8_t pru_imem0_start;
    extern uint8_t pru_imem0_end;

    This are pointers are from ink.cmd.

        PRU0_IMEM : {
            pru_imem0_start = .;
            KEEP(*(PRU0_IMEM))
            pru_imem0_end = .;
        } > APP_CACHED_DATA_BLK1_MEM

    I can't figure out how an where PRU0_IMEM is defined/pointed on .bin file

    3.)Is possible to compile .bin from CCS pru project? will it work for RTOS -> 

    4.) how then include .bin file and add get address on file in ccs project?


    Thanks

  • Marko,

    Have you visited the wiki -

    Does the section 'Running the PRUSS SORTE Example' answer your 1st question?

    For question #2-4, let me try to find out if there is any document from PRU compiler tool team.

    Regards,

    Garrett

  • Hi Garrett,

    I understand that I can LOAD image, but my goal was to see whole project settings.... so I was asking if is possible to import project in CCS.

    About 2-4 Q would be nice if TI make some nice explanation...

    For now thank you for inputs and effort. I solve my problem (I think..). I just make success on one my example... let me share my experience with others and please let me know if I doing something wrong:

    1.)  see the last post -> 

    I successful make .bin files.

    2.)  Giannis Roussos suggest bin2h SW. 

    So I convert .bin file to .c array

    ..\bin2h_v1.01>bin2h yourPruProjectExample\Debug\text.bin yourARMprojectExample\text.c -id=YourNameOfArray

    .c file with array is made (array data are PRU program data).

    size_t arrayPru_len = 8192;
    unsigned char arrayPru[8192]=
    {
    	0xC0,0x00,0x00,0x24,0x80,0x00,0x01,0x24,0xE2,0xE0,0x04,
    	0x05,0xC3,0x05,0x00,0x23,0xC3,0x8D,0x00,0x23,0x80,0x24,
    	0x04,0x91,0xE0,0xE0,0x04,0x1D,0x80,0x24,0x04,0x81,0xC1,
    	0x1A,0x48,0x24,0x81,0x90,0xC1,0x24,0xC0,0x00,0x01,0x24,
    	0x80,0x00,0x00,0x24,0x80,0x21,0x00,0xE1,0xC0,0x00,0x02,
    	0x24,0x80,0x00,0x00,0x24,0x80,0x21,0x00,0xE1,0xC0,0x40,
    	0x00,0x24,0x80,0x00,0x00,0x24,0x80,0x21,0x00,0xE1,0xC0,
    	0x80,0x00,0x24,0x80,0x00,0x00,0x24,0x80,0x21,0x00,0xE1,
    	0xE0,0x00,0x20,0x24,0xC1,0x32,0x48,0x24,0x81,0x90,0x01,
    	0x24,0x80,0x21,0x00,0xE1,0xC0,0x01,0x00,0x24,0x80,0x00,
    	0x00,0x24,0x80,0x21,0x00,0xE1,0xC0,0x1A,0x48,0x24,0x80,
    	0x94,0xC1,0x24,0x99,0x20,0x00,0xF1,0xF9,0xF9,0x18,0x1F,
    	0x99,0x20,0x00,0xE1,0xD8,0x78,0x04,0x24,0x98,0xBF,0x68,
    	0x24,0xF8,0xF8,0x01,0x05,0xFF,0xF8,0x00,0x6F,0x00,0x00,
    	0x00,0x10,0x98,0x20,0x00,0xF1,0xF8,0xF8,0x19,0x1F,0x98,
    .........}

    replace size_t to unsigned int...

    3.)ARM code ....

    extern char arrayPru[8192];
    
    void loadTest(UArg arg0, UArg arg1){
        PRUICSS_Config *pruIcssCfg;
        PRUICSS_Handle handle;
    
        PRUICSS_socGetInitCfg(&pruIcssCfg);
        handle = PRUICSS_create(pruIcssCfg,2);
    
        if(PRUICSS_pruDisable(handle,0))
            while(1);
        if(PRUICSS_setPRUBuffer(handle, 0, arrayPru, (11*60)))
            while(1);
        PRUICSS_enableOCPMasterAccess(handle);
        if(PRUICSS_pruExecProgram(handle, 0))
            while(1);
        if(PRUICSS_pruEnable(handle, 0))
            while(1);
    
        while(1);
    }


    Please let me know if this is wrong or danger approach... somehow..

    Best Regards,

    Mare 

  • Hi Mare,

    Thanks for sharing your experience! I asked our PRU compiler expert reviewed your approach and their feedback is positive. Also the team is working on a integral solution to convert a binary directly to a C array. This support should be available by the end of the year. As part of that effort we will create some examples and PRU collateral in new PRU2.2 project. Most of current examples have been centered around loading the PRU cores from an ARM running Linux so the procedure isn't the same as what you are doing.

    You may find the workshop is useful - processors.wiki.ti.com/.../CCS_Modules_Library which shows how to use CCS to directly load and debug a program on the PRU.

    Regards,
    Garrett