Adsense HTML/JavaScript

Wednesday, June 15, 2016

my new board, NUCLEO-F401RE

NUCLEO-F401RE





Microcontroller features

  • STM32F401RET6 in LQFP64 package
  • ARM®32-bit Cortex®-M4 CPU with FPU
  • 84 MHz max CPU frequency
  • VDD from 1.7 V to 3.6 V
  • 512 KB Flash
  • 96 KB SRAM
  • GPIO (50) with external interrupt capability
  • 12-bit ADC with 16 channels
  • RTC
  • Advanced-control Timer
  • General Purpose Timers (7)
  • Watchdog Timers (2)
  • USART/UART (4)
  • I2C (3)
  • SPI (3)
  • SDIO
  • USB 2.0 OTG FS

Board features

  • Two types of extension resources
    • Arduino Uno Revision 3 connectivity
    • STMicroelectronics Morpho extension pin headers for full access to all STM32 I/Os
  • On-board ST-LINK/V2-1 debugger/programmer with SWD connector
    • Selection-mode switch to use the kit as a standalone ST-LINK/V2-1
  • Flexible board power supply
    • USB VBUS or external source (3.3 V, 5 V, 7 - 12 V)
    • Power management access point
  • User LED (LD2)
  • Two push buttons: USER and RESET
  • USB re-enumeration capability: three different interfaces supported on USB
    • Virtual Com port
    • Mass storage (USB Disk drive) for drag'n'drop programming
    • Debug port


Tuesday, June 14, 2016

System Workbench for STM32 - a Free IDE for STM32 Microcontroller

The System Workbench toolchain, called SW4STM32, is a free multi-OS software development environment based on Eclipse, which supports the full range of STM32 microcontrollers and associated boards.

The SW4STM32 toolchain may be obtained from the website www.openstm32.org, which includes forums, blogs, and trainings for technical support. Once registered to this site, users will get installation instructions at the Documentation > System Workbench page to proceed with the download of the free toolchain.

The System Workbench toolchain and its collaborative website have been built by AC6, a service company providing training and consultancy on embedded systems.

This product is supplied by a third party not affiliated to ST. For the latest information on the specification, refer to the third party’s website: www.ac6.fr.

Key Features
  • Comprehensive support for STM32 microcontrollers, STM32 Nucleo boards, Discovery kits and Evaluation boards, as well as STM32 firmware (Standard Peripheral library or STM32Cube HAL)
  • GCC C/C++ compiler
  • GDB-based debugger
  • Eclipse IDE with team-work management
  • Compatible with Eclipse plug-ins
  • ST-LINK support
  • No code size limit
  • Multiple OS support: Windows® , Linux and OS X®

source: www.st.com



Install System Workbench for STM32 on Ubuntu GNOME 16.04 (run on VirtualBox)

Before install System Workbench for STM32, java is needed to be installed. Enter the command:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer


Fow Linux 64-bit, it is install_sw4stm32_linux_64bits-v1.8.run currently.

Accessing OpenSTM32.org is free, but you need to be logged in to have access to some parts of the site, like the System Workbench for STM32 documentation and download instructions.

For Ubuntu 64-bit, download the external tools with command:
$ sudo apt-get install libc6:i386 lib32ncurses5

To launch the installer in GUI mode, gksudo must be installed:
$ sudo apt-get install gksu

Then run the downloaded installer (install_sw4stm32_linux_64bits-v1.8.run); switch to the download folder, make it executable, run it and follow the steps:
$ ./install_sw4stm32_linux_64bits-v1.8.run

Check for update after finished.

~ Document of System Workbench for STM32



Monday, June 13, 2016

ST-Link/V2-1 driver on Linux

The ST-Link/V2-1 is supported by libusb but the device has to be named with a udev rule.

Download the following tarball which contains 49-stlinkv2.rules
- stlink_udev_rule.tar.bz2

# stm32 discovery boards, with onboard st/linkv2
# ie, STM32L, STM32F4.
# STM32VL has st/linkv1, which is quite different

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", \
    MODE:="0666", \
    SYMLINK+="stlinkv2_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
    KERNEL!="sd*", KERNEL!="sg*", KERNEL!="tty*", SUBSYSTEM!="bsg", \
    MODE:="0666", \
    SYMLINK+="stlinkv2_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
    KERNEL=="sd*", MODE:="0666", \
    SYMLINK+="stlinkv2_disk"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
    KERNEL=="sg*", MODE:="0666", \
    SYMLINK+="stlinkv2_raw_scsi"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
    SUBSYSTEM=="bsg", MODE:="0666", \
    SYMLINK+="stlinkv2_block_scsi"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
    KERNEL=="tty*", MODE:="0666", \
    SYMLINK+="stlinkv2_console"

# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and control access using standard unix groups.

Extract the tarball into /etc/udev/rules.d under root permission
$ sudo tar -xf stlink_udev_rule.tar.bz2 -C /etc/udev/rules.d

source: http://www.openstm32.org/Installing+System+Workbench+for+STM32+from+Eclipse
(may be you have to register and login to access the page)



Sunday, June 12, 2016

Install STM32CubeMX on Ubuntu


STM32CubeMX is part of STMicroelectronics STMCube™ original initiative to ease developers life by reducing development efforts, time and cost. STM32Cube covers STM32 portfolio.

STM32Cube includes the STM32CubeMX which is a graphical software configuration tool that allows generating C initialization code using graphical wizards.

Key Features

- Intuitive STM32 microcontroller selection
- Microcontroller graphical configuration:
  • Pinout with automatic conflict resolution
  • Clock tree with dynamic validation of configuration
  • Peripherals and middleware functional modes and initialization with dynamic validation of parameter constraints
  • Power sequence with estimate of consumption results
- C code project generation covering STM32 microcontroller initialization compliant with IAR™, Keil™ and GCC compilers.
- Available as a standalone software running on Windows, Linux and OS X operating systems, or through Eclipse plug-in

This video show how to download, install and run STM32CubeMX, to generate C initialization code for NUCLEO-F401RE development board with STM32F401RET6 (ARM 32-bit Cortex-M4 CPU with FPU).



To install STM32CubeMX:
Switch to the downloaded folder, enter the command:
$ java -jar SetupSTM32CubeMX-4.15.1.exe

To run STM32CubeMX:
Switch to the installed folder, enter the command:
$ java -jar STM32CubeMX

Setup Eclipse with GCC ARM Embedded on 32 bit Ubuntu 16.04 i386

As I have a NUCLEO F401RE Development Board on the way, I try to setup Eclipse with GCC ARM Embedded on Ubuntu 16.04/VirtualBox. It's not my target development platform, just to evaluate Eclipse + GCC ARM Embedded, so I setup on VirtualBox. No flash program will be included.


In the beginning, I tried to do it on 64 bit Ubuntu, but found something wrong in the compiler, such as "Type 'uint32_t' could not be resolved"! I found many suggestion on Internet, but no perfect solution. Then I tried on 32 bit Ubuntu 16.04 i386. It can compile the example code without any problem.

- Ubuntu 16.04 come with gcc, g++ and make installed by default.

- To install Eclipse, jdk is required. To install Oracle Java 8 on Ubuntu, enter the commands:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

This video show how to, but on 64 bit Ubuntu (same procedure):


- Install Eclipse IDE for C/C++ Developers:
Visit http://www.eclipse.org/ to download the 32 bit Eclipse Installer


- Download GCC ARM Embedded
https://launchpad.net/gcc-arm-embedded/+download


- Add GNU ARM Plug-ins to Eclipse IDE
http://gnuarmeclipse.sourceforge.net/updates


- Finally, you can try to new a ARM project in Eclipse
You have to enter the path to the "Cross GNU ARM Toolchain", it's the bin folder of the GCC ARM Embedded downloaded before.



Thursday, June 9, 2016

CoIDE - Free IDE for ARM Cortex-M Design

CooCox CoIDE is a free integrated development environment focusing on ARM Cortex-M0/M0+/M3/M4 based microcontrollers. It uses GCC (GCC-ARM-Embedded) tool chain, and is based on Eclipse, but has been customized and simplified to give users a minimalism experience. With Git - a powerful code component sharing and collaborative cloud platform - integrated, over 800 code components are within easy reach, allowing users to implement programs simply by stacking up building blocks.
  • Free
  • Based on Eclipse and GCC tool chain, a number of mainstream Cortex-M based MCUs are supported
  • Customized and simplified, extremely easy to get started
  • Component-oriented development method for you to get most out of the reusable code
  • Allows rapid prototyping like stacking up building blocks
  • Code component sharing and collaborative cloud platform based on Git for friction-less collaboration
  • Over 800 free and open code components available
- Note : Don't forget to configure the GCC toolchain after installation . See: Compiler Setting
GCC ARM Embedded: Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors (Cortex-M0/M0+/M3/M4/M7, Cortex-R4/R5/R7)