How to compile the firmware?

@arvydas thanks pal :kissing:

@arvydas its still not producing a serial,make deploy then make defaults to flash the eeprom then make dump to dump the eeprom to look and see if its made the serial but the dump is still the same as eeprom.hex defaults file,ive changed the eeprom defaults to eeprom.hex do i have to type the serial in a text file anywhere? or should the increments.rb do all the work?


@arvydas another set of errors,only get these errors in the master firmware,the other two firmwares pro and 1.4 dont get errors but still dont produce the serial,its coming close! the eeprom hex file has changed to what looks verry much like a proper dump but without the serial in it,ive converted the hex with online hex converter but no serial in it? could i still be missing some gems?.

aww right ive installed top and treetop,its showing BS000000-1.0 in the comand line output now nearly there its saying somthing about assigned but unused variable?

ive sorted it,yipee :sunglasses:

@arvydas hi mate,ime having problems all of a sudden,with the firmware,it compiles it flashes eeprom seems to flash ok,but when i click on the blinkstick to enable it from the drop down menu it just crashes,it seems to be the firmware of new flashed sticks,i got my new sticks from pcb maker and flashed firmware to them,they are fine as i used chip from my orriganal blinkstick,but new compiled firmware seems to crash,not sure if its avrdude or somthing,i did downgrade it the other day so to compile somthing els but ive upgraded it again so i dont know if its that,i dont get any errors,ive been pulling my hair out all morning/day lol it was fine other day then now it wont work,also i noticed the pro firmware has been changed from 2.1 to 2.2 first i thought it was that but none of the firmware works,any ideas?

it seems to work when i clear everything back to make clean and revert the hex file back to default and reset number in serial text,it lets me flash once but wont go any higher than BS000001-2.2 well it will but it wont work any ferther flashing results in client crash even though all seems to flash ok,serial shows up etc but soon as i click on the serial to use the stick it crashes.its strange,

@arvydas,it seems its client,as blinkstick status works fine,it was client all along,since the new one was installed,rc7 ive uninstalled but now none of my sticks work with any client,i deleted all files from folders but still client will crash,ime close to reinstall windows,i cant think of any other way to fix it,probly registry errors,anbyhowe i get this error in logs,
2016-03-10 04:05:39,650 [1] DEBUG Main - Initialization done
2016-03-10 04:05:43,399 [1] FATAL Main - Unhandled exception occured:
2016-03-10 04:05:43,399 [1] FATAL Main - Object reference not set to an instance of an object.
2016-03-10 04:05:43,405 [1] FATAL Main - at BlinkStickClient.DataModel.BlinkStickDeviceSettings.SetColor(Byte r, Byte g, Byte b)
at BlinkStickClient.OverviewWidget.<.ctor>b__0(Object sender, ColorClickedEventArgs e)
at BlinkStickClient.ColorPaletteWidget.OnColorClicked(Color color)
at BlinkStickClient.ColorPaletteWidget.OnButtonReleaseEvent(EventButton evnt)
at Gtk.Widget.buttonreleaseevent_cb(IntPtr widget, IntPtr evnt)

@arvydas Hi seems any new flashed blinksticks crash on rc6 rc7 client? ive had to downgrade client for my new sticks to work or client will crash.both pro and 1.4 sticks.

This can’t be registry errors. Can you post the screenshot of the Overview page when you have your custom BlinkStick plugged in and selected?

@arvydas Hi pal,any ide as to when you will publish the rest of the firmwares etc and brd files for other blinkstick products,you mentioned tying it all up into one development package type thing?

Still working on this, there is quite a lot of information :smile:

Here is a small sketch to write anything (eg. serial number) directly to the blinkstick eeprom.
No faffing about with hex files.

#include <EEPROM.h>
#include "EEPROMAnything.h"

void setup()
{
        EEPROM_writeAnything(0, "BS000000-3.1");
}
void loop()
{
  exit(0);
}

EEPROMAnything.h is a standard sketch, given here for reference:

#include <EEPROM.h>
#include <Arduino.h>  // for type definitions

template <class T> int EEPROM_writeAnything(int ee, const T& value)
{
    const byte* p = (const byte*)(const void*)&value;
    unsigned int i;
    for (i = 0; i < sizeof(value); i++)
          EEPROM.write(ee+i+1, *p++);
    return i;
}
1 Like

Also, for interest here is a soft reboot function for the ATTiny. You can add an extra VUSB feature report in the firmware to trigger it, which solves the faffy physical flash procedure for this chip.

void reboot(void) {
  void (*ptrToFunction)(); // function pointer
  ptrToFunction = 0x0000;  // set pointer to go to chip reset vector
  (*ptrToFunction)();      // jump to reset, which bounces in to bootloader
}