• I am using an STM32F4discovery board, but I think this time the problem doesn't depend on the board.
    I put the HD44780.js file on a SD card into the node_modules directory in order to load the file from a local filesystem( the SD card )
    Then wrote a simple javascript to display a greetings message on LCD and flash a led ever 1 s .
    I saved the script on the flash by using save().
    This works fine as soon as the board starts standalone or linked to a PC with the serial USB cable.
    Anyway I am no longer able to get any communication over the serial USB channel and I have no way to access the board interactive shell either by using a terminal emulator or the Web IDE.

    Is there a reason for this behavior related to the way the "require" machinery works ?

  • I erased the flash and then connected again the board to the Web IDE.
    Now the communication has resumed in a proper way.

    My question is :
    Was this problem simply a side effect or is it not possible to use a local filesystem from which "requiring modules" and have the serial communication over the console USB terminal working ?

  • How are you using the SD card? Did you recompile your own version of Espruino? It's entirely likely that something is broken there and is causing Espruino to crash when it tried to load from the SD card...

    Try holding down the blue button and resetting - that will start Espruino without loading the stored program.

    If I were you I'd use the Web IDE to load the module into Espruino directly (write the require statement in the right-hand pane) and then you don't need an SD card at all.

  • Was this problem simply a side effect or is it not possible to use a
    local filesystem from which "requiring modules" and have the serial
    communication over the console USB terminal working ?

    Yes, it should be possible to do this - it is on the Espruino board. It's probably related to the way you have compiled in Filesystem support...

  • I understand now that the SD card is better to be used for data storage instead of modules downloading.
    I opted for he SD card in case I had to use the board on plants without Ethernet connections.
    I checked again.
    It was a side effect of an unknown reason or perhaps to my "headache" , the infamous MISO pin on the SD card which did not make a good contact from time to time.

    Now after having done the same operations the serial link is operative.
    Just to let you now, anyway I had a different behavior when executing the LCD code.

    The LCD is working fine when the code is downloaded from the WEB IDE.
    When the code is executed from onInit() and flash, the LCD shows some garbage instead of the string
    The situation after having pressed the reset button two times is a shift of the garbage in the first row as you can see from the attached screenshots.
    May it be that some garbage has been introduced after recompilation, but there are a lot of warnings in the C code, that should all be fixed.
    All are quite referred to unsigned to signed int conversion warnings.
    May it be that the LCD garbage is related to the inclusion of the SD card code, some pointer not properly used or something else, because I did a same test for the LCD and it worked fine except for the shift problem, that is to say even before including the SD card code I noticed that the LCD sometimes loosed a column at the beginning of the string.
    Anyway I never considered this a problem , till now, because I consider it due to the setCursor function.
    I could try to fix all compilation warnings and then let you know.

    P.S.
    I recompiled under Ubuntu Linux using the GCC ARM suite compiled for this distribution.
    The recompilation of the GCC code gave no warnings at all so I assumed it was fine.


    3 Attachments

    • IMGP0915.JPG
    • IMGP0917.JPG
    • IMGP0918.JPG
  • Maybe try executing the code after a timeout on onInit? It could just be an issue with the power supply? I notice that you've connected all the wires up when you only need 4 bits - I wonder if the other wires are being set to odd values and are causing problems.

    Are are you sure you haven't connected the LCD to pins that are used for other peripherals? These could be interfering with it: http://www.espruino.com/ReferenceSTM32F4­DISCOVERY

    It is seriously unlikely to be because of the warnings when compiling. If you want to fix them and issue a pull request it'd be great though - I've been trying to work my way around doing it.

  • I am going to check.
    Only 4 bits are used and connected on what appear to be right pins. (C5,C4, C0,C1,C2,C3).
    I made a checklist of already used wires.
    The remaining 4 wires are not used at all .
    I'll begin to work out all the warnings and then let you know.

    Maybe try executing the code after a timeout on onInit?
    No the code was executed before a SetInterval()
    Yes I put the flashing of the led inside the onInit() and this seems to cause problems to the serial communication on Mac OsX as soon as the USB cable is plugged in but not on Windows 7 ( strange… but I must check what is happening since this morning on the Mac )

    If the USB cable is linked led doesn't flash
    If the USB is uncabled , the LED flashes.
    At the end of the trial the downloaded code was this :

    var ON=1, OFF=0;
    
    function LCD_bckgnd(status,pin) { digitalWrite(pin,status); }
    function onInit() {
       var l=false;
       LCD_bckgnd(ON,E7);
       lcd.clear();
      lcd.setCursor(0,0);
       lcd.print(" Board OK …");
       lcd.setCursor(0,1);
      lcd.print("Led1 blinking.");
      setInterval( function() { l=!l; LED1.write(l);},500);
    }
    
    var lcd.c = require("HD44780").connect(C5,C4,C0,C1,C­2,C3);
    
    onInit();
    

    What does it happens with using a timeout on onInit() ?
    Which kind of things should be logically done inside on onInit() ?

  • Strange behavior.
    On MAc OSX (WEB IDE Linked to Ethernet ) since this morning I am not able to have a serial communication.
    But this may be a failure of the Mac.
    On the Windows side, ( WEB IDE not linked to Ethernet )no problems with communications using either the USB cable plugged or unplugged.
    The behavior is the same.
    SD card inserted, otherwise DISK_ERR is issued back.
    GOOD LCD display except col 0, row 0 position is shifted left when code is downloaded from Web IDE.
    Now after first and following resets ( with USB cable plugged )
    "oard OK… "
    2nd row good

    after several resets with USB cable unplugged the LCD begins to be be filled with garbages.
    Downloading the code from WEB IDE is always good .
    Javascript is straightforward in developing applications because it avoids the frequent compilation, debug , recompilation cycles usually done with C programming.
    Anyway it seems that is a little deficient with respect debugging.
    Is there a suggested way to perform debug in a better way for a JS beginner ?

  • Unable to understand what it happened since this morning .
    Nothing changed except plugging a board with a local require call on an Web IDE opened Internet connection.
    What I'll do, as it usually done for the "window blue screen error style" , is to install a new IDE version.
    This is the screenshot.


    1 Attachment

    • screenshot_570.png
  • Looks strange - It looks a lot like you're using some beta version of Chrome? Are you using the Web IDE from the app store?

    Looks like you're not initialising the LCD properly on onInit. Try:

    var lcd;
    var ON=1, OFF=0;
    function LCD_bckgnd(status,pin) { digitalWrite(pin,status); }
    function onInit() {
       var l=false;
       lcd = require("HD44780").connect(C5,C4,C0,C1,C­2,C3); <------ this
       LCD_bckgnd(ON,E7);
       lcd.clear();
      lcd.setCursor(0,0);
       lcd.print(" Board OK …");
       lcd.setCursor(0,1);
      lcd.print("Led1 blinking.");
      setInterval( function() { l=!l; LED1.write(l);},500);
    }
    
    onInit();
    

    or you could try executing it all 1 sec after bootup:

    var lcd;
    var ON=1, OFF=0;
    function LCD_bckgnd(status,pin) { digitalWrite(pin,status); }
    function onInit() {
     setTimeout(function() {
       var l=false;
       lcd = require("HD44780").connect(C5,C4,C0,C1,C­2,C3); <------ this
       LCD_bckgnd(ON,E7);
       lcd.clear();
      lcd.setCursor(0,0);
       lcd.print(" Board OK …");
       lcd.setCursor(0,1);
      lcd.print("Led1 blinking.");
      setInterval( function() { l=!l; LED1.write(l);},500);
     }, 1000);
    }
    
    onInit();
    

    The not running when you plug into USB has been covered here so many times I've lost count.

    But you've just done WAY too much stuff (custom compile, discovery board, beta chrome, your own SD card connector) for me to have any chance of helping you out properly I'm afraid.

  • Thanks a lot for your firm reply, considering that I am working on an unsupported board.

    I know that I changed a lot of things and I know that I must learn Javascript to a deeper level of detail before using it.
    I am just starting to learn it.
    It is powerful but I must keep my "Eyes wide shut" before using it.
    As you suggest I'll download the Chrome from the app store, even the one I used worked till this morning. This stuff is really new to me.
    I must just relax and take it easy before using Espruino in a production environment, even it is a really good design for the STFxx embedded systems.

  • OK
    The latest version of the WebIDE, as downloaded from the Web store , began to work again.
    It is evident that the fault is not due to Espruino.

  • Using the new WEB IDE version it is becoming clear what is going on …
    The previous version of the code is executed and takes precedence over the Web IDE code.
    The flash must be erased .


    1 Attachment

    • screenshot_572.png
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

COMMUNICATION INTERRUPTED WITH WEB IDE or SERIAL TERMINAL

Posted by Avatar for user6350 @user6350

Actions