fwd to emc-user, sorry i only posted to emc-devs last night
this will allow purchasers of new rpi4 (c01112 rev) to use gpio wirh
software stepping.
---------- Forwarded message ---------
From: Thomas J Powderly <[email protected]>
Date: Sun, Feb 16, 2020 at 11:06 PM
Subject: Re: [Emc-developers] hal_pi_gpio.c rpi4 revision c03112
To: <[email protected]>


I now have linuxcnc 2.9 with a good hal_pi_gpio.(doesnt break on
newest Pi revision code c03112 )

The driven pins scope out clean when running.

These pins controlled by software stepgen.

To do this , I installed a rip ( so I could make new .c components ).

I edited hal_pi_gpio.c , adding a case to rtapi_app_main()

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) {
// adding this vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    case 6:
      rtapi_print_msg(RTAPI_MSG_INFO, "Raspberry4ver1.2\n");
      pins = rpi2_pins;
      gpios = rpi2_gpios;
      npins = sizeof(rpi2_pins);
      break;
// end additions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    case 5:
      rtapi_print_msg(RTAPI_MSG_INFO, "Raspberry4\n");
      pins = rpi2_pins;
      gpios = rpi2_gpios;
      npins = sizeof(rpi2_pins);
      break;

Then I touched one dependancy ( cpuinfo.c) and ran make, then sudo
make setuid, then tested.

It took me a loooong time to discover that halcompile wasnt enough,
due to the dependancy cpuinfo.c

If i had known that, I'd be hours ahead.

NB: the RIP works , the installed linuxcnc will still fail "board
revision 6 not supported"

HTH

tomp


_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to