chipKIT uploading tips & restarting bootloader

13

Comments

  • biomurphbiomurph Brooklyn, NY
    Ha! William, you just beat me to it!
    @mrollin, the bottle neck in data throughput is between the PIC (or ATmega) and the RFduino on the board. For reasons having to do with the way RFduino handles radio interrupts vs serial interrupts, 115200 is the max baud that is stable. That combined with the maximum radio packet size.

    The uC wants to send 31 bytes per sample
    • 1 byte sample counter
    • 8-3 byte ADS data
    • 3-2 byte accelerometer data
    The serial protocol adds start and stop bits to each byte, for a total of 310 bits that have to be sent.
    115200 baud has bit time of 8.68uS per bit, so it takes 2.69mS to send all that data.
    If you drop the accelerometer data, you still need 2.17mS to get it all out the door.

    Oh, and no, when you press the reset button, it does NOT reset the RFduino. For that you need to reboot the board.
  • I've done some research on the streaming-transmission thing (8 ADS1299 Channels in 31 Bytes) and found the following:

    a) the PIC32 Processor is sending exact every 4 ms. The transmission takes 3 ms, so 1 ms is left free.
    b) the radios follow this timing with great jitter
    c) some package frame will not have the 1ms left space between each other: they come without any space between

    Sometimes the dongle-received frames have the starting 0xA0 and the ending 0XC0 on the wrong position in the frame.

    This points for a software error in the dongle RFduino .

    @biomurph: is this problem solved with new RFduino software?

    Another RFduino error is that sometimes the connection fails between the two Radios.
    As if something in the software would have an overflow after some time:
    a) leave the dongle powered for some 10 min, having the 32Bit board unpowered
    b) switch on the OpenBCI 32Bit board
    c) the radios do not connect
    Please verify this.

    @biomurph: there is no need for 20 Rx-buffers I think. Debugging realtime software should be done with professional tools
    or you need a lot of experiance. To use the toolchain from nordic semiconductor, to be able to set breakpoints and to look at the state-machine in the software.

    I've bricked my bootloarder by try programming the 32Bit board with low batteries. The MPIDE is not the problem I think.
    So I try to program the bootloarder with PICit3, but there is no tutorial how to do it. 
    But you have to do this in production?
    To have a tutorial for this would be fine, because it is difficult to read all the stuff of this thread each time,
    and there are things written that are no longer valid.

  • biomurphbiomurph Brooklyn, NY
    @refurbished
    When the PIC32 sends serial data to the RFduino, it does not take 3mS. The serial transmission does take ~2.7mS to complete, but inside the PIC, the program just puts the data (31 bytes) into the output buffer (64 bytes), so there is much more than 1mS available for the PIC between samples.

    The radio packets do come in at odd times, but that is not important, because the samples were gathered at the 4mS rate.
    I will try your connection error problem. When you reset the Dongle, does this solve the problem? 

    We do need to have the very large RX and TX buffers on the radios, because we are using them to upload code to the PIC32 over air. the avrdude that the chipKIT folks made uploads the program file in 256 byte pages. We need to handle abit more than that to get the program uploaded.

    I'm sorry to hear you bricked your bootloader. I will get a tutorial up soon. For now, please connect the picKit3 thusly:
    All the bootloading pins are broken out on the OpenBCI 32bit Board.

    PICkit3    <>    OpenBCI 32bit
    MCLR                     RST
    VDD Target                VDD
    VSS                      GND
    PGD                   D11
    PGC                    D12

    go here to get the bootloader HEX files https://github.com/chipKIT32/PIC32-avrdude-bootloader
    Use UDB32-MX2-DIP bootloader.
           


  • nknk
    edited October 2015
    So,

     I tried to to update the firmware on my 32bit board and now no blue light on power on.   I followed the instruction for using the arduino ide.  It would start uploading then program flash failed. I tried many times and then after reading this thread and applying my limited understanding to all this decided to update the radio host firmware on the dongle. I succeeded, at least it said success, and then I went back to update the board firmware.  

    At first it kept saying target not found but after many attempts it started uploading and then flash failed again.  I tried again and  back to target not found and then after many more tries back to uploading again with flash failure and then twice I got all the way through the upload but with an error at address 1D00125C: file=FFFFFFFF, mem=01000301 on verify.
     
    Any assistance in getting my board up and running again will be much appreciated. 
  • biomurphbiomurph Brooklyn, NY
    You may also need to update the Device firmware on the RFduino that is mounted on the OpenBCI Board.
    There was an update to both of those firmwares over the summer. 
    When you did the dongle firmware update, did you make sure to select the correct channel number?
  • Thanks for the quick reply.

    I did not upload the device firmware to the board since it seemed to require hardware modification beyond my current abilities.  

    Before I uploaded the firmware to the dongle I did change the channel in one line of the code.     

  • biomurphbiomurph Brooklyn, NY
    and the channel you changed in the code was to match the channel of your board?
  • Yes, I used the number that was labelled on the anti static bag that came with the board.  

    Is there anyway to upload the rfduino code onto the board without having to solder anything? 

    Thanks again. . . 

  • biomurphbiomurph Brooklyn, NY
    If you have an FTDI Friend running at 3V, you could do it with jumpers.
    You can use the Dongle, but you would need to solder the header pins onto it.
    Check here for other ways.
  • So I take it that the ftdi friend indeed does come with the headers already soldered on? 

    Also, if I use the ftdi friend, do I still have to use the breadboard to connect the jumpers to the openbci board or is the breadboard only necessary when using a capacitor? 


  • Meant the RFduino USB Shield
  • biomurphbiomurph Brooklyn, NY
    If you use the FTDI friend, you will need a capacitor.
    If you use the RFduino USB Shield, you will not need a capacitor, and you can connect directly from the TX, RX, RESET, GND pins.

  • "There was an update to both of those firmwares over the summer. "

    What are the advantages when I update both RFduinos on the dongle and the board?

    I have a RFduino Kit.
  • nknk
    edited November 2015
    I have successfully uploaded the latest rfduino firmware onto both the dongle and board.  

    I now get through the upload process every time but get the same address error on verify.  I have tried a dozen times and followed advice on other thread about using new batteries, holding board close to device, and timing the reset button. 

    What next?

    EDIT:  Reread thread, tried superstition trick and made it almost through verification but with a read page error.  The board blue light however now turns on so I will attempt to use device and see what happens. 
  • biomurphbiomurph Brooklyn, NY
    @nk If there is a verification error, it might be that the code did get loaded correctly.

    @refurbished the new firmware helps improve the up- loadability so that the timeout issues don't happen.
  • Got the verification read page error, device now powers on and seems to work fine.  If the code didnt upload properly would there be any symptoms or would the device simply not power on?   
  • yjyj France , Bordeaux
    @nk
    If by chance you do not go through all the numerous functions you might ignore that some are corrupted.
    All that I can do is to sympathize because I currently live the same nightmare...

    @biomurph
    That we have to keep close, less than a centimeter , host and device, let think that RFduinos do not work well.
    Should we change them?
    Is it possible by hand?
    Have you tried?

    Thank you,
    Yannick.
  • biomurphbiomurph Brooklyn, NY
    @nk
    If the verification failed, but it still turns on the blue LED and responds to the GUI, it's likely that there was just a radio crash during verification. We have found that if it is really not working, it just doesn't work.

    I guess it could possibly be the RFduino. Those solder connections are not hard to work with. I imaging that you could use solder braid to remove it, or use a hot-air re-work tool for sure. We have not had any issues with any of our RFduinos. They are shockingly reliable. Have you tried to upload in different locations? 
  • edited November 2015
    I think it worth sharing that when I try to upload a code to my 32-bit board, but I encountered an error, where the Arduino cannot locate the library. But that confused me for a little bit, because I've been using Arduino to upload codes to 32-bit board with no problem before.

    I thought the problem is coming from using Windows. So, I tried it in my Mac, but I encounter the same error. Long story short, I found the problem coming from using the latest Arduino version (1.6.6).

    The solution is using any previous version of Arduino; to be very specific ( from 1.5.8 BETA to 1.6.5).

    It could be that the library of OpenBCI needs to be updated to work with version 1.6.6, but I'm not sure.


  • I also had to use an earlier Arduino version last week uploading code--I think I ended up using 1.5.4, arbitrarily. The problem was the compiler not finding the library (despite the application recognizing it).
  • biomurphbiomurph Brooklyn, NY
    I've experienced something about version 1.6.6 Arduino that is not finding the OBCI_SD library.
    I use 1.6.5 instead, and it works. The tutorial has been updated.
  • afliuafliu Beijing, China
    Arduino 1.6.6 build OpenBCI always failed when I tried follow "Upload code to mainbaord" guide, the error is below:

    C:\Users\Think\Documents\Arduino\OpenBCI_32bit\OpenBCI_32bit.ino:33:23: fatal error: OBCI32_SD.h: No such file or directory

    compilation terminated.

    exit status 1

    I did follow Arduino guide to configure the environment, here is the my folder configuraiton:
    1.  OS: Win7

    2.  C:\Users\Think\Documents\Arduino
            |___libraries
            |___ OpenBCI_32bit

    3.  C:\Users\Think\Documents\Arduino\libraries
            |___OBCI32_SD
            |___OpenBCI_32_Daisy
      
    Can anyone any suggestion to help me out of this? Thanks in advance.

    Regards,
    -Anfeng
  • wjcroftwjcroft Mount Shasta, CA
    @afliu , I merged your question about 1.6.6 into this existing thread.

    Try using 1.6.5 as Joel and Alfahad suggest.

    William
  • biomurphbiomurph Brooklyn, NY
    @afliu

    There is something fatal in the 1.6.6 build of Arduino, and I have not chased it down yet...

    The problem only seems to affect the OBCI_SD library
  • edited December 2015
    I want to upload the firmware (with using SD card only) provided in Github (https://github.com/OpenBCI/OpenBCI_32-write-to-DS-only).


    I run Arduino IDE 1.6.5

    The progress stopped at the step "Verify Flash" and threw out the following error:

    error at address 1D000204: file=275A02B8, mem=275A02BC

    From that time I cannot upload any firmware to the board anymore. Have anyone had this problem before?


  • wjcroftwjcroft Mount Shasta, CA
    @ntlanh, I merged your firmware upload question to this existing thread on that topic. More folks will see your post this way.


  • edited December 2015
    Hi every one ,
     i faced a problem in firmware uploading of open BCI
    32 bit v3 board... I download all the firmware and libraries and also
    installed the chipkit core for arduino latest version ... but when i
    verify the code it gives me this error : pic32-g++: C:\Users\Adeel\AppData\Local\Temp\build72b065f92d2b6e4f5d8477e3c9f59c39.tmp/core\core.a: No such file or directory

    Can any one please help me... yur support will be appriciated.. thanks
  • wjcroftwjcroft Mount Shasta, CA
    edited December 2015
    @adeel, hi. I merged your uploading question into this existing thread with uploading suggestions. Are you using the 1.6.5 IDE? Here are some related posts that showed up with a search,

    https://github.com/arduino/Arduino/issues/4055
    https://github.com/arduino/arduino-builder/issues/42
    https://forum.arduino.cc/index.php?topic=359049.0

  • @wjcroft Thanks Alot .. its realy helping and ables me to find the solution for this problem .... the main problem is that latest chip-kit cores are not compatible with arduino 1.6.7 and AVR boards 1.6.9 ... for this I downgrade my arduino IDE to arduino 1.6.5-R5 ... and from boards manager install arduino AVR 1.6.8 only ... this helps me alot and thank you again for your support
Sign In or Register to comment.