BeagleBone Black and PRU Driver for Linuxcnc? Or switch to RP-4 / Mesa?

More
02 Aug 2021 19:38 #216744 by andypugh
It looks like I forgot to add some files. In fact a whole directory of files: The "support" directory here:
github.com/machinekit/machinekit-hal/tree/master/src/hal

Please Log in or Create an account to join the conversation.

More
02 Aug 2021 20:26 - 02 Aug 2021 21:02 #216746 by MalteS
Yes I also noticed that pru.h was a symlink in machinekit and contains some garbage now.

I replaced the symlink by the actual file (the rest of the folder support/pru does not seem needed) and also used the pasm contained in the support folder to compile the code. This reduces the errors to one :-)

EDIT: This is related to me using the shelfed machinekit project not containing the latest changes to pru.h. 

pru_wait_ecap.p(146) Error: Operand 2 invalid constant table entry 'CONST_ECAP'
 
Last edit: 02 Aug 2021 21:02 by MalteS.

Please Log in or Create an account to join the conversation.

More
More
03 Aug 2021 15:33 - 03 Aug 2021 16:06 #216843 by MalteS
Yes this is what I meant to say with my edit above. I used the old (archived) machinekit that is still similar to Linuxcnc while the new machinekit-hal project has hal broken out.

Anyway: I managed to go further. The FW for the PRUs compiles which is great. (*). I'm still having issues compiling hal_pru_generic which is needed to load the FW into the PRU. I merged the necessary changes to the linuxcnc makefile to make hal/drivers/hal_pru_generic.* compile. Now I get undefined types. Is e.g. "u32" defined somewhere in linuxcnc? It puzzles me that I also did not spot any definition of this in machinekit (I may overlook this though)

Edit: the other errors seem to indicate that different rtapi libs are used between both projects.

(*) What is also nice is that there seems to be support for BBAI as well.

Error messages:
machinekit@beaglebone:~/experiment/linuxcnc/src$ make TARGET_PLATFORM_BEAGLEBONE=1
Reading 205/206 dependency files
Done reading dependencies
Reading 217/221 realtime dependency files
Done reading realtime dependencies
Compiling realtime hal/drivers/hal_pru_generic/hal_pru_generic.c
In file included from ./hal/drivers/hal_pru_generic/hal_pru_generic.h:67:0,
                 from hal/drivers/hal_pru_generic/hal_pru_generic.c:84:
./hal/drivers/hal_pru_generic/pru_tasks.h:72:13: error: unknown type name ‘u32’
     typedef u32 pru_addr_t;
             ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:107:9: error: unknown type name ‘u8’
         u8      mode;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:108:9: error: unknown type name ‘u8’
         u8      len;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:109:9: error: unknown type name ‘u8’
         u8      dataX;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:110:9: error: unknown type name ‘u8’
         u8      dataY;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:111:9: error: unknown type name ‘u32’
         u32     addr;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:115:9: error: unknown type name ‘u32’
         u32     dword[2];
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:116:9: error: unknown type name ‘u16’
         u16     word[4];
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:117:9: error: unknown type name ‘u8’
         u8      byte[8];
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:143:9: error: unknown type name ‘u32’
         u32     period;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:144:9: error: unknown type name ‘u32’
         u32     ready;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:178:9: error: unknown type name ‘s32’
         s32     rate;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:179:9: error: unknown type name ‘u16’
         u16     steplen;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:180:9: error: unknown type name ‘u16’
         u16     dirhold;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:181:9: error: unknown type name ‘u16’
         u16     stepspace;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:182:9: error: unknown type name ‘u16’
         u16     dirsetup;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:183:9: error: unknown type name ‘u32’
         u32     accum;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:184:9: error: unknown type name ‘u32’
         u32     pos;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:185:9: error: unknown type name ‘u8’
         u8      reserved[7];
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:186:9: error: unknown type name ‘u8’
         u8      stepinv;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:213:9: error: unknown type name ‘u16’
         u16     value;          // WARNING: Range is 14-bits: 0x0000 to 0x4000 inclusive!
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:214:9: error: unknown type name ‘u8’
         u8      pin;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:215:9: error: unknown type name ‘u8’
         u8      reserved;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:216:9: error: unknown type name ‘u32’
         u32     state;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:222:9: error: unknown type name ‘u32’
         u32     reserved;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:251:9: error: unknown type name ‘u16’
         u16     value;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:252:9: error: unknown type name ‘u8’
         u8      pin;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:253:9: error: unknown type name ‘u8’
         u8      reserved;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:259:9: error: unknown type name ‘u16’
         u16     prescale;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:260:9: error: unknown type name ‘u16’
         u16     period;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:261:9: error: unknown type name ‘u32’
         u32     reserved;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:299:9: error: unknown type name ‘u8’
         u8      A_pin;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:300:9: error: unknown type name ‘u8’
         u8      B_pin;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:301:9: error: unknown type name ‘u8’
         u8      Z_pin;          // Index
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:302:9: error: unknown type name ‘u8’
         u8      mode;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:304:9: error: unknown type name ‘u8’
         u8      AB_State;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:305:9: error: unknown type name ‘u8’
         u8      AB_scratch;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:306:9: error: unknown type name ‘u16’
         u16     count;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:308:9: error: unknown type name ‘u16’
         u16     Z_capture;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:309:9: error: unknown type name ‘u8’
         u8      Z_count;        // Used by driver to compute "index seen"
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:310:9: error: unknown type name ‘u8’
         u8      Z_State;
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:314:9: error: unknown type name ‘u32’
         u32     dword[3];
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:315:9: error: unknown type name ‘u16’
         u16     word[6];
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:316:9: error: unknown type name ‘u8’
         u8      byte[12];
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:325:9: error: unknown type name ‘u8’
         u8      byte[64];
         ^~
./hal/drivers/hal_pru_generic/pru_tasks.h:331:9: error: unknown type name ‘u32’
         u32     pin_invert;     // XOR mask to invert all input pins in one instruction
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:332:9: error: unknown type name ‘u32’
         u32     LUT;            // Base address of LUT for counter modes
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:367:9: error: unknown type name ‘u32’
         u32     hiTime;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:368:9: error: unknown type name ‘u32’
         u32     loTime;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:369:9: error: unknown type name ‘u32’
         u32     curTime;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:370:9: error: unknown type name ‘u32’
         u32     curPinState;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:371:9: error: unknown type name ‘u32’
         u32     maxTime;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:372:9: error: unknown type name ‘u32’
         u32     timeIncr;
         ^~~
./hal/drivers/hal_pru_generic/pru_tasks.h:373:9: error: unknown type name ‘u32’
         u32     hiValue;
         ^~~
In file included from hal/drivers/hal_pru_generic/hal_pru_generic.c:84:0:
./hal/drivers/hal_pru_generic/hal_pru_generic.h:142:5: error: unknown type name ‘u32’
     u32 prev_accumulator;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:146:5: error: unknown type name ‘s64’
     s64 subcounts;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:148:5: error: unknown type name ‘u32’
     u32 written_steplen;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:149:5: error: unknown type name ‘u32’
     u32 written_stepspace;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:150:5: error: unknown type name ‘u32’
     u32 written_dirsetup;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:151:5: error: unknown type name ‘u32’
     u32 written_dirhold;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:152:5: error: unknown type name ‘u32’
     u32 written_steppin;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:153:5: error: unknown type name ‘u32’
     u32 written_dirpin;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:154:5: error: unknown type name ‘u32’
     u32 written_task;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:198:5: error: unknown type name ‘u32’
     u32 written_pin;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:216:5: error: unknown type name ‘u32’
     u32 written_pwm_period;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:266:5: error: unknown type name ‘u8’
     u8 prev_Z_count; // detect index events
     ^~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:268:5: error: unknown type name ‘s32’
     s32 zero_offset;  // *hal.pin.counts == (*hal.pin.rawcounts - zero_offset)
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:270:5: error: unknown type name ‘u16’
     u16 prev_reg_count;  // from this and the current count in the register we compute a change-in-counts, which we add to rawcounts
     ^~~
In file included from hal/drivers/hal_pru_generic/hal_pru_generic.c:84:0:
./hal/drivers/hal_pru_generic/hal_pru_generic.h:272:5: error: unknown type name ‘s32’
     s32 prev_dS_counts;  // last time the function ran, it saw this many counts from the time before *that*
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:274:5: error: unknown type name ‘u32’
     u32 written_state;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:276:5: error: unknown type name ‘u64’
     u64 timestamp; // Timestamp since last velocity estimation
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:277:5: error: unknown type name ‘u32’
     u32 poll_count; // Number of hpg_encoder_read_chan() calls since last velocity estimation
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:278:5: error: unknown type name ‘s32’
     s32 pulse_count; // Number of pulses since last velocity estimation
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:293:5: error: unknown type name ‘u32’
     u32 written_pin_invert;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:314:5: error: unknown type name ‘u32’
     u32 written_max_time;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:315:5: error: unknown type name ‘u32’
     u32 written_pin;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:348:5: error: unknown type name ‘u32’
     u32 *pru_data;              // ARM pointer to mapped PRU data memory
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:359:5: error: unknown type name ‘u32’
     u32 *tram_read_buffer;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:360:5: error: unknown type name ‘u16’
     u16 tram_read_size;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:363:5: error: unknown type name ‘u32’
     u32 *tram_write_buffer;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:364:5: error: unknown type name ‘u16’
     u16 tram_write_size;
     ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:385:15: error: unknown type name ‘u32’
 int fixup_pin(u32 hal_pin);
               ^~~
./hal/drivers/hal_pru_generic/hal_pru_generic.h:408:1: error: unknown type name ‘u16’
 u16 ns2periods(hal_pru_generic_t *hpg, hal_u32_t ns);
 ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:120:28: error: expected ‘)’ before string constant
 RTAPI_IP_INT(num_stepgens, "Number of step generators (default: 0)");
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:123:27: error: expected ‘)’ before string constant
 RTAPI_IP_INT(num_pwmgens, "Number of PWM outputs (default: 0)");
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:131:28: error: expected ‘)’ before string constant
 RTAPI_IP_INT(num_pwmreads, "Number of PWM read channels (default: 0)");
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:137:26: error: expected ‘)’ before string constant
 RTAPI_IP_STRING(prucode, "filename of PRU code (.bin, default: stepgen.bin)");
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:140:19: error: expected ‘)’ before string constant
 RTAPI_IP_INT(pru, "PRU number to execute this code (0 or 1, default: 1)");
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:143:26: error: expected ‘)’ before string constant
 RTAPI_IP_INT(pru_period, "PRU task period (in nS, default: 10,000 nS or 100 KHz)");
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:146:24: error: expected ‘)’ before string constant
 RTAPI_IP_INT(disabled, "start the PRU in disabled state for debugging (0=enabled, 1=disabled, default: enabled");
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:149:21: error: expected ‘)’ before string constant
 RTAPI_IP_INT(event, "PRU event number to listen for (0..7, default: none)");
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:177:38: error: unknown type name ‘hal_funct_args_t’
 static int hpg_read(void *hpg, const hal_funct_args_t *fa);
                                      ^~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:178:39: error: unknown type name ‘hal_funct_args_t’
 static int hpg_write(void *hpg, const hal_funct_args_t *fa);
                                       ^~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘instantiate_hal_pru_generic’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:217:19: error: implicit declaration of function ‘hal_inst_create’ [-Werror=implicit-function-declaration]
     if((inst_id = hal_inst_create(argv[1], comp_id, sizeof(hal_pru_generic_t), (void**)&hpg)) < 0) {
                   ^~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘rtapi_app_main’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:311:13: error: implicit declaration of function ‘hal_xinit’ [-Werror=implicit-function-declaration]
   comp_id = hal_xinit(TYPE_RT, 0, 0, instantiate_hal_pru_generic, NULL, modname);
             ^~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:311:23: error: ‘TYPE_RT’ undeclared (first use in this function)
   comp_id = hal_xinit(TYPE_RT, 0, 0, instantiate_hal_pru_generic, NULL, modname);
                       ^~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:311:23: note: each undeclared identifier is reported only once for each function it appears in
hal/drivers/hal_pru_generic/hal_pru_generic.c: At top level:
hal/drivers/hal_pru_generic/hal_pru_generic.c:340:43: error: unknown type name ‘hal_funct_args_t’
 static int hpg_read(void *void_hpg, const hal_funct_args_t *fa) {
                                           ^~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘hpg_read’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:343:27: error: implicit declaration of function ‘fa_period’ [-Werror=implicit-function-declaration]
     hpg_stepgen_read(hpg, fa_period(fa));
                           ^~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: At top level:
hal/drivers/hal_pru_generic/hal_pru_generic.c:350:1: error: unknown type name ‘u16’
 u16 ns2periods(hal_pru_generic_t *hpg, hal_u32_t ns) {
 ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘ns2periods’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:351:5: error: unknown type name ‘u16’
     u16 p = rtapi_ceil((double)ns / (double)hpg->config.pru_period);
     ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:351:13: error: implicit declaration of function ‘rtapi_ceil’ [-Werror=implicit-function-declaration]
     u16 p = rtapi_ceil((double)ns / (double)hpg->config.pru_period);
             ^~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: At top level:
hal/drivers/hal_pru_generic/hal_pru_generic.c:355:44: error: unknown type name ‘hal_funct_args_t’
 static int hpg_write(void *void_hpg, const hal_funct_args_t *fa) {
                                            ^~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘export_pru’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:398:5: error: unknown type name ‘hal_export_xfunct_args_t’
     hal_export_xfunct_args_t updateArgs = {
     ^~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:399:7: error: field name not in record or union initializer
       .type = FS_XTHREADFUNC,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:399:7: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:399:15: error: ‘FS_XTHREADFUNC’ undeclared (first use in this function)
       .type = FS_XTHREADFUNC,
               ^~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:400:7: error: field name not in record or union initializer
       .funct.x = hpg_write,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:400:7: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:400:18: warning: excess elements in scalar initializer
       .funct.x = hpg_write,
                  ^~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:400:18: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:401:7: error: field name not in record or union initializer
       .arg = hpg,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:401:7: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:401:14: warning: excess elements in scalar initializer
       .arg = hpg,
              ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:401:14: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:402:7: error: field name not in record or union initializer
       .uses_fp = 1,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:402:7: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:402:18: warning: excess elements in scalar initializer
       .uses_fp = 1,
                  ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:402:18: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:403:7: error: field name not in record or union initializer
       .reentrant = 0,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:403:7: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:403:20: warning: excess elements in scalar initializer
       .reentrant = 0,
                    ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:403:20: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:404:7: error: field name not in record or union initializer
       .owner_id = hpg->config.inst_id
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:404:7: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:404:19: warning: excess elements in scalar initializer
       .owner_id = hpg->config.inst_id
                   ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:404:19: note: (near initialization for ‘updateArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:406:9: error: implicit declaration of function ‘hal_export_xfunctf’ [-Werror=implicit-function-declaration]
     r = hal_export_xfunctf(&updateArgs, "%s.update", hpg->config.halname);
         ^~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:412:5: error: unknown type name ‘hal_export_xfunct_args_t’
     hal_export_xfunct_args_t captureArgs = {
     ^~~~~~~~~~~~~~~~~~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:413:7: error: field name not in record or union initializer
       .type = FS_XTHREADFUNC,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:413:7: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:414:7: error: field name not in record or union initializer
       .funct.x = hpg_read,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:414:7: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:414:18: warning: excess elements in scalar initializer
       .funct.x = hpg_read,
                  ^~~~~~~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:414:18: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:415:7: error: field name not in record or union initializer
       .arg = hpg,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:415:7: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:415:14: warning: excess elements in scalar initializer
       .arg = hpg,
              ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:415:14: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:416:7: error: field name not in record or union initializer
       .uses_fp = 1,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:416:7: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:416:18: warning: excess elements in scalar initializer
       .uses_fp = 1,
                  ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:416:18: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:417:7: error: field name not in record or union initializer
       .reentrant = 0,
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:417:7: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:417:20: warning: excess elements in scalar initializer
       .reentrant = 0,
                    ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:417:20: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:418:7: error: field name not in record or union initializer
       .owner_id = hpg->config.inst_id
       ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:418:7: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c:418:19: warning: excess elements in scalar initializer
       .owner_id = hpg->config.inst_id
                   ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:418:19: note: (near initialization for ‘captureArgs’)
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘pru_init_hpg’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:554:22: error: ‘u32’ undeclared (first use in this function)
     hpg->pru_data = (u32 *) pru_data_ram;
                      ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:554:27: error: expected expression before ‘)’ token
     hpg->pru_data = (u32 *) pru_data_ram;
                           ^
hal/drivers/hal_pru_generic/hal_pru_generic.c:571:52: error: expected ‘)’ before ‘hpg’
     PRU_statics_t *stat = (PRU_statics_t *) ((u32) hpg->pru_data + (u32) hpg->pru_stat_addr);
                                                    ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘hpg_wait_force_write’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:882:52: error: ‘u32’ undeclared (first use in this function)
     PRU_task_basic_t *pru = (PRU_task_basic_t *) ((u32) hpg->pru_data + (u32) hpg->wait.task.addr);
                                                    ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:882:57: error: expected ‘)’ before ‘hpg’
     PRU_task_basic_t *pru = (PRU_task_basic_t *) ((u32) hpg->pru_data + (u32) hpg->wait.task.addr);
                                                         ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:885:39: error: expected ‘)’ before ‘hpg’
     pru = (PRU_task_basic_t *) ((u32) hpg->pru_data + (u32) hpg->wait_init.task.addr);
                                       ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:888:52: error: expected ‘)’ before ‘hpg’
     PRU_statics_t *stat = (PRU_statics_t *) ((u32) hpg->pru_data + (u32) hpg->pru_stat_addr);
                                                    ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: In function ‘hpg_wait_update’:
hal/drivers/hal_pru_generic/hal_pru_generic.c:896:52: error: ‘u32’ undeclared (first use in this function)
     PRU_task_basic_t *pru = (PRU_task_basic_t *) ((u32) hpg->pru_data + (u32) hpg->wait.task.addr);
                                                    ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c:896:57: error: expected ‘)’ before ‘hpg’
     PRU_task_basic_t *pru = (PRU_task_basic_t *) ((u32) hpg->pru_data + (u32) hpg->wait.task.addr);
                                                         ^~~
hal/drivers/hal_pru_generic/hal_pru_generic.c: At top level:
hal/drivers/hal_pru_generic/hal_pru_generic.c:900:15: error: unknown type name ‘u32’
 int fixup_pin(u32 hal_pin) {
               ^~~
cc1: some warnings being treated as errors
Makefile:1098: recipe for target 'objects/rthal/drivers/hal_pru_generic/hal_pru_generic.o' failed
make: *** [objects/rthal/drivers/hal_pru_generic/hal_pru_generic.o] Error 1
Last edit: 03 Aug 2021 16:06 by MalteS.

Please Log in or Create an account to join the conversation.

More
03 Aug 2021 23:00 #216873 by cakeslob


(*) What is also nice is that there seems to be support for BBAI as well.


That might still be work in progress, as I havent seen them close the issue. Pretty sure this was done by the folks at PocketNC. they have their main driver repo on their github. I think they redid the whole driver from scratch
github.com/machinekit/machinekit-hal/issues/284

github.com/PocketNC/bb_gpio

Please Log in or Create an account to join the conversation.

More
04 Aug 2021 11:30 #216900 by MalteS
Thanks, that was an insightful read. Based on this info I have the suspicion that the current driver in the machinekit-hal project is WIP and in an unclear state right now. I have therefore dropped this approach.

I did look at the driver in the (old, archived but stable) machinekit project. The issue here seems to be around the rtapi lib which differs quite a bit between linuxcnc and machinekit. I think this is an issue that needs more time then I'm willing to spend on this (*).

I have ordered a Raspberry PI and a Mesa card now.

(*) This is because I'd still be stuck with the following downsides of the solution in this case
- a board that just barely handles the load
- a board that is _very_ limited from a Graphics perspective
- a I/O board that is essentially flying wires

Thanks for all the support
Malte

Please Log in or Create an account to join the conversation.

More
04 Aug 2021 13:51 #216908 by andypugh

Now I get undefined types. Is e.g. "u32" defined somewhere in linuxcnc? 

u32 is defined in <linux/types.h> which refers to <asm/types.h>

You could try using hal_u32_t  instead, which should be portable between uspace and kernel code, etc. 


 

Please Log in or Create an account to join the conversation.

Time to create page: 0.089 seconds
Powered by Kunena Forum