Wrong output Voltage on Pin12 / GPIO4


I’m experiencing weird behaviour of PIN12 on the hifive1 revb.
Having GPIO-Pin 4 configured as output with deactivated io functions I can measure a high voltage of around 1V. With the DriveStrength set I can push it to around 1.9V. But I cannot get it to 3.3V as all the other pins.

I used this code to test it:

#define GPIO_BASE		0x10012000
#define GPIO_OUT_EN		0x08	
#define GPIO_OUT_VAL	        0x0C
#define GPIO_DS			0x14	
#define GPIO_IOF_EN             0x38

.section .text
.globl main
li  t1, GPIO_BASE
li  t2, (1 << 4)
sw  t2, GPIO_OUT_EN(t1)
sw  t2, GPIO_OUT_VAL(t1)
sw  zero, GPIO_IOF_EN(t1)
sw  zero, GPIO_DS(t1)
j loop

Actually I stumbled over this because I tried to implement SPI and I didn’t get the MISO to read anything. So I now have a suspicion that maybe somthing is wrong with the pin?

Can someone verify that gpio 4 works or maybe someone got the SPI1 working?

I appreciate any help or comments.


WiFi chip interferes with your signal? You need to deassert WiFi CS pin (or at least float it). If the WiFi firmware is broken, it may be more problematic.