I have uploaded unaltered OpenBCI_32bit_16chan.pde sketch to the board from mpide. The board was set to chipkit-max32-usb for serial. Afterwards board is dead, leds are off. Is there a way to reset/reprogram it? What is the correct board setting?
using PICkit3. The blue LED is happily blinking when I power up the board and board is waiting to be programmed from mpide. Can someone please let me know which board configuration should I choose in mpide in order to program 32bit OpenBCI? I have tried also Fubarino SD (1.5) with no luck, even though this time at least chips match. If there is a need to create a new configuration, please let me know as well that I do not have to try existing ones in vain.
I started to create a new configuration based on Fubarino Mini. In order to finish it, I need the current schematics or at least pin out for OpenBCI v3 board. Unfortunately, I cannot locate it. Can you please let me know the location of it? This was advertised as an open source project. Is it not anymore?
Thanks, your instructions work and the board is up and running again. Changing DP32/Board_Defs.h did the trick. One can brick the board by uploading sketch with board selection 'chipKIT DP32' without changing MISO and MOSI pins. When that happens, one needs to use a programmer like PICkit3 and flash the bootloader. Afterwards mpide will work again.
We have found that some of the 32bit boards will present an error after uploading.
Errors can happen because we are doing the programming over-air with avrdude.
The avrdude process is to first, make contact and verify the target part, then the code uploads in pages (for PIC, the pages are ~256 bytes. for ATmega, the pages are more like ~128 bytes).
Then, the avrdude verifies the code by getting the PIC to send it back.
On the occasions where there was a content mismatch, the problem could happen in either the upload, or the verification part.
If the mismatch is on the verification, then it's likely that the code was uploaded ok. Check to see if the blue LED is on, and if it is, try to run the board.
If the blue LED is not on, then the mismatch happened during upload. You will need to try to upload again. Try and try again, and it will eventually stick. We were able to load code on all the boards we shipped, so it will work, please be patient.
Some things that we found help:
Turn on the board after the dongle is plugged in (start the Host radio before the Device radio)
Hold the RST button down, turn on the board, then press the PROG button and hold it while releasing the RST button.
(that last one is alittle bit 'baseball superstition, but anyway...)
Keep the board and the dongle in close proximity with the radios facing eachother.
When I flashed the bootloader a few days ago I used exactly same setup you proposed and I had a message saying the process went well. I think this was OK.
After uploading with mpide, the blue led wasn't on when I switched on the board.
I was going to upload until it was OK as you proposed. I did your "baseball superstition trick" before uploading but something very strange happened. After pushing the reset button the led became and remained blue after an OFF/ON...
I guess the last upload I did yesterday was ok after having a verification error.
I can't explained what happened but anyway, every thing is ok now!
It is known that there may be sometimes a verification error when uploading to the 32bit board.
We know that uploading will work, because we were able to upload to all of the boards before we shipped them to you.
Please be patient and try again. It is bound to work.
@alfahad, The upload process happens over the serial connection between RFduino and the PIC.
It may be possible to green wire the board and use a wired connection, however the RFduino pins will also be connected. The RFduino in that case would need firmware that puts the RX|TX pins in highZ so they don't interfere.
I have a 32 bit board. I have previous successfully streamed ECG and EEG data to the OpenBCI GUI. I am using a Mac.
I was going through the instructions to make sure that I could flash new firmware. I successfully flashed the firmware from GitHub with no problems, and the board still worked.
I then made one minor change, commenting out line 112: sampleCounter++;
When I tried to load that, I had a bit of trouble in that I kept getting timeout errors. Eventually, I got it to start loading, but it didn't look like it finished. However, I was able to connect the board to the GUI and stream data with the appropriate change in the output reflecting that my code had been uploaded.
I uncommented that line and tried to flash it again. I have had no success, and now the blue LED does not light up and I cannot communicate with the board at all. When I tried this second flash, it seemed to work for a while and then I got this error:
avrdude: verification error, first mismatch at byte 0x1d00
0x70 != 0xff
avrdude: verification error; content mismatch
Since this point, I can get the blue LED to slowly flash by holding down the RST and PROG buttons as per the instructions, but after a few seconds the LED starts flashing very quickly and mpIDE just reports a bunch of timeout errors:
avrdude: stk500_2_ReceiveMessage(): timeout
If I let it just keep running, eventually I get the same verification errors I posted above.
The GUI can no longer detect the board. I have power cycled the dongle and the board several times with no success.
Okay. I can at least get it to talk to the board now, but after flashing the firmware straight out of the repo about 20 times now, I still get the verification error.
To head off some of the common suggestions I keep reading - I have put new batteries in the batter pack, the board the the dongle are roughly 0.5 cm apart with the radios directly facing each other, and after I get the error the blue light is off.
Is there a way to re-flash the bootloader without a picKit3? I might have a 2 somewhere, but I know I don't have a 3.
I'll keep trying, but if anyone has a better suggestion than "cross your fingers and pray" I'm all ears.
I don't think you need to flash the bootloader, I suggest you try this trick:
Turn on the board after the dongle is plugged in (start the Host radio before the Device radio)
Hold the RST button down, turn on the board, then press the PROG button and hold it while releasing the RST button.
One thing I usually try is uploading the "Blink Example" using LED=11. Usually it's a good indicator for me before trying to upload the "large" code. If the blink example doesn't upload, I usually restart the MPIDE program (since I'm using 32-bit board), and try to re-upload the blink example.
@jgottlieb, why do you want to comment out the sampleCounter++ ?
That is a super important line of code...
In regard to all of the issues with timeouts and mismatches, we are working closely with the folks at Microchip chipKIT to get this issue resolved. I believe that it has to do with the code uploader (avrdude) that is used with the current release of mpide.
the chipKIT folks are in the process of changing that in the new chipKIT core. And they will also include OpenBCI 32 as a selection in the Board drop-down menu selector {exciting!}
In maybe a few days (next week?), I will reach out to this thread with instructions and links to ask you all to test the new setup.
I was only doing it to test and make sure I could properly do a firmware flash.
Out of curiosity, why do you think it is an important line of code? The only utility, so far as I can tell, is to allow the receiving computer to determine if any packets have been dropped. My long-term goal is to use the OpenBCI alongside experiments manipulating cognitive state. In this context, a one-byte counter is not nearly as important as the need for a millisecond timer that can be synchronized with the computer so I can align data collected by the OpenBCI with events taking place in the experiment.
This was ultimately what I was going to try to implement yesterday, but instead I spent the afternoon trying to figure out why the board failed after only the second time I tried to flash new firmware.
Well, it's important because it is our sample counter, and it is the way that we keep track of data packets to know if any have been dropped, etc. Because we are sending data over air, there may be some latency that a timer on the computer would throw a flag over.
Comments
refurbished 's way :
//////
I had to connect to:
OpenBCI 32 Bit Board Pin 3 RFduino -> Dongle FTDI_TX
OpenBCI 32 Bit Board Pin 4 RFduino -> Dongle FTDI_RX
OpenBCI 32 Bit Board AGND to Dongle GND
Dongle RESET to GND elsewhere
OpenBCI 32 Bit Board RFRESET to AGND
//////////
http://chipkit.net/arduino-blink-sketch-chipkit-dp32/