Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A problem with firmware update
#1
Hi Josh,

I have Bpod r0.8 and I updated the firmware to version v21 (from this file: https://github.com/sanworks/Bpod_StateMa...d0_789.ino) , I got "verify successful" message. 

However when I try to activate Bpod in MATLAB, I get the following error: 

ERROR: Old state machine firmware detected, v20. 
Please update the state machine firmware to v21, restart MATLAB and try again.
The latest firmware is here.
Installation instructions are here.

What did I do wrong?
Reply
#2
Hi Noa,


I'm not sure.
The firmware file's line 77 reads:

#define FIRMWARE_VERSION 21

My guess is that the Arduino software is wrong about "verify successful".

Could you please paste the Arduino terminal output (all text from the black panel in the Arduino IDE)?

Thanks!

-Josh
Reply
#3
Thank you Josh for your fast reply!
This is the Arduino terminal output:

Sketch uses 40400 bytes (7%) of program storage space. Maximum is 524288 bytes.
Atmel SMART device 0x285e0a60 found
Erase flash
done in 0.049 seconds

Write 43924 bytes to flash (172 pages)

[                              ] 0% (0/172 pages)
[==                            ] 9% (17/172 pages)
[=====                         ] 19% (34/172 pages)
[========                      ] 29% (51/172 pages)
[===========                   ] 39% (68/172 pages)
[==============                ] 49% (85/172 pages)
[=================             ] 59% (102/172 pages)
[====================          ] 69% (119/172 pages)
[=======================       ] 79% (136/172 pages)
[==========================    ] 88% (153/172 pages)
[============================= ] 98% (170/172 pages)
[==============================] 100% (172/172 pages)
done in 8.456 seconds

Verify 43924 bytes of flash

[                              ] 0% (0/172 pages)
[==                            ] 9% (17/172 pages)
[=====                         ] 19% (34/172 pages)
[========                      ] 29% (51/172 pages)
[===========                   ] 39% (68/172 pages)
[==============                ] 49% (85/172 pages)
[=================             ] 59% (102/172 pages)
[====================          ] 69% (119/172 pages)
[=======================       ] 79% (136/172 pages)
[==========================    ] 88% (153/172 pages)
[============================= ] 98% (170/172 pages)
[==============================] 100% (172/172 pages)
Verify successful
done in 8.314 seconds
Set boot flash true
CPU reset.
Reply
#4
Hi Noa,

If you put a breakpoint on line 43 of 

/Bpod_Gen2/Functions/@BpodObject/SetupHardware.m, 

what are the values of obj.FirmwareVersion and obj.CurrentFirmware.StateMachine?

Note: in the latest MATLAB software, line 43 should read:

if obj.FirmwareVersion < obj.CurrentFirmware.StateMachine

Thanks,

-Josh
Reply
#5
Code:
K>> obj.FirmwareVersion

ans =

 uint16

  20

K>> obj.CurrentFirmware.StateMachine

ans =

   21


This is the output I get...
Reply
#6
I have one additional question,

I an trying to upload firmware for the analog output 4 ch,
In the Arduino software I chose board Teensy3.6 (as instructed in the wiki), but when I am trying to choose the port it only recognizes it as COM7 (Teensy 3.1/3.2).
If I try to upload the firmware I get the following error:

Low memory available, stability problems may occur.
Previously selected Teensy port is offline.
  1 other Teensy board found.  Please select
  this Teensy from the Tools > Ports menu.



I guess I own an older version so I chose board teensy 3.1/3.2 and tried to upload again,
This time I get the following error message:

exit status 1
'SdFatSdioEX' does not name a type

I followed the instructions I found here in the forum, but it wasn't helpful.

Any advise would be helpful, 
Noa
Reply
#7
Hi Noa,

obj.FirmwareVersion is read directly from the device a few lines before that breakpoint - so despite Arduino appearing to reprogram it, the device somehow still has firmware v20.

The analog output module has a Teensy 3.6. If it appears as a Teensy 3.2 to the OS, there's something wrong with the Teensy drivers. 

What OS are you using?
If Windows, here's my recommendation:

1. Download a fresh copy of Arduino from here. Use the "Zip file for non-admin install" option.
2. Extract the .zip to somewhere permanent, e.g. /Documents/Arduino1_8_5/
3. Download and install Teensyduino from here. Point the installer to the Arduino folder from step 2.
4. Download SDFat and put it in the /Libraries/ folder inside the Arduino folder from step 2.
5. Open Arduino.exe from inside the folder you created in step 2.

If you're still seeing these problems, I'll happily help via remote desktop - please write to support@sanworks.io with your availability.

Thanks!
Reply


Forum Jump: