• Hi, I use Espruino to teach children programming and robotics and recently I got an idea that it would be cool to program boards over Bluetooth or wifi. So I purchased HC-06 Bluetooth module and tested it. It is working fluently and without any issues but I want to be able to program over USB too. To solve this I created simple startup code to switch default console to Serial6 when a specific button is pressed. The boot code is as follows:

    if(digitalRead(BTN2)){Serial6.setConsole­();}
    

    Unfortunately, I can't set the Serial6 default while compiling because it can be used for programming or for data transfer to the loaded application.

    I also sometimes have to repair the boards by reflashing them. Therefore the boot code is lost and must be written again.

    My question is if it is possible to create boot code, which will be included in the binary itself? I dig in the code and I found symbols which are used for storing the boot code in memory, but I do not know, how to add my code to it.

    If anyone could give me some advice, I will be glad.
    Best regards,
    Tomas

About

Avatar for TomasJ @TomasJ started