tomasero / openSleep

platform for sleep hacking and research
438 stars 59 forks source link

Unable to Program sleepduino Firmware to nRF52832 Chips from Makezine Build #39

Open fyarvis opened 1 year ago

fyarvis commented 1 year ago

After following the steps in the Makezine article for the Dormio up through the step of burning the bootloader onto the nRF52832 with a J-Link board, I've gotten stuck trying to upload the sleepduino sketch. The chip seems to refuse to communicate over serial, even after resetting the board with the "DFU" switch closed during reset and then releasing it.

The board is electrically sound: all of the connections and pin voltages seem correct when probed with a DMM.

Some additional details to help with debugging are described below, and refer to the two screen captures included in this post.

2  Adruino Sketch Programming Error

I HAVE been able to upload a sketch to the chips by changing the bootloader and programmer to "J-Link for Bluefruit nRF52", then uploading the sketch using the "Upload Using Programmer" command in the Arduino IDE. However, the sketch uploaded in this way does not seem to function correctly: the chip does not broadcast a name, may not be broadcasting at all, and refuses to connect to the "serverless.html" program.

fyarvis commented 1 year ago

Update: Haven't fixed the original issue, but I have been able to upload the sleepduino_nrf52.ino sketch to an off-the-shelf Adafruit nRF52832 Feather board by following the instructions on their Learning Guide page.

The Feather replicates most of the functionality of the Dormio v3 board - the only other hardware that needs to be added are the resistors and capacitors on the three Dormio sensor wires. See the ".sch" file in the "hardware" directory of this repository for the corresponding schematic file.

cryanp-usgs commented 11 months ago

Don't give up, this is a fantastic project and works beautifully once you get that sketch to the dormio board. After many moons of having read the Make: article and wrangled the parts, I finally finished my build today. Not sure if you're still having the upload issue, but if you are I have a suggestion that might help get the .ino file uploaded successfully to the dormio board. The same thing was happening to me (J-Link worked like a charm for connecting and burning bootloader, but DFU error trying to get sketch to board), but then in a frustrated moment I tried swapping the RX and TX wires. I left the connections at the Tag-Connect plug as pictured in the Makezine article (Fig G) and swapped the TX and RX position at the FTDI (wires 3 & 5 in Fig F). Voila! That did the trick and the sleepduino_nrf52.ino sketch finally uploaded to the dormio board on the first try. No more DFU errors! I'll get in touch with Make: and point out the possible swapping of the TX and RX. The rig is working beautifully except I still don't get a trace from the EDA electrodes, but I'll figure that out eventually.

fyarvis commented 11 months ago

Thanks Paul! I ended up redesigning the circuit around an OTS nRF52832 module, but ran into software issues with the voice recording function and put the project on the back burner. I appreciate you following up with the Make team as well!