Hello
I have a raspberry pi 4, 4G
/proc/cpuinfo shows

Hardware    : BCM2835
Revision    : c03112                      << THIS IS A PROBLEM
Serial        : 100000007ef4bf9c
Model        : Raspberry Pi 4 Model B Rev 1.2
and those values will fail trying to load the hal_pi_gpio module.

When I tried to use hal_pi_gpio,
I got this error.

pi@raspberrypi:~ $ linuxcnc
LINUXCNC - 2.8.0~pre1
Machine configuration directory is '/home/pi/linuxcnc/configs/NEW-rpi4-2250vel-nohome'
Machine configuration file is 'rpi4-2250vel-nohome.ini'
Starting LinuxCNC...
Found file(REL): ./rpi4-2250vel-nohome.hal
Note: Using POSIX realtime

HAL_PI_GPIO: ERROR: board revision 6 not supported
hal_pi_gpio: rtapi_app_main: Invalid argument (-22)
...

so i looked why rev 6 is not allowed

in hal_pi_gpio.c I read...

int rtapi_app_main(void)
{
    int n, retval = 0;
    int rev, ncores, pinno;
    char *endptr;

    if ((rev = get_rpi_revision()) < 0) {
      rtapi_print_msg(RTAPI_MSG_ERR,
                      "unrecognized Raspberry revision, see /proc/cpuinfo\n");
      return -EINVAL;
    }
    ncores = number_of_cores();
    rtapi_print_msg(RTAPI_MSG_INFO, "%d cores rev %d", ncores, rev);

    switch (rev) {
    case 5:
      rtapi_print_msg(RTAPI_MSG_INFO, "Raspberry4\n");
      pins = rpi2_pins;
      gpios = rpi2_gpios;
      npins = sizeof(rpi2_pins);
      break;

... NOTE 6 IS NOT A VALID CASE

    default:

        rtapi_print_msg(RTAPI_MSG_ERR,
                        "HAL_PI_GPIO: ERROR: board revision %d not supported\n", rev);
        return -EINVAL;
...
}

well, I think the value 'rev' will return 6 for my hdwr
because
cpuinfo.c has

int get_revision(void){
...
    else if ((strcmp(revision, "a03111") == 0) ||
            (strcmp(revision, "b03111") == 0) ||
            (strcmp(revision, "c03111") == 0))  // tjp note NOT "c031112"
      return 5;
   else // assume rev 5
      return 6;                                 //tjp 6 is what mine returns
}

now my /proc/cpuinfo shows
Hardware    : BCM2835
Revision    : c03112
Serial        : 100000007ef4bf9c
Model        : Raspberry Pi 4 Model B Rev 1.2

so my board falls into default '6'
and 6 fails

If i am correct ,
then the fix seems to be in the detection by cpuinfo ( reurning 6 )
or
in the action taken by hal_pi_gpio.c rtapi_app_main where it has no rev 6 case

what to do?

thanks tomp



_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to