dmq_
Posts: 2
Joined: Thu Nov 01, 2018 12:50 pm

Intellisys PIO HAT board not working under >= RPi2

Thu Nov 01, 2018 4:31 pm

Dear all,

I am a little bit desperate with my issue here. I really hope, that someone is able to help.

I use Intellisys PIO boards - these are RPi extension boards (with programmable industrial interfaces: 0|2-10V, 0|4-20mA ...), which are connected directly to the GPIO header of a RPi. They were designed for RPi 1 - I've used them with RPi 1 Mod. B and Pi 1 Mod. B+. Because of performance concerns I have to move these boards to a RPi 2 or 3 platform. Unfortunately I can not get it to work.

Here you'll find more information about the board:

https://www.intellisys.it/pio/

The company does not seem to support the board any more.

I did a fresh installation of Raspbian on a Pi 2. After that, I setup the environment (library, ...) and created a small c programm:

Code: Select all

#include "/var/tmp/pio/libpio.h"
#include <unistd.h>

int main (void)
{

	int RTC_status;
	int RTC_year;
	Pio_SYSTEM_Init();
    	RTC_status = Pio_RTC_Start();
	RTC_year = Pio_RTC_Year_Read();
	if (RTC_status == 1) { printf ("The clock is started successfully %i\n");}
	if (RTC_status == 0) { printf ("The clock was just started %i\n");}
	if (RTC_status == -1) { printf ("The clock is not started %i\n");}
	printf ("The current year is : %i\n", RTC_year);
}
After compilation (on the non working Pi 2 and upwards) I get:

Code: Select all

root@pio-labor:/var/tmp/pio# ./rtc
The clock was just started 0
The current year is : -1
After compilation (on the working Pi 1 B and B+ ) I get:

Code: Select all

root@pio-labor:/var/tmp/pio# ./rtc
The clock was just started 0
The current year is : 18
On the Pi1 B and B+ the program works on the Pi 2 not. I did a strace but can not see something strange.

When I activate the SPI bus through raspi-config the one of the relays on the board switches on - when I deactivate the bus, the relay switches off again.


Does anyone has an idea or a hint how I could proceed?

Does anyone has a clue how to verify, if an extension board is identified by the RPi (something like i2cdetect or some information in /proc or /sys or something else)? I do not know exactly how the board communicates with the Pi.

Thank you very much for any help

dmq
Last edited by dmq_ on Fri Nov 02, 2018 5:18 pm, edited 2 times in total.

dmq_
Posts: 2
Joined: Thu Nov 01, 2018 12:50 pm

Re: Intellisys PIO HAT board not working under >= RPi2

Fri Nov 02, 2018 5:11 pm

Hi,

the SPI and i2c buses are working generally.

Code: Select all

$ uname -a
Linux pio-labor 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l GNU/Linux

Code: Select all

pi@pio-labor:/var/tmp $ ./spidev_test -D /dev/spidev0.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)

Code: Select all

root@pio-labor:/home/pi# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- 68 -- -- -- -- -- -- 6f
70: -- -- -- -- -- -- -- --
root@pio-labor:/home/pi#  i2cget -y 1 0x68 0x75
0x04
On a working RPi (1 B+) I do not have activated anything special - no i2c, no spi - it just works.

I thought both Pi's have the same GPIO layout. What else can it be?

When I do a strings on the shared object libpio.so I can see many references to the bcm2835 chipset.

Code: Select all

bcm2835_spi_setDataMode
bcm2835_gpio_clr_hen
bcm2835_st_read
bcm2835_i2c_write
__cxa_finalize@@GLIBC_2.4
bcm2835_gpio_lev
bcm2835_gpio_pudclk
bcm2835_gpio_len
Pio_RTC_Year_Write
bcm2835_gpio_clr_ren
bcm2835_pads
printf@@GLIBC_2.4
__bss_start__
Pio_AO_BottomVolt_Read
Pio_AO_TopVolt_Read
bcm2835_gpio_clr_fen
Pio_UI_TopVolt_Read
bcm2835_peri_read
Pio_UI_Type_Write
bcm2835_gpio_set
Pio_RTC_Stop
Pio_RTC_Year_Read
Pio_UI_Type_Read
nanosleep@@GLIBC_2.4
malloc_aligned
Pio_AO_TopVolt_Write
Pio_Local_Init
_bss_end__
bcm2835_gpio_clr
_edata
bcm2835_st
bcm2835_gpio_set_multi
Pio_RTC_Second_Read
bcm2835_bsc0
bcm2835_gpio_pud
bcm2835_spi_transfern
bcm2835_spi_setClockDivider
Pio_DO_Command_Read
_fini
__bss_end__
Pio_UI_BottomRange_Read
bcm2835_gpio_aren
bcm2835_i2c_setClockDivider
bcm2835_clk
bcm2835_gpio_write_mask
Pio_AO_Value_Read
Pio_AO_Value_Write
bcm2835_spi0
stderr@@GLIBC_2.4
bcm2835_i2c_end
bcm2835_peri_write
bcm2835_close
usleep@@GLIBC_2.4
bcm2835_gpio_set_eds
bcm2835_gpio_fen
bcm2835_gpio_pad
bcm2835_spi_end
strerror@@GLIBC_2.4
Pio_DI_Status_Read
Pio_RTC_Second_Write
bcm2835_delay
__gmon_start__
bcm2835_i2c_setSlaveAddress
open@@GLIBC_2.4
bcm2835_gpio_clr_multi
Pio_LED_Command_Write
Pio_RTC_Month_Read
Pio_RTC_Start
Pio_RTC_Month_Write
bcm2835_gpio_write_multi
Pio_UI_BottomVolt_Read
mmap@@GLIBC_2.4
Pio_DO_Command_Write
bcm2835_spi_setChipSelectPolarity
bcm2835_i2c_begin
fprintf@@GLIBC_2.4
Pio_RTC_DayOfWeek_Read
bcm2835_peri_set_bits
posix_memalign@@GLIBC_2.4
__errno_location@@GLIBC_2.4
Pio_SYSTEM_Dispose
_end
bcm2835_set_debug
bcm2835_spi_transfernb
Pio_RTC_Minute_Write
bcm2835_spi_chipSelect
Pio_UI_TopVolt_Write
bcm2835_i2c_set_baudrate
bcm2835_gpio_write
bcm2835_gpio_set_pad
__end__
bcm2835_spi_setBitOrder
bcm2835_i2c_read
__bss_start
Pio_RTC_Hour_Read
bcm2835_bsc1
bcm2835_gpio_clr_afen
bcm2835_gpio_eds
bcm2835_gpio_afen
munmap@@GLIBC_2.4
bcm2835_pwm
Pio_UI_TopRange_Write
bcm2835_gpio
Pio_RTC_Calibration
Pio_Local_AO_Reset
bcm2835_gpio_fsel
Pio_AO_BottomVolt_Write
bcm2835_peri_read_nb
_Jv_RegisterClasses
bcm2835_gpio_hen
bcm2835_init
Pio_RTC_Hour_Write
bcm2835_gpio_ren
Pio_UI_Value_Read
Pio_RTC_Minute_Read
bcm2835_delayMicroseconds
Pio_RTC_DayOfWeek_Write
bcm2835_spi_writenb
bcm2835_peri_write_nb
bcm2835_spi_transfer
bcm2835_st_delay
Pio_UI_TopRange_Read
bcm2835_gpio_clr_aren
bcm2835_spi_begin
Pio_RTC_DayOfMonth_Write
Pio_RTC_DayOfMonth_Read
_init
close@@GLIBC_2.4
bcm2835_gpio_clr_len
Pio_SYSTEM_Init
bcm2835_gpio_set_pud
bcm2835_i2c_read_register_rs

Code: Select all

vcdbg log msg
001160.636: brfs: File read: /mfs/sd/config.txt
001161.595: brfs: File read: 1664 bytes
001171.296: HDMI:EDID error reading EDID block 0 attempt 0
001172.601: HDMI:EDID error reading EDID block 0 attempt 1
001173.898: HDMI:EDID error reading EDID block 0 attempt 2
001175.198: HDMI:EDID error reading EDID block 0 attempt 3
001176.495: HDMI:EDID error reading EDID block 0 attempt 4
001177.794: HDMI:EDID error reading EDID block 0 attempt 5
001179.091: HDMI:EDID error reading EDID block 0 attempt 6
001180.390: HDMI:EDID error reading EDID block 0 attempt 7
001181.687: HDMI:EDID error reading EDID block 0 attempt 8
001182.986: HDMI:EDID error reading EDID block 0 attempt 9
001184.046: HDMI:EDID giving up on reading EDID block 0
001200.086: brfs: File read: /mfs/sd/config.txt
001200.923: HDMI:Setting property pixel encoding to Default
001200.982: HDMI:Setting property pixel clock type to PAL
001201.045: HDMI:Setting property content type flag to No data
001201.103: HDMI:Setting property fuzzy format match to enabled
001201.244: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001210.344: gpioman: gpioman_get_pin_num: pin WL_LPO_CLK not defined
001210.412: gpioman: gpioman_get_pin_num: pin BT_ON not defined
001210.472: gpioman: gpioman_get_pin_num: pin WL_ON not defined
001384.967: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
001386.258: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001386.355: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001386.429: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
001386.777: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001388.086: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001389.388: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001390.691: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001391.994: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001393.298: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001394.601: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001395.904: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001397.207: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001398.510: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001399.575: hdmi: HDMI:EDID giving up on reading EDID block 0
001399.645: hdmi: HDMI: No lookup table for resolution group 0
001399.708: hdmi: HDMI: hotplug attached with DVI support
001399.782: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001400.119: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001401.426: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001402.732: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001404.039: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001405.346: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001406.653: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001407.960: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001409.267: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001410.574: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001411.881: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001412.952: hdmi: HDMI:EDID giving up on reading EDID block 0
001413.029: hdmi: HDMI: hotplug deassert
001413.083: hdmi: HDMI: HDMI is currently off
001413.135: hdmi: HDMI: changing mode to unplugged
001413.201: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001413.949: *** Restart logging
001414.012: brfs: File read: 1664 bytes
001417.789: brfs: File read: /mfs/sd/cmdline.txt
001417.878: Read command line from file 'cmdline.txt':
001417.936: 'dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=ace4ff23-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait'
001418.234: brfs: File read: 119 bytes
001754.121: brfs: File read: /mfs/sd/kernel7.img
001754.184: Loading 'kernel7.img' to 0x8000 size 0x4b4f68
001758.576: No kernel trailer - assuming DT-capable
001758.664: brfs: File read: 4935528 bytes
001762.416: brfs: File read: /mfs/sd/bcm2709-rpi-2-b.dtb
001762.477: Loading 'bcm2709-rpi-2-b.dtb' to 0x4bcf68 size 0x5e33
001916.187: brfs: File read: 24115 bytes
001920.801: brfs: File read: /mfs/sd/config.txt
001921.344: dtparam: i2c_arm=on
001937.424: dtparam: i2s=on
001951.144: dtparam: spi=on
001965.152: dtparam: audio=on
003117.844: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
003222.393: Device tree loaded to 0x2eff9e00 (size 0x61e6)
003224.147: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
004636.222: vchiq_core: vchiq_init_state: slot_zero = 0xfad80000, is_master = 1
004640.514: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
Does someone have an idea?

Thanks again for any help

dmq

Return to “HATs and other add-ons”