Hardware revision r0.2 didn't have an external resistor on the PROGRAMN pin.
This pin is driven by the FPGA to reset the device into the bootloader.
Observed Behavior
There has been 2-3 reports of users experiencing the the bootloader not loading their programs. Instead the device just sits with the LED on WHITE. Entering the bootloader can be done at anytime by pressing btn0. This behaviour indicates that the device in cycling in/out of the bootloader, since the bootloader only checks the button state once on power-up.
This seems to be related to this pin on some boards the internal resistance isn't strong enough to counteract the weak-pulldown of an I/O pin it's connected to.
Proposed Fix
New hardware
r0.2.1 features an external pull-up resistor.
Existing r0.2 hardware
In gateware define the I/O pin connected to the PROGRAMN pin as a HIGH value.
diff --git a/nmigen/blink.py b/nmigen/blink.py
index a966594..cf1803c 100644
--- a/nmigen/blink.py
+++ b/nmigen/blink.py
@@ -23,6 +23,10 @@ class Blink(Elaboratable):
blue_led.o.eq(self.count[25]),
]
+ # Ensure FPGA PROGRAMN pin is released.
+ program = platform.request('program')
+ m.d.sync += program.o.eq(0)
+
return m
Note: in nMigen the program pin defined in the platform file is marked as active low, nMigen internally negates the values we assign to it.
Summary
Hardware revision r0.2 didn't have an external resistor on the PROGRAMN pin. This pin is driven by the FPGA to reset the device into the bootloader.
Observed Behavior
There has been 2-3 reports of users experiencing the the bootloader not loading their programs. Instead the device just sits with the LED on WHITE. Entering the bootloader can be done at anytime by pressing
btn0
. This behaviour indicates that the device in cycling in/out of the bootloader, since the bootloader only checks the button state once on power-up.This seems to be related to this pin on some boards the internal resistance isn't strong enough to counteract the weak-pulldown of an I/O pin it's connected to.
Proposed Fix
New hardware
Existing r0.2 hardware
PROGRAMN
pin as aHIGH
value.Note: in nMigen the
program
pin defined in the platform file is marked as active low, nMigen internally negates the values we assign to it.