P&E has released information and firmware instructions for using the OpenSDA, see pemicro.com/opensda. Future has posted a very useful article about using OpenSDA here. So time to upgrade OpenSDA bootloader and firmware v10.1. My FRDM-KL25Z board is a pre-production board, and I assume the production boards expected next week will have the new firmware on it. But it is always useful to know how to change/upgrade the firmware, as I expect there will be new versions of it in the future.
In the Freedom board, there is a Kinetis K20 (K20DX) which runs OpenSDA:
The OpenSDA is a firmware running on the K20 which runs a bootloader:
The bootloader is pre-programmed on the board, and is entered if pressing the SW1/Reset button on the Freedom Board. The booloader enumerates as MSD (Mass Storage Device, like a USB Memory stick). Using that bootloader different applications are programmed on the board. These OpenSDA applications are files with *.SDA extension.
Note: I believe the only way to change the OpenSDA Bootloader itself is using the JTAG connector for the K20, although I have not seen the sources or project for it. According to the Freedom production board pictures on Element14, this JTAG header is *not* populated on the board. But adding that JTAG header should not be a big deal if needed.
The P&E firmware includes two different applications:
- DEBUG_APP_*.SDA: this enables OpenSDA to act as a debugging interface (similar to what OSBDM does).
- MSD-<board>*.SDA: Application which turns the board into an MSD (Mass Storage Device, like a USB memory stick). This MSD application can be used to program different application to the target chip, see here. With this bootloader loaded, it is possible to program S19 files to the target processor. Element14 has published a set of such files here.
Downloading the new firmware
Downloading the new OpenSDA firmware package from the P&E OpenSDA site gives me these files:
As explained above, there is one generic debug SDA application, plus three MSD applications which allow me to program the target processor with S19 applications. The MSD applications depend on the target processor to be programmed.
Programming OpenSDA firmware
To program an new OpenSDA *.SDA application is simple:
- press the reset/SW1 button on the Freedom board while powering the board (plugging in the K20 USB connector).
- The green LED near the K20 starts blinking
- The K20 enumerates as MSD device and is named ‘Bootloader’:
- Simply drag&drop or copy the *.SDA application file to the Bootloader device to program it to the board:
- Re-power the board, and now the new SDA application is running
OpenSDA Debug Application
In case of the DEBUG_APP_*.SDA, the OpenSDA acts as a debug interface for example supported in CodeWarrior for MCU10.3. The beta is expected to be out very soon.
This applications enumerates as debug interface and offers a USB CDC mode:
The OpenSDA Debug connection is offered as a choice in the CodeWarrior New Project wizard:
Using the OpenSDA connection in the debugger is very similar to any of the P&E run control devices:
OpenSDA Application Bootloader
If using the OpenSDA MSD (e.g. MSD-FRDM-KL25Z_v103_Pemicro.SDA for the Freedom Board), then I can simply program S19 files to the target board. Element14 already has such S19 files available here:
Like above: press SW1 while power-on, and then simply copy the SREC file to the bootloader and reset the board. Simple as that :-).
I expect that there will be a growing community providing such SREC files. For sure I will offer my applications that way as well :-).