- Posts: 926
- Thank you received: 280
Please Log in or Create an account to join the conversation.
Hi, the inputs are "outputs" from the remora-spi component. The way I would approach this is the use halshow to confirm the the inputs are working.scotta thank you so much!
the challenges I face that are left are:
1) homing -> I tried wiring to GND and 3.3v but joint.0.home (maybe it's called different) is never TRUE, I tried using halcmd show pin for that while linuxcnc was running and also live testing the home axis.
[/code][/code]Code:[code]27 bit OUT FALSE remora.input.00 ==> X-home 27 bit OUT FALSE remora.input.01 ==> Y-home 27 bit OUT FALSE remora.input.02 ==> Z-home 27 bit OUT FALSE remora.input.03 ==> A-home [code]I think it's weird that all my inputs are listed as OUT.... 2) maybe related maybe unrelated: my A axis (joint3) is continuing to have follow joint problems. I thought maybe the motor or the driver went bad, but I swapped both. I tried several stepgen_maxaccel settings and fooled around with other settings as well. Of course I appreciate the help so far and yes it's close to working, I was already very happy to see my XYZ axes moving!!!! :)
Please Log in or Create an account to join the conversation.
spix_rpi5.c:// Read the 'compatible' string-list from the device-tree
buflen = spix_read_file("/proc/device-tree/compatible", buf, sizeof(buf));
if(buflen < 0) {
LL_ERR("Failed to read platform identity.\n");
return buflen; // negative errno from read_file()
}
// Decompose the device-tree buffer into a string-list with the pointers to
// each string in dtcs. Don't go beyond the buffer's size.
memset(dtcs, 0, sizeof(dtcs));
for(i = 0, cptr = buf; i < DTC_MAX && cptr; i++) {
dtcs = cptr;
j = strlen(cptr);
if((cptr - buf) + j + 1 < buflen)
cptr += j + 1;
else
cptr = NULL;
}
Thanks for your help.for(i = 0; dtcs != NULL; i++) {
if(!strcmp(dtcs, DTC_RPI_MODEL_5B) || !strcmp(dtcs, DTC_RPI_MODEL_5CM)) {
break; // Found our supported board
}
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
int rt_peripheral_init(void)
{
FILE *fp;
int i, j;
char buf[256];
ssize_t buflen;
char *cptr;
const int DTC_MAX = 8;
const char *dtcs[DTC_MAX + 1];
// assume were only running on >RPi3
if ((fp = fopen("/proc/device-tree/compatible" , "rb"))){
// Read the 'compatible' string-list from the device-tree
buflen = fread(buf, 1, sizeof(buf), fp);
if(buflen < 0) {
rtapi_print_msg(RTAPI_MSG_ERR,"Failed to read platform identity.\n");
return -1;
}
// Decompose the device-tree buffer into a string-list with the pointers to
// each string in dtcs. Don't go beyond the buffer's size.
memset(dtcs, 0, sizeof(dtcs));
for(i = 0, cptr = buf; i < DTC_MAX && cptr; i++) {
dtcs = cptr;
j = strlen(cptr);
if((cptr - buf) + j + 1 < buflen)
cptr += j + 1;
else
cptr = NULL;
}
for(i = 0; dtcs != NULL; i++) {
if( !strcmp(dtcs, DTC_RPI_MODEL_4B)
|| !strcmp(dtcs, DTC_RPI_MODEL_4CM)
|| !strcmp(dtcs, DTC_RPI_MODEL_400)
|| !strcmp(dtcs, DTC_RPI_MODEL_3BP)
|| !strcmp(dtcs, DTC_RPI_MODEL_3AP)
|| !strcmp(dtcs, DTC_RPI_MODEL_3B)) {
rtapi_print_msg(RTAPI_MSG_ERR, "Raspberry Pi 3 or 4, using BCM2835 driver\n");
bcm = true;
break; // Found our supported board
}else if(!strcmp(dtcs, DTC_RPI_MODEL_5B) || !strcmp(dtcs, DTC_RPI_MODEL_5CM)) {
rtapi_print_msg(RTAPI_MSG_ERR, "Raspberry Pi 5, using rp1 driver\n");
rp1 = true;
break; // Found our supported board
}else{
rtapi_print_msg(RTAPI_MSG_ERR, "Error, RPi not detected\n");
return -1;
}
}
fclose(fp);
}else{
rtapi_print_msg(RTAPI_MSG_ERR,"Cannot open '/proc/device-tree/compatible' for read.\n");
}
if (bcm == true){
...
Please Log in or Create an account to join the conversation.
You actually did an amazing job on the DesignWare SPI and I can't thank you enough for it!Thanks for sharing. I did investigate reading the device tree when working on the RP1 driver but took the easy path so as to focus on the DesignWare SPI side of things. Looks like I'll need to rework the board detection. At least the Mesa code will be a great starting point.
Please Log in or Create an account to join the conversation.