Reemplazando el firmware ST-Link por J-Link en las placas de desarrollo de ST

A la hora de iniciarse en el desarrollo de STM32, las placas de desarrollo Nucleo y Discovery de ST son bastante baratas, e incluyen un debugger en la propia placa (ST-Link) bastante aceptable en términos de velocidad y funcionalidad. Para la mayoría de proyectos es más que suficiente, sin embargo, existen en el mercado programadores externos más avanzados. Estos se suelen distinguir en cuanto a velocidad, soporte técnico, interfaces de comunicación, o herramientas añadidas (seguimiento de trazas, análisis de memoria, etc.).

Entre estos programadores, unos de los más conocidos son los J-Link de Segger. Estos programadores tienen un precio algo elevado (salvo la versión EDU, que no permite uso comercial). Sin embargo, cuando se usan para debuggear micros STM32 en las placas de desarrollo, ofrecen un firmware que sustituye el presente en el debugger de estas placas y que aporta la mayoría de funciones de sus programadores. 

jtrace
Programador J-Trace de Segger.

Sobre el ST-Link, aporta sólo algo más de velocidad, pero tiene mucho mejor soporte software. Esto es especialmente interesante cuando se programan algunas versiones de los Cortex M7 (r0p0 y r0p1, como el STM32F746ZG), ya que tiene implementado algunos workarounds que facilitan el debugging de estos cores (info). Por otro lado, cuando se desarrolla sobre FreeRTOS, funciona bastante mejor el soporte de thread awareness en el depurador que el que proporciona OpenOCD. 

Para ponerlo en marcha:

  1. Reemplazar el firmware del ST-Link. En la página de Segger, se puede descargar la herramienta que permite cambiar y restaurar el firmware del ST-Link. En caso de restaurarlo, es conveniente actualizarlo mediante las herramientas de ST a la ´última versión.
  2. Instalar el paquete software de Segger.
  3. Para añadir el soporte a System Workbench:
    1. Añadir el repositorio que aparece aquí a Eclipse e instalar GNU MCU C/C++ J-Link debugging, mediante Help->Install New Software.
    2. En las opciones de Eclipse, en la categoría MCU, ajustar las rutas al paquete software, tanto en la categoría global como workspace (capturas aquí).
  4. Para añadir la configuración de depuración al proyecto:
    1. Crear una nueva en la categoría GDB SEGGER J-Link debugging. En la pestaña Debugger hay que hacer unos cambios:
      1. En Device name añadir el nombre del micro (p.e. STM32F746ZG).
      2. A la hora de depurar, si saltase un fallo al ejecutar gdb –version, buscar manualmente el ejecutable en el cuadro de GDB Client Setup, por el de la toolchain. Un path de ejemplo puede ser C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.15.0.201708311556\tools\compiler\bin\arm-none-eabi-gdb.exe
        gdbconf
    2. Lanzarla manualmente (a veces System Workbench tiende a ejecutar la de ST-Link al pulsar F11 o el icono).

debugConf

Como apuntes adicionales, si se usa freeRTOS se puede cargar el plugin de thread awareness añadiendo “-rtos GDBServer/RTOSPlugin_FreeRTOS” al campo  Other options:  en la pestaña Debugger, sección J-Link GDB Server Setup.

thread awareness
Soporte thread awareness en Eclipse.

TFG: Design and development of a reliable routing protocol for Wireless Sensor Networks

Wireless Sensor Networks, or WSN, is one of the most promising fields of research when talking about Information Technology, as its use and deployment is extended in developing projects related to Internet of Things.

WSN are composed by multiple wireless tiny sensor nodes called motes, which are equipped with a microcontroller and some sensors capable to measure physical data of the parameter to be monitored. They also feature one or several radio antennas, meant to share the gathered data with the rest of the sensor nodes in the network.

Many projects have been developed using WSN, all of them with the common characteristic of the need of sharing data among nodes. This is achieved by the implementation of a network protocol on the nodes.

Different research lines have been followed and scientific papers have been published related to the field of WSN network protocols, most of them focused on the creation of algorithms and theoretical work rather than on field implementation and actual deployment of the network protocol on physical nodes.

multihop
Multihop packet sending between nodes on WSN

The final objective of this thesis is the development of a realiable routing protocol for WSN, which is meant to establish routes among the nodes which later will be used as paths for sending and receiving data. It will be ready to use for stablishing networks on any project based on WSN developed by the B105 Electronic Systems Lab Research Group, regardless of its application or purpose. Multihop will be one of the main features on this routing protocol.

This protocol has been designed to be reliable, customizable and adaptable to the different needs a WSN developer may have. Its code is portable to different motes, and has been developed as a process running within the FreeRTOS operating system, which is node sensor oriented. Besides, the Contiki netstack, Rime, and its customized layer of communication services provided by the B105 Electronic Systems Lab, have been the main sources of primitive communication modules used on the development of this routing protocol.