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
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)
loop:
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.

thanks for your answer!
I tried to deassert the WIFI CS pin (as far I know thats CS2, gpio9, pin15) by having it pulled up and by having its IOF active. But neither worked for me.

The MISO Pin seems to act as sink. When I disconnected the slaves miso pin from the board I could see in the logic analyzer that the spi communcation works. But as long it’s connected its always 0V.

Is it possible that the ESP pulls the MISO line to gnd?

I tried to deassert the WIFI CS pin (as far I know thats CS2, gpio9, pin15) by having it pulled up and by having its IOF active.

Try to disable IOF for it.

Is it possible that the ESP pulls the MISO line to gnd?

Sure. I think this is the reason.

You can also try the following:

  • physically disconnect CS for the WiFi module by breaking solder jumper SJ1
  • check with your logic analyzer that CS2 pin is high during the transfer

I desoldered SJ1 and pulled pin15 high. Voltage on both bridge sides are high, I also checked at the ESP IO15 and its also 3.3V.
But MISO (Pin12) is still acting as sink.