Author Topic: Webbotlib Studio FBoot only works the first time!  (Read 18994 times)

0 Members and 1 Guest are viewing this topic.

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Webbotlib Studio FBoot only works the first time!
« on: September 30, 2014, 09:58:28 PM »
I'm running the latest Webbotlib Studio on my 64 bit Windows 7 computer.

Webbotlib Studio FBoot works only the first time, but not any consecutive time thereafter.

I found that I had to re-burn the boot loader using my avr dragon device programmer.

Then Webbotlib Studio FBoot worked again, but for only the very first time. All consecutive attempts failed.

Does the Webbotlib Studio FBoot overwrite the boatloader?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #1 on: October 02, 2014, 02:06:39 PM »
Shouldn't do - after all it is the FBoot boot loader that works on the CPU to receive and re-burn the flash. If anything is overwriting the boot loader then it can only be the boot loader itself that is allowing/doing it. Webbotlib Studio cannot 'write' anything directly - it can only talk to the boot loader. Suggest that either the bootloader is at fault or perhaps the fuse settings that protect the boot loader.

More info re board, processor, hex flash size, fuse settings, fboot version etc may help. But it ain't Webbotlib Studio !!



Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #2 on: October 02, 2014, 08:18:24 PM »
Shouldn't do - after all it is the FBoot boot loader that works on the CPU to receive and re-burn the flash. If anything is overwriting the boot loader then it can only be the boot loader itself that is allowing/doing it. Webbotlib Studio cannot 'write' anything directly - it can only talk to the boot loader. Suggest that either the bootloader is at fault or perhaps the fuse settings that protect the boot loader.

More info re board, processor, hex flash size, fuse settings, fboot version etc may help. But it ain't Webbotlib Studio !!

I hooked up my avr dragon device programmer and checked the fuses. They are set correctly as specified in SoRs Q&A section on fuses.

One thing I did notice is that when it works the first time, there is a "[INFO] AVRISP MKII (avrdude):..." message that is output to the Webbotlib Studio "Output" window.

However, that message does not get output during the second attempt that fails.

What I don't understand is even though I set "Programmer:" to "Fboot", why does the "[INFO] AVRISP MKII (avrdude):..." message get output? I'm not using an AVRISP MKII.

First attempt (success)....

[INFO] Flash: Start
[INFO] Flash: Regenerate project with earlier settings
[INFO] Flash: Regenerate the makefile
[INFO] Flash: Clean and compile sources
[INFO] Flash: End
[INFO] Flash: Project has been regenerated and compiled ok
[INFO] Flash: Upload file is called:walle_robot.hex
[INFO] AVRISP MKII (avrdude): com.webbotlib.studio.programmers.avrdude.AvrIspMk2AvrDudeFlasher add mapping for processor:ATmega640=>m640
[INFO] FBoot: Parsing file walle_robot.hex
[INFO] FBoot: File contains memory segments:
[INFO] FBoot: 00000-024BD
[INFO] FBoot: connected to COM4
[INFO] FBoot: Start Flashing via COM4 at 115200 baud
[INFO] FBoot: Switch on your board
[INFO] FBoot: Trying to connect...
[INFO] FBoot: ...Connected
[INFO] FBoot: Check CRC support
[INFO] FBoot: Bootloader V2.1
[INFO] FBoot: Signature: 1E9608
[INFO] FBoot: Buffer Size: 7168 bytes
[INFO] FBoot: Maximum Flash Size available: 64512 bytes
[INFO] FBoot: Check CRC support
[INFO] FBoot: Checksum is OK
[INFO] FBoot: Start Programming
[INFO] FBoot: End of block:7168
[INFO] FBoot: Block programmed ok
[INFO] FBoot: All data processed
[INFO] FBoot: Start Verifying
[INFO] FBoot: All data processed
[INFO] FBoot: Check CRC support
[INFO] FBoot: Checksum is OK
[INFO] FBoot: End Flashing - OK
[INFO] FBoot: disconnected from COM4

Second attempt (fail)...

[INFO] Flash: Start
[INFO] Flash: Regenerate project with earlier settings
[INFO] Flash: Regenerate the makefile
[INFO] Flash: Clean and compile sources
[INFO] Flash: End
[INFO] Flash: Project has been regenerated and compiled ok
[INFO] Flash: Upload file is called:walle_robot.hex
[INFO] FBoot: Parsing file walle_robot.hex
[INFO] FBoot: File contains memory segments:
[INFO] FBoot: 00000-024BD
[INFO] FBoot: connected to COM4
[INFO] FBoot: Start Flashing via COM4 at 115200 baud
[INFO] FBoot: Switch on your board
[INFO] FBoot: Trying to connect...
[INFO] FBoot: Timed out
[ERROR] FBoot: Error during connect: Timed out
[WARN] FBoot: End Flashing - FAILED
[INFO] FBoot: disconnected from COM4


Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #3 on: October 03, 2014, 08:37:01 PM »
I downloaded and used a USB monitoring program called "Device Monitoring Studio" by "HDD Software" to capture the packet communication between Webbotlib Studio's FBoot and my Axon II.

Attached are two text files of the results of a successful FBoot (first attempt) and the failed FBoot (second attempt).

I hope this helps in determining the problem.

P.S. Does Webbotlib Studio have a debug environment variable I can set that would allow for the debugging of the FBoot transmissions?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #4 on: October 04, 2014, 07:23:44 AM »
WebbotLib Studio doesn't allow you trace the individual bytes but does at least give some logging in the output tab.
Looking at you files then the Failed attempt it looks like the AxonII is not running the bootloader - hence the bytes that WebbotLib Studio gets back are what your program is outputing the to UART/USB such as initalising messages.

I'm wondering if the bootloader is somehow overwriting or disabling itself.
Using your hardware programmer - how are the fuses set on the Axon II?
Mine are as follows:-

BODLEVEL = 4V3
OCDEN = [ ]
JTAGEN = [ ]
SPIEN = [X]
WDTON = [ ]
EESAVE = [X]
BOOTSZ = 512W_7E00
BOOTRST = [X]
CKDIV8 = [ ]
CKOUT = [ ]
SUT_CKSEL = EXTXOSC_8MHZ_XX_16KCK_65MS

EXTENDED = 0xFC (valid)
HIGH = 0xD6 (valid)
LOW = 0xFF (valid)

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #5 on: October 04, 2014, 02:24:43 PM »
My fuses match what the SoR's Axon II FAQ section says they should be set to.

Attached is an image capture of my Axon II's fuses settings.

One thing I noticed is that BOOTSZ and Fuse Register HIGH value are different than yours.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #6 on: October 05, 2014, 06:27:25 AM »
I think you should try changing the BOOTSZ to be the same as mine. (Wont cause any damage - after all that is how I have mine set).

I have a theory as to what is going on - and so if the above works then I'll explain it
« Last Edit: October 06, 2014, 01:38:21 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #7 on: October 06, 2014, 07:29:31 PM »
I changed BOOTSZ to 512W_7E00 and the problem still exist.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #8 on: October 07, 2014, 12:14:10 PM »
Hmm - works fine for me  :) . I need to do some experimenting to see if I can reproduce your problem.
In the meantime make sure that:-
  • Your hardware programmer is physically disconnected before using the bootloader
  • When re-programming the board then leave it off for 5 to 10 seconds before re-programming via the bootloader
  • Send me a copy of your project .hex file - just in case that is the problem (for any strange reason!)
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #9 on: October 07, 2014, 07:47:17 PM »
Attached you will find the bootloader that I'm using and my program.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #10 on: October 08, 2014, 09:08:39 AM »
Have installed your attached bootloader hex file
Set fuse settings as specified in my setup ie 512W_7E00
I can then program your project hex file, and others, as many times as I want - all successfully - using the FBoot bootloader.

The ONLY way I can get it to fail  is to leave the hardware programmer, AVRISPMKII, attached to the board - as it causes a RESET during programming. Appreciate you are using the Dragon programmer (but I dont have one - so hard to compare).

So am somewhat at a loss why you are seeing something different.

Clutching at straws then you may need to unplug other/all hardware - as I have nothing connected to my AxonII when testing this - as I have no idea what your hex file does. Devices that control RESET or have high power needs (hence may put a large  drain on a non-charged capacitor could cause the bod to reset the board ) are the main suspects.

But for testing it would be best to disconnect all devices. If that works (as it does for me)  then try adding devices back in until it fails.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #11 on: October 08, 2014, 09:38:26 AM »
I disconnect my AVR Dragon programmer after programming the bootloader.

When using Webbotlib Studio's FBoot, there is nothing connected to my Axon II except for the USB cable and power source.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #12 on: October 08, 2014, 12:19:59 PM »
Yep - and that's how I have stuff. But for me everything works!!

Given that we are both using the same version of FBoot on the board (written by another supplier - ie not Webbot nor SoR but from a 3rd party), and that a bootloader from the pc end can only upload a flie (ie Webbot and everyone else just use the API) then I'm very confused why it works differently. Since WebbotLib Studio is going through the same comms API as any other bootloader client (fboot command line or McUber) then I am mega confusd.

Perhaps its the same when using other software at the computer end? Or do you get success when using A.N.Other programmer? Or does everything fail?
« Last Edit: October 08, 2014, 12:22:13 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #13 on: October 08, 2014, 01:57:33 PM »
I'm assuming when you used the bootloader and program that I sent you, you attempted the programming of the Axon II all from a Windows 7 64 bit computer? Is that correct?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #14 on: October 08, 2014, 06:49:42 PM »
I'm assuming when you used the bootloader and program that I sent you, you attempted the programming of the Axon II all from a Windows 7 64 bit computer? Is that correct?

Yep - Windows 7 (Home Premium) 64 bit
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #15 on: October 09, 2014, 08:39:05 AM »
In the Webbotlib Studio FBoot window there are two check boxes. One labeled "Program" and the other labeled "Verify." The window pops up with both set on by default.

I decided to test by setting and unsetting these check boxes to see what results I would get. Here are some of the results...

Attempt Program Verify Result 
------- ------- ------ ------
   1      on     on      OK
   2      off    on      OK
   3      on     off     fail
   4      off    on      fail
   5      on     off     OK
   6      off    on      fail
   .       .      .       .     
   .       .      .       .     
   .       .      .       .     

So, it looks like I did get some success after the first attempt, but it was hit and miss. I could not discern a pattern.

I'm hoping this new information will help you determine what the problem might be.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #16 on: October 09, 2014, 11:19:52 AM »
What version of WebbotLib Studio are using? Latest is 1-13-1.

How are you downloading/running it?
1. via the WebbotLib Downloader
2. via the JNLP/JavaWebStart file
3. some other way

[edit to add]
I've been through your steps and, once again, all works for me.

I'm just wondering if, for some reason, your board is rebooting once the bootloader get underway. FBoot isn't good at handling this - and that's why leaving an AvrISP hardware programmer connected fails as the programmer resets the cpu after a short while.

In your case I'm wondering if you are getting bad contact bounce from your power switch causing a quick on-off-on.  Clutching at straws!

If you're up for it - I've also written my own boot loader called WLSBOOT (you may have seen it in the drop down) which detects these sorts of things and is more resilient. If you're up for it then let me know and I'll send you a copy to try.

P.S. Love what your project does on the AxonII segmented LED !


« Last Edit: October 09, 2014, 11:50:28 AM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #17 on: October 09, 2014, 08:11:33 PM »
I'm running Webbotlib Studio via WebbotLibStudio.jnlp

The version is 1-13-1.

See attached for the Webbotlib Studio help about info.

And yes, I would love to try your WLSBOOT program.


Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #18 on: October 10, 2014, 12:56:07 PM »
Ok great. Attached Help was useful - as it also shows that your running a 16 bit version of Java on your 64 bit machine. Not relevant to this issue - but once your chaos has settled then you may want to install a 64 bit version (you can have more than one - controlled via environment variables: JAVA_HOME and also the PATH - as to which is used by default).

Need to get WLSBOOT into my source control and build system - over the weekend (hopefully) - and will then PM you a link to download it (as it won't be on general release to start with). Dont want lots of threads like this one running concurrently :-)

Have also been working on AvrDude support which could help you as the Dragon is 'supported'. Have no way to test it out so, if your up for that at some point, then would appreciate your co-operation.

Will PM you when WLSBOOT is ready to go


Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #19 on: October 10, 2014, 02:45:30 PM »
Looking forward to testing WLSBOOT and will be interested in the testing of the AvrDude support.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #20 on: October 11, 2014, 09:11:04 AM »
WLSBoot can now be downloaded from here: http://webbot.org.uk/iPoint/55.page
NB For the Axon(s) you need the UART 1 version.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #21 on: October 11, 2014, 03:19:29 PM »
No success.

1) I downloaded WLSboot (http://webbot.org.uk//WebbotStudio/WLSBoot_atmega640_Uart1_16MHz.hex) from http://webbot.org.uk/iPoint/57.page

Type = WLSBoot
MCU = ATMega640
Speed = 16MHz
UART = 1
BOOTRST =Ticked
BOOTSZ = 512W_7E00

2) I used my AVR Dragon to program and verify WLSBoot_atmega640_Uart1_16MHz.hex

3) I launched WLS and burned the project to the board with the following settings...

Programmer: WLSBoot
COM Port: COM4
Baud Rate: 115200

No matter how many times I try, I'm not getting any success.  :(

I'm running out of options.

I'm willing to loan you my Axon II just to rule out the board.


Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib Studio FBoot only works the first time!
« Reply #22 on: October 12, 2014, 11:22:53 AM »
Hm - I'm also running out of suggestions  :)

Quote
I'm willing to loan you my Axon II just to rule out the board.
Not that simple. I'm based in the UK - think you're East Coast - so on top of postage there is customs duty as well. Note I'm just a SoR member like you - I don't make the Axon boards!

Only thing that may be worth knowing is the logging on the WLS Output tab as well as your USB sniffing log. I can then try to work out what's going on.

If all else fails then I could drive your Dragon either via AvrStudio tools or directly via AvrDude (although the latter clobbers the Jungo USB drivers in Atmel Studio - which can be re-installed). Probably need a new thread for this - or an off line chat. Mainly coz I don't have a Dragon. So would need to work together to get something that works.
Given your problems so far then I probably need to buy a Dragon - ie works for me but not you!

 [edit] Just 'gone mad' and ordered a Dragon You could also try dropping the baud rate right down. If that works then increase it till it breaks. Can't give you a 'number' as it depends on how fast your laptop/pc is.
« Last Edit: October 12, 2014, 01:21:40 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hero ITopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #23 on: October 14, 2014, 10:24:08 PM »
I tried dropping the baud rate down to its lowest level and still no luck.

I then installed WLS 1-14 and tried the "AVR Dragon (Atmel AVR Studio)" option and it works every time I tried it. I'm happy with this setup and will continue to develop using this method.

Offline mklrobo

  • Supreme Robot
  • *****
  • Posts: 558
  • Helpful? 15
  • From Dream to Design at the speed of Imagination!
Re: Webbotlib Studio FBoot only works the first time!
« Reply #24 on: June 18, 2021, 09:41:50 AM »
I bought an Axon, and electronic interface to program it, but never could. I gave up and went to raspberry pi. I always liked the Axon, but never had any luck with programming it.

Offline dervisvid

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Webbotlib Studio FBoot only works the first time!
« Reply #25 on: April 08, 2022, 03:51:03 AM »
I recently purchased two sets of the Lynxmotion wireless controllers and receivers along with the controller cable for a robot I am upgrading. I only need one set, but I bought two in case something goes wrong with one of them. It turns out there might be something wrong with both sets as I am having an avalanche of things not working right.