How to compile the firmware?

Repository now contains default EEPROM for BlinkSticks. Just rename it eeprom.hex and you should be good to go!

@arvydas so what makes the serial number for the eeprom then,say i made a board to use with the client and wanted to put a serial number in how would i do that,ide only use the serials i have,or if possible put a c in the serial like BSC0022-1.4 as to show its a clone then it wouldnt eccidently be someone elses serial if i was to use a random number for a cloned or differant version of blinkystick,See ime trying to make an RGB led project that takes an sd card wich is loaded with patterns in a hex file,ile be using boot 2 and also it will use an lcd screen as to select the right pattern hex file from a list it will have a loader and settings file too so the screen can be setup e.g contrast etc it will have an rgb led on board too and rgb outputs with mosfets as to use 12v strips and 5v neopixels,it will be good when its done,ive to learn c++ on the way or arduino :hushed:

You should look at

make deploy

command is the one that does all of the serial writing to eeprom.hex before it’s flashed to the device.

BlinkStick is not suitable for your project - it is extremely limited with the amount of resources including RAM, EEPROM and flash. You are very much better off with something like Arduino and base you project on that, because BlinkStick firmware is already using all of the available resources on the ATTIny85 chip :smiley: There will not be any more resources to run SD card and you need lot’s of RAM for something like LCD display. You should consider something like Arduino Mega.

@arvydas oh i know blinkstick its self is not suitable for the project i mentioned,i was just tinkering with the firmware as parts it could be the basis of somthing i could implement,i would be using mega or 32 or even 32u4 and maybe even mega like you said,and external eeprom,but ime verry far away from developing anything yet ive to master the basics of programming,ime just tinkering with ideas also ive made my own blinksticks on breadboard like blinkstick square etc,just mucking about learning whats what and how your project is made, its helped me loads and at the same time having fun doing it wich is mainly why i do it,but thanks for the heads up so far on the things ive asked,but with help from willing internet coding buddies i maybe able to start somthing off sooner,i do get frustrated somtimes trying to jump befor i can walk typ of thing,ive loads of ideas and projects in my head all planned out but just need to learn the c code,but ile get there :smiley:

@arvydas whats with the error code i posted above = cannot load such file wo_oo/util/hex,do i need to install a missing jem or wo_oo or somthing,it only gives this error on one of the firmwares.it still uploads the firmware etc

You need to install hex gem with

gem install hex

@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
}