Tiny wearable with stm32f401

Posted on
  • Hi, just wanted to say I am working on implementing Espruino into a wearable platform. It will be based on the stm32f401. However, I have had some problems getting its discovery board to work with the F4 firmware. I guess the 401 is too different from the 407.

  • What kind of problems? I'm quite interested in the F401 so I'd like to know what you encountered.

    Maybe you could try connecting a USB-TTL connector to USART1 (or USART2 if you based the config on the F4Discovery board). While trying the F429discovery I found that USB wasn't working, but it was still communicating fine over serial.

  • Also, any chance you could contribute a .py file for the 401Discovery board?

  • Sure. I put it on https://github.com/FyberLabs/Espruino/co­mmit/6a8875e7a6ab482fef43d2864f707a5906e­f3381 . It isn't clean since the Makefile is still set to build it and I am still having problems connecting USB. I am trying to use an FTDI serial to connect it.

  • Another thing I am a bit unclear on. My new csv has one less column, but it appears to need the same offsets in the board file as the regular F4 to compile. Otherwise it complains about not finding SPI4 which is part of the first pin definition.

  • I can confirm USB-TTL isn't working. It works fine on the F4. The F401C has the same USB conflict pins, so it needs serial on USART2 too. I assume there is something wrong with my CSV file.

  • I declared SPI4 which was causing problems. I think the CSV file is working now, still no USB or serial function. What is the source of the target libraries? They seem similar but a very different layout and much older than the current STM32Cube libraries.

  • Thanks!

    With the columns: in the .py file, scan_pin_file has some offsets as arguments. I guess it'd be nice if it worked them out from the CSV headings really...

    Glad it's actually working though - if the serial is working at 9600 baud it means all the clock divisors are right too.

    So I'd take a look at https://github.com/espruino/Espruino/tre­e/master/targetlibs/stm32f4/usb and https://github.com/espruino/Espruino/tre­e/master/targetlibs/stm32f4/usblib and try and compare them with ST's examples for the F401. My guess is there's something a bit different in the USB initialisation.

    It's quite likely it's to do with 'USB disconnect' - there's usually a resistor that connects one of the USB data lines to 3.3v (which signals that there's a USB device on the line). The F4 appears to have that built-in, so there might be some problem activating it.

    The good news is once that is fixed, the F429 discovery will probably spring into life too!

  • Well the F401C isn't talking. Are the ST sources you have for F4 from an old version of the STM32Cube? All of the new source looks quite different and the USB host and device files are not very similar at all.

  • As far as I know, STM32Cube was announced about a week ago, so it's not from that :(

    Try this - it looks very similar to me: http://www.st.com/web/en/catalog/tools/P­F259428# - specifically in /STM32F401-Discovery_FW_V1.0.0/Libraries­/STM32_USB_Device_Library/

  • Thanks, yeah it is NRND. There was a significant amount of changes, I just merged the peripheral library on top of your old one. Mixed some things and now the F401C is talking on serial. I'll try merging in the new USB as well.

  • A couple more notes: The F401C does not have TIM7, so I moved UTIL_TIMER to TIM5 and the 3 USARTS also are spaced out - 1,2,6. I modified platform_config.h after initial build, so that needs to be fixed better. Still working on USB.

  • First post! I would like to know if by any chance the F401 has been ported yet??? I have a STM32F401C-DISCO board and would like to try the ESPRUINO on it.


  • I'm not sure - @FyberChris has a git repo here: https://github.com/FyberLabs/Espruino

    But it might be that it still doesn't support USB... @FyberChris?

  • @FyberChris did you ever have any luck with getting USB comms working?

  • Sorry, I have been busy working on hardware for the past couple of months. I spent some time trying to merge Espruino settings with the newer libraries, but no results. It looks doable. I'll try to work on it in the next couple of weeks as it is needed for our projects.

  • @FyberChris I actually had some luck with this on wednesday... I'll update GitHub with it at some point soon.

  • I have put the initial hardware up on Hackaday for feedback - http://hackaday.io/project/2236-Flex-Mod­ules . I am still working on board quality issues, but I think it is coming along.

  • Wow, that looks really neat. Amazing how much time you've spent documenting it on the hackaday site as well!

    It's a really cool idea putting solid modules on flexi PCB... Is there a nice way of making your own flexi PCB now? I've seen Adafruit selling something that looks promising... I guess home-etching a circuit drawn with a marker pen may actually work just fine...

  • I home etch using laser jet toner on glossy magazine paper. Laminating is easier since the board itself is much thinner. I'll be putting up a how-to, but it is the same as etching FR4.

    I have been working mostly with a 1960s material called Electroply (it was the only flexPCB available on ebay at the time). It is much thicker and robust than Kapton copper clad. Both have good uses for wearables. I have been trying to get a real source for something like a PET based flexible copper clad as that should be similar to the Electroply. If we do a kickstarter, I will budget for a kit which includes a large sheet of Kapton at least. It is expensive stuff and it is great Adafruit is selling it (ebay is still cheapest usually). Dupont only sells it in big rolls. Another alternative is silver deposition - http://www.cartesianco.com/product/the-a­rgentum/ .

    We are also using low temp solder paste - http://www.chipquik.com/store/prod_smdlt­fp.htm to attach the modules.

  • We have some Flex Module prototypes for sale at our new Tindie store. We will be releasing more Flex Modules and demo projects utilizing them. We have STM32F401CC and STM32F411CC modules available (they have the same pin layout). The STM32 Flex Module along with the USB BiPower3.2 Flex Module provide USB connectivity.

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

Tiny wearable with stm32f401

Posted by Avatar for FyberChris @FyberChris