Avatar for DarKMooN

DarKMooN

Member since Aug 2015 • Last active Mar 2018
  • 3 conversations
  • 6 comments

Most recent activity

  • in Other Boards
    Avatar for DarKMooN

    Hi Gordon,
    thanks for a reply.
    Well, I could just read the flash, but when I merge your changes or reflash the board the command you suggested I have to run after flashing or I have to write memory by a programmer. But this I could automate with this command for example echo "E.setBootCode('...',true)" > /dev/ttyACM0

    If you're building yourself why not just add 'default_console' : "EV_SERIAL6", in the board.py file?

    I can't set it because when I unplug the USB, the console will switch and in an application which uses Bluetooth or wifi module the transported data will be evaluated by Espruino and not by application. Right?

  • in Other Boards
    Avatar for DarKMooN

    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

  • in Porting to new Devices
    Avatar for DarKMooN

    Heureka, I did not know that it can be somewhere in jspin.c. Thank you very much :)

    • 3 comments
    • 601 views
  • in Porting to new Devices
    Avatar for DarKMooN

    Hello,
    I'm building Espruino on custom board (based on STM32F4) which have five buttons and I would like to add the definition of the fifth button to binary. I added definitions of buttons to STM32F4DISCOVERY.py file and also I added BTN5 to simpleDevices array in build_platform_config.py but when I flash the board and try to call BTN5 I get Uncaught ReferenceError: "BTN5" is not defined. Do I need to define this button somewhere else or it's not possible to define more buttons or other devices? I found note about this mentioning that I can you LED1-LED8, BTN1-BTN4, etc., but I need one more button for convenience. Thanks for any advice

  • in Interfacing
    Avatar for DarKMooN

    Awesome, it fixed the problem. Thanks a lot.

  • in Interfacing
    Avatar for DarKMooN

    Hi, I'm trying to create server on ESP8266 and when I run code locally with USB cable connected it works fine, but when I save code to flash I get "Not connected to the internet" error.
    I'm not sure what I do wrong or why is the internet connection required, because I'm not communicating with it. Can someone please help me?
    I use STM32F4Discovery with 1.80.1 Espruino and MOD-WIFI-ESP8266 with 0.25 firmware version.
    Code is below

    Serial3.setup(115200, { rx: D9, tx : D8 });
    var soc;
    var wifi = require("ESP8266WiFi_0v25").connect(Seri­al3, function(err) {
      if (err) {digitalWrite(LED4,1);throw err;}
      //wifi.at.debug();
        console.log("Connecting to WiFi");
          wifi.connect("Espruino",'freeWifi', function(err) {
            if (err) throw err;
            console.log("Connected");
            require("net").createServer(function(c){­
              console.log("incomming connection");
              c.on('data', onDataCallback);
              c.on('close', function(){
                console.log("bye");
              });
              soc = c;
            }).listen(8080);
            wifi.getIP(function(err,ip){
              if(err === null){
                console.log(ip);
                serverIP = ip;
                digitalWrite(LED2, 1);
              }
            });
      });
    });
    
    function onDataCallback(data){
      digitalWrite(LED1, !digitalRead(LED1));
      console.log("Server received: " + data);
      if(data !== undefined){
        if(data.length >= 6 && data.substr(0, 3).toLowerCase() == "led"){
          switch(data.charAt(3)){
            case '1':digitalWrite(LED1, data.charAt(5));break;
            case '2':digitalWrite(LED2, data.charAt(5));break;
            case '3':digitalWrite(LED3, data.charAt(5));break;
            case '4':digitalWrite(LED4, data.charAt(5));break;
          }
        }
        soc.write("Response: " + data);
        if(data.substr(0,4) == "exit")
          soc.end();
      }
    }
    save();
    
Actions