Flashing NuttX on Viewtool STM32F107 board

Yesterday I received a Viewtool STM32F107 board V1.2 from ebay:
www.ebay.com/itm/250893674758?_trksid=p2055119.m1438.l2649

Unfortunately this board doesn’t have a built-in programmer (well, I didn’t test DFU mode), then I decided to use the st-link v2 programmer:
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=400581128094

It was easy to connect the st-link programmer to viewtool because it use SWD interface. Only three wires were needed:

ST-Link V2    Viewtool JTAG connector
GND ---------------- GND
CLK ---------------- TCK
IO  ---------------- TMS

Now it is time to compile NuttX to Viewtool board, it is also very easy because NuttX has native support to this board. Then I just configure NuttX profile to viewtool/nsh and selected the Build option to “Raw binary” (default is Intel HEX format).

The compilation was fine and generated the nuttx.bin file. Then I just use this procedure to flash NuttX on viewtool: https://acassis.wordpress.com/2014/01/13/using-a-stm32f4discovery-board-to-flash-stm32f100rb-from-stm32vldiscovery/

Important: You need to remove the USB/Serial module from USART1 otherwise it will interfere in the SWD initialization. Keep the board powered only by miniUSB connector, then openocd wil get control correctly using st-link_v2 interface.

6 thoughts on “Flashing NuttX on Viewtool STM32F107 board

  1. HI Alan,

    got your details on the Spark Core forum. I am trying to get Nuttx onto a Spark but not having any success.

    have cloned nuttx from git, built the buildroot and built the standard configs nsh, composite, usbserial and usbnsh successfully.

    I am flashing using dfu-util on ubuntu 13.10 and it goes through but after flashing the spark remains in DFU mode with led flashing green, any suggestions?

  2. Hi Andre,
    I think it still in DFU mode because it didn’t find the firmware at right position to start up.

    Try to flash nuttx this way:
    $ sudo dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D nuttx.bin

    You will need dfu-util 0.7, the default dfu-util version on Ubuntu is 0.5.

    Note: maybe you will need to replace your device/product to “-d 1eaf:0003” as explained in the README.txt file, use lsusb to verify.

    Any issue, please let me know.

    1. Hi Alan,

      Thanks for the quick response, especially on a Sunday. Some more info…

      lsusb device info: Bus 006 Device 007: ID 1d50:607f OpenMoko, Inc.

      Command used to flash: sudo dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D nuttx.bin

      Version of dfu-util 0.7 not the standard 0.5 of ubuntu…

      I think it has something to do with the size of the .bin files. Most of my vary from 106k to 120k, which i believe is at or beyond the limit of the flash size.

      The native Spark firmware images generated are < 70k and they flash and execute perfectly.

      Maybe the starting point should be absolute basic defconfig and make.defs files, just to get a compile working with nsc functionality over the serial console.

      For a start I do NOT need any FAT filesystem, no access to the 2MB flash, and USB maybe only for debugging?

      Andre

      1. Hi Andre,
        I just send you a firmware I compiled now. Please test it and let me know if it worked to you.

        I think the size is not be issue, because if the firmware was bigger than SparkCore flash the compilation should abort and also the dfu-util should report it.

        BR,

        Alan

  3. Hello Alan

    I have a viewtool board also, but its STM32F103CT6. I want to port the .NETMF into it. Do you have any idea how do this, or if its even possible?
    best Regards,
    Enrique

    1. Hi Enrique,
      No, I never used .NETMF and have no plans to use it. NuttX all I need to my project and I also can run Lua and MicroPython inside NuttX. BR, Alan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s