STM32F4 Discovery board - save() no longer works

Posted on
  • it appears that I can no longer save a program on my Discovery board. I can Send a program to the board and it starts to run and the program works, and I write save(); and when I press ENTER it seems that the program is being written, as I see the "Erasing Flash.. and Programming 109000 Bytes... Checking... Done!
    and then it shows the
    Running onInit()...
    as expected, and my program still works. but if I unplug power and try to run the program with or without connection to a computer, there is nothing. the program does not appear to have been saved.
    this used to work. I am using the latest web ide and the latest nigthly (1v51 it says).
    I have not tried to go back to an earlier version. I wonder if I am doing something wrong, but my programs used to run standalone after being saved()

  • It might be worth trying an earlier version just to rule it out - however if the board comes back and works after you type save() then it looks like it may still be working.

    When you plug your board back in and type load() what happens?

    Is it just that you are using BTN1's pin for something and it is pulled high? That's been a problem before. BTN1 is usually used as a safety net - when held down at startup it stops Espruino loading the saved code (in case what you wrote to Espruino stopped it from working).

  • Thank you! I had connected a 4*20 serial LCD display to A0 (UART4TX) which also is labeled BTN1. After moving the wire to C6 (USART6TX) and changing Serial4 to Serial6 it works fine. I can now unplug the STM2F4 Discovery board and when I power it up from an external source or a computer it works as expected.
    During my troubleshooting I first tried the suggestion to type load(); after powering up and found that the simple Rotaryencoder program would start working after I pressed Enter, so apparently the programs are saved after typing save(), but they would not load at power up if I had my display connected to A0 pin. I am using a simple level translator for the display communication, as it has a 5V controller. the level translator consists of an npn transistor with base connected to 3V through an 18k resistor, emitter to the Discovery TX pin and collector to the display RX pin, with anohter 18k pullup resistor to 5V of the Discovery. this will give 5V swing on the display signal while the Discovery pin only swings 3V. Just in case someone is interested in a simple level shifter. Another simple circuit that works is to use a small diode 1N4148 from RX to TX, still need the pullup to 5V on the display. This gives about 0.6V to 3.6V on the display RX pin which in most cases works, even if the worst case may require 4V for a high level.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

STM32F4 Discovery board - save() no longer works

Posted by Avatar for tage @tage