Espruino on STM32F4 discovery board #7525
Replies: 1 comment
-
Posted at 2020-10-16 by IvanJ I not mention that I use Win 7 64-bit. Posted at 2020-10-16 by pankleks Hello, I'm trying to flash firmware on popular "blackpill" board. @ivanj - how did you managed to flash firmaware? Posted at 2020-10-17 by IvanJ Hi did you find good .bin file for microcontroler on black pill board on Espruino download list of firmvers? Posted at 2020-10-17 by IvanJ When I mean good I mean right .bin file for this microcontroler on board. Posted at 2020-10-17 by @fanoush
Black Pill was always called this one https://stm32-base.org/boards/STM32F103C8T6-Black-Pill.html - a variant of blue pill. But you most probably mean these ones - two variants STM32F401 or STM32F411 EDIT: looks like there are even more of those boards - Posted at 2020-10-17 by IvanJ Hi Guys,
that it is note: also you need ST LINK drivers !!! I have problem with COM port on Espruino Web IDE, I can't connect my board with IDE Posted at 2020-10-17 by AkosLukacs Which web-ide you use? There is (at least) the in-browser version at https://www.espruino.com/ide/ You need to enable web-serial, and that requires a recent chrome-based browser (for example Edge and Vivaldi does work) There is the Chrome web app https://chrome.google.com/webstore/detail/espruino-web-ide/bleoifhkdalbjfbobjackfdifdneehpo (should work without any extra steps) And there is the native NWJS based app (that should also work without extra steps) Posted at 2020-10-17 by IvanJ hi [url=https://ibb.co/K66ycY8][img]https://i.ibb.co/6YYsc2q/pic-8.jpg[/img][/url] Posted at 2020-10-17 by IvanJ But Native is working I am so excited!!! Posted at 2020-10-17 by IvanJ I get it...this button in IDE with arrow pointing up is upload...ok Posted at 2020-10-17 by AkosLukacs Upload button in the middle! Attachments: Posted at 2020-10-17 by IvanJ Thanks! Posted at 2020-10-17 by pankleks I have board with STM32F411CEU6. Not sure which firmware to use -> I'm trying now with Posted at 2020-10-17 by pankleks Thank you @ivanj - I followed your steps, upload firmware via STM Cube went without any issues, installed Virtual COM, see COM7 (STMicroelectronics), but when I try to connect with putty or other terminal - there is nothing (no messages, no prompt). I'm currently doing all of this using UART (on PA9/PA10). Posted at 2020-10-17 by IvanJ When you open Putty just press Enter on keyboard and type Posted at 2020-10-18 by @fanoush
the board file for that fw is here https://github.com/espruino/Espruino/blob/master/boards/NUCLEOF411RE.py so it has serial console on pins a2,a3 virtual com is feature of onboard stlink debugger on the nucleo board so it won't work for your WeAct blackpill board, unless you have external stlink with virtual com too and connect it to pins a2,a3 Posted at 2020-10-18 by AkosLukacs Also, the Nucleo and Espruino boards (Original, Pico and Wifi) have an 8MHz xtal, the WeAct has a 25MHz, so the crystal frequency has to be changed / build tweaked. Posted at 2020-10-18 by @fanoush Had this board in drawer somewhere, haven't used it yet. So I took it, soldered SWD pins, flashed the nucleo fw and indeed it doesn't work, nothing on a2/a3. Then made a build of micropython from https://github.com/mcauser/WEACT_F411CEU6 and that one works fine so board is OK. Then I tried to change timing as per [this] board file Posted at 2020-11-12 by @fanoush Just an update about the WeAct board and negated pins - looks like stm32 port does not have support for negated pins. At least not in same way as nrf5x port. Anyway here is updated binary https://filebin.ca/5hFTUCKr4JA5/espruino_2v08.5_weactf411.bin where button and led works as expected - button skips startup code if held, LED is off at startup. The question about how to handle negated pins remains, should the (extra) nrf5x code be copied to stm32 port? To see more start here https://github.com/espruino/Espruino/blob/master/targets/nrf5x/jshardware.c#L966 and search for JSH_PIN_NEGATED. Similar stm32 code is here https://github.com/espruino/Espruino/blob/master/targets/stm32/jshardware.c#L1036 - check methods also visible on board file changes https://gist.github.com/fanoush/7553104fa7c8c596fe91f276d3f297fd/revisions is that there was other EDIT: fixed few more bugs and updated to latest Posted at 2020-11-13 by @gfwilliams Hi - yes, it probably makes sense to pull in the pin negation code. Maybe
Do you have other suggestions? If there's a better way of doing it I'd be interested.
Yes, that'll help with things like the bootloader/espruino bootup. It's used when declaring stuff like:
But while it works fine when used from the C code, it doesn't work when accessing pins themselves Posted at 2020-11-13 by @fanoush
Few ideas
So to sum it up I think making negated flag on pins completely invisible/transparent including pull up/down is too heavy and too much magic. Letting user know about it and possibly handle it could be better. An also maybe this should not be feature of the pin at all but something more high level - button, led. Posted at 2020-11-13 by @gfwilliams I'll all for ifdefing the code and maybe making it common...
And vibration, heart rate/etc on watches. I'd also considered making some boards with motor drivers and it might get used there if the drivers were inverting.
Yes - but also in Espruino's firmware as well.
This was added because beginners complained a lot about 'why does the LED go off when I do LED.set()' and so on... and you're the first person to complain the other way so far... I think a very high percentage of beginners wouldn't want their first command - However we could negate anyway, and it makes sense to expose the fact the pin is negated via
It's not that easy if we want to allow people do use While with 'virtual pins' we could handle it a little (at least for 'soft' PWM) that still requires a check inside Posted at 2020-11-13 by @fanoush
No, not complaining about this. This I would keep, but only this - inverting value. Not pull up/down. If you know what pin.setMode("input_pullup") means you can manage inverted flag and set it as pulldown yourself. beginners won't touch this, they will have their leds,buttons,motors already working. BTW are you inverting PWM duty cycle too? It was quite a surprise to me that in board file I must set pull the other way than it is for real, e.g. here https://github.com/espruino/Espruino/blob/master/boards/NRF52832DK.py#L70 it is in fact set as pullup! here I would really expect to set it like it really is.
Well , I don't know how hard it is to implement it. As for behavior - when using BTN1, LED1 object it should do the magic (with everything that makes sense for that type of object - digitalPulse/analogWrite), when using underlying pin directly it should not do this. That would be least surprising to me. E.g. I have one board (E104-BT5032A-TB) where buttons and leds are enabled by jumpers and are inverted, if I disable the jumper and use the pin on the header directly as is and refer it by pin number, I would expect the pin to be not inverted.
yes Posted at 2020-11-13 by @fanoush When thinking about it more, on one side it would be nice to e.g. add your own button or LED to e.g. MDBT42Q and do
currently those are only hardcoded. On the other hand the easiest method with just exposing inverted flag I can still have BTN1 and D27 to be same object and when I disconnect the jumper on that E104 board to use the pin directly I could flip the inverted flag to use pin as ordinary pin in sane way - e.g. as CS pin and pull it low by setting it to 0. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-10-16 by IvanJ
Hi to all.
I flash Espruino firmware on STM32F4 discovery board
with success. Also I installed Virtual COM port drivers with success
but I have problem to connect my board with Espruino Web IDE, I can't see
COM port of my board. What is the problem?
Thanks in advance
BR
IvanJ
Beta Was this translation helpful? Give feedback.
All reactions