Author Topic: Improved Micronucleus (smaller, attiny84 alpha)  (Read 23688 times)

cpldcpu

  • Newbie
  • *
  • Posts: 30
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #30 on: December 17, 2013, 03:37:04 am »
You can install the AVR toolchains:

http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx

This will allow you to compile micronucleus from a shell.

I may improve the build system at some point in the future, but right now creating all these different versions is quite complicated, so I'd like to limit the number of different hex files in the release.

cpldcpu

  • Newbie
  • *
  • Posts: 30
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #31 on: January 03, 2014, 01:41:10 pm »
I am currently preparing a new release v1.11. In the process of making the hex files I noted another difference between the micronucleus and littlewire usb configuration:

Littlewire:
#define USB_CFG_DEVICE_CLASS        0    /* set to 0 if deferred to interface */
#define USB_CFG_INTERFACE_CLASS     0xff   /* define class here if not at device level */
https://github.com/micronucleus/micronucleus/blob/testing/firmware/releases/micronculeus-1.11-class-ff.hex

Micronucleus:
#define USB_CFG_DEVICE_CLASS         0xff    /* set to 0 if deferred to interface */
#define USB_CFG_INTERFACE_CLASS     0   /* define class here if not at device level */
https://github.com/micronucleus/micronucleus/blob/testing/firmware/releases/micronucleus-1.11.hex

There is no difference on my machine, but maybe on a more critical machine? Bobricius, would be great if you could test it again. I linked the hex files above.

bobricius

  • Newbie
  • *
  • Posts: 49
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #32 on: January 04, 2014, 05:05:15 am »
Hi, I'm currently on vacation. I have here mother-in-law problematic laptop HP635 WinXP, I do not have my stupid hub. I tested all versions. 1.10 works better than 1.6 (writing finished mostly only to 65%) all the software version 1.11 freezing upload not end until after removal from usb, in status show writting failed somewhere at 75%.
Ext reset version is very good;)
Enumeration  works in all versions mostly on a second or third attempt, then again on the second or third attempt was also successfully completed writing.
I think that is good statistic :)
Subjectively seems to me that the version 1.10 is little more reliable. Its like 1.11 sometimes freezing before finish

cpldcpu

  • Newbie
  • *
  • Posts: 30
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #33 on: January 04, 2014, 07:47:43 am »
Hi,

Thanks a lot for testing! To be honest, your issue sound very much like a general comminication issue between V-USB and the laptop. I have seen similar behavior with a more timing critical (polled) implementation of V-USB. I am not really sure what to do about this.

The difference between V1.10 and V1.11 could stem from the fact that V1.11 is actually doing an CRC check on incoming packets while 1.10 and earlier versions don't. This does not mean that 1.10 is more stable, but that it is possibly less critical of data transmission errors.

One possible fix may be a different, slower, data transmission protocol. I attached an alpha version of micronucleus v2.0, which also needs a new commandline tool. Does it work better?
« Last Edit: January 04, 2014, 07:52:03 am by cpldcpu »

bobricius

  • Newbie
  • *
  • Posts: 49
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #34 on: January 04, 2014, 08:16:20 am »
I try test tomorow. If you changing upload tool maybe is interesting orientaion to Hid device, no driver
exist here hid branch :)

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #35 on: January 04, 2014, 04:16:52 pm »
HID requires micronucleus to be substantially bigger - so less memory for user programs. A bootloader is not a human input device. The interface doesn't really make sense for it. Very unnatural fit. Meanwhile, windows is the only platform that needs drivers. Seems like a shame to make the bootloader fatter to work around restrictions of just one operating system.

bobricius

  • Newbie
  • *
  • Posts: 49
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #36 on: January 05, 2014, 09:56:26 am »
I tested, enumeration on second or the third attempt. Every successful enumeration = 100% successfully writing. Only 2x happened writing end at 70% but cmd tool successfully returned to IDE and show an error.

cpldcpu

  • Newbie
  • *
  • Posts: 30
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #37 on: January 14, 2014, 11:47:03 pm »
I tested, enumeration on second or the third attempt. Every successful enumeration = 100% successfully writing. Only 2x happened writing end at 70% but cmd tool successfully returned to IDE and show an error.

This is really strange, because the writing is a much more critical part of the USB traffic. Typically I see that enumeration works fine and the bootloader breaks during upload. No idea what to do about it right now, maybe it will be better with V2 which abuses USB in a slightly different way.

cpldcpu

  • Newbie
  • *
  • Posts: 30
Micronucleus V1.11 released
« Reply #38 on: January 14, 2014, 11:48:56 pm »
Micronucleus V1.11 is now live. This version will not periodically time out, allowing much easier installation of the drivers on a new host machine.

https://github.com/micronucleus/micronucleus

Changes compared to v1.10:
 • The size was reduced further to 1816 bytes, allowing 6380 bytes user space.
   (320 bytes more than in v1.06)
 • The bootloader will always start and never quit if no user program was loaded.
   This allows for much easier driver installation. Use the new "--erase-only"
   function of the command line tool to create a clean device.
 • New entrymodes have been added. See firmware release notes and source code
   comments for details.
 • All incoming data is now CRC checked to improve robustness.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #39 on: January 14, 2014, 11:52:29 pm »
Wow, that sounds perfect! Congratulations!
Need to test that soon!

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Improved Micronucleus (smaller, attiny84 alpha)
« Reply #40 on: March 06, 2014, 01:22:02 am »