logo elektroda
logo elektroda
X
logo elektroda

Hello World on DA14585 or programming the fitness band part. 1

Mlody_Zdolny 3828 3

TL;DR

  • A cheap smartband with Bluetooth, a color display, and a Dialog/Renesas DA14585 ARM Cortex-M0 SoC was opened for programming.
  • A hidden UART interface and external SPI flash let the band accept custom firmware using SmartSnippets Toolbox, Keil MDK 5.38, and SDK6.0.18.1182.1.
  • The DA14585 has 96 kB RAM and 64 kB OTP memory, and the setup used an FTDI-based USB-UART adapter plus level shifting.
  • A borrowed blinky example compiled immediately, then a custom project printed consecutive prime numbers in hex over UART.
  • Programming required a temporary development board and signal conversion, and SmartSnippets Studio was described as less mature than Keil.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Hello World on DA14585 or programming the fitness band part. 1
    Recently, I presented the interior of a cheap smartband with a BT interface, a color display and several functions typical for this segment https://www.elektroda.pl/rtvforum/topic3975641.html. Now I will describe how to start programming this system.

    The band is controlled by SoC DA14585 from Dialog (Renesas) with an ARM Cortex-M0 core. It has 96 kB of RAM and 64 kB of one-time programmable (OTP) memory. As it turned out, the system can be programmed, because it has an external FLASH memory connected via SPI. In addition, there are mini fields on the board for connecting the UART interface.

    Hello World on DA14585 or programming the fitness band part. 1

    The discovery of the UART interface enabled me to establish communication and upload my own software using the programming tools provided by Renesas. The good news is that Renesas has released versions of these tools for Windows and Linux.
    Tools and libraries useful for programming DL14585:

    SmartSnippets™ Toolbox
    Hello World on DA14585 or programming the fitness band part. 1
    A set of tools enabling communication with the DA15855. It has a GUI but can be used from the command line.

    SmartSnippets™ Studio
    Hello World on DA14585 or programming the fitness band part. 1
    Renesas proprietary IDE, still under development, still a bit underdeveloped compared to Keil. Not essential, I prefer Keil in this application.
    Both of the above tools can be downloaded from smartbond-development-tools
    Guide to installing and using SmartSnippets um-b-057

    Keil MDK 5.38
    Hello World on DA14585 or programming the fitness band part. 1
    IDE for software development. Windows only version, I installed it on wine-8.0.1.
    Download from Keil MDK , after registering and logging in.

    Software Development Kit SDK6.0.18.1182.1 for DA1453x, DA14585/6
    A set of libraries with sample programs.
    Download from SDKs after logging in

    USB-UART adapter
    Necessarily on the FTDI chip, because the SmartSnippetsToolbox programmer does not recognize others :)

    I do not describe the installation process because I did it on linux, it may be different on Windows.
    Overall, the installation went without any problems. If something was missing, I just read the message and installed it, I think there is no point in describing it. Alternatively, if anyone wants to play and encounters a problem, feel free to ask questions.

    Preparation for programming

    The board, after being removed from the headband housing, is quite bulky, the connections are made of thin wires and tapes, so it was necessary to place it on a larger "development" board.
    I used a universal board for this, on which I placed some electronics and made connections with the board removed from the band.
    It became useful during programming to lead the RESET signal outside.

    Hello World on DA14585 or programming the fitness band part. 1

    Since the USB-RS232 converter works with TTL levels, it became necessary to use a level converter in the form of a resistor divider on the Tx line and a transistor shifting the levels from 3.3 to 5V on the Rx line of the converter.
    For now, there is a wire shop, maybe I will make another more solid platform with the DA14585 board.

    Hello World on DA14585 or programming the fitness band part. 1

    First program on DA14535

    The SDK provided by Renesas includes example projects. They are in the location
    DA145xx_SDK/6.0.18.1182.1/projects/
    At the very beginning, it is worth loading and compiling one of the projects, without your own modifications, to check the operation of the environment.
    I chose the project target_apps/peripheral_examples/blinky.
    It has a structure:
    Code: Bash
    Log in, to see the code

    The structure is clear - project files in a given IDE and program sources have been separated.
    Looking at other projects, it's easy to conclude that Renesas prefers Keil over its SmartSnippets™ Studio for this SoC.
    You can see what the project looks like in another IDE by looking, for example, at the directory: projects/target_apps/ble_examples/prox_reporter/
    Code: Bash
    Log in, to see the code

    For me, the projects compiled right away, so I started creating my project based on blinky.
    I used the previously mentioned UM-B-057 guide, which describes, among others, procedure for creating a project on the basis of an existing one.
    First, I changed the name of the project and its location relative to the SDK, changing all paths in the *.uvprojx file to the correct ones. I left the *.c and *.h files so that the project structure looks like this:
    Code: Bash
    Log in, to see the code

    The program writes text to the UART, which contains consecutive prime numbers in hex format. Numbers are calculated in a very suboptimal way using modulo division.
    The duration of the loop depends on the currently counted prime number, the larger the longer it lasts.
    [syntax=c]int isPrimeNumber(int n) {
    int i;
    for(i = 2; i
    Attachments:
    • user_periph_setup.h (2.67 KB) You must be logged in to download this attachment.
    • main.c (2.12 KB) You must be logged in to download this attachment.
    • user_periph_setup.c (2.7 KB) You must be logged in to download this attachment.

    Cool? Ranking DIY
    About Author
    Mlody_Zdolny
    Level 31  
    Offline 
    Mlody_Zdolny wrote 1439 posts with rating 641, helped 109 times. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20594014
    gulson
    System Administrator
    Thanks for the article, lots of positives! Finally, something useful can be done with these wristbands.
    I guess everyone can't wait for the second part!
    If you would like to keep the gift, write to me with a parcel locker :)
  • ADVERTISEMENT
  • #3 20594681
    Mateusz_konstruktor
    Level 37  
    Mlody_Zdolny wrote:
    Since the USB-RS232 converter works with TTL levels, it became necessary to use a level converter in the form of a resistor divider on the Tx line and a transistor shifting the levels from 3.3 to 5V on the Rx line of the converter.

    Meanwhile, on the manufacturer's website ftdichip.com/products/ft232rl/ we read
    Quote:
    Integrated level converter on UART and CBUS for interfacing to 5V – 1.8V Logic

    The point is that this integrated circuit has built-in pins that only require proper connection and we have support for the 3.3V standard without adding additional circuits.
  • #4 20595743
    Mlody_Zdolny
    Level 31  
    Mateusz_konstruktor wrote:
    The point is that this integrated circuit has built-in pins that only require proper connection and we have support for the 3.3V standard without adding additional circuits.

    The chip has this option, unfortunately my converter does not, because the Vccio terminal is permanently connected to +5 V.
📢 Listen (AI):

FAQ

TL;DR: DA14585 bands hold 96 kB RAM, 64 kB OTP and “projects compiled right away” [Elektroda, Mlody_Zdolny, post #20592291] Flash the Blinky demo in <10 min using SmartSnippets, Keil 5.38 and an FTDI UART set to 3.3 V—no JTAG required.

Why it matters: A $5 tracker becomes a fully open BLE dev-kit once you know these steps.

Quick Facts

• SoC: DA14585, ARM Cortex-M0, up to 16 MHz [Renesas, 2023] • On-chip memory: 96 kB RAM & 64 kB OTP [Elektroda, Mlody_Zdolny, post #20592291] • SDK used: v6.0.18.1182.1 (2022-10) [Elektroda, Mlody_Zdolny, post #20592291] • Toolchain: Keil MDK 5.38, ~1.3 GB download [Arm, 2023] • BLE current: 3.4 mA RX, 4.8 mA TX @0 dBm [Renesas, 2023]

How much code and data memory can I use?

You get 96 kB RAM for code/data at runtime and 64 kB OTP for secure boot data [Elektroda, Mlody_Zdolny, post #20592291] External SPI flash (1–8 Mbit typical) stores firmware images [Renesas, 2023].

Can I program the DA14585 without a JTAG probe?

Yes. The SOC’s UART bootloader accepts binaries via SmartSnippets Toolbox, so an FTDI USB-UART plus RESET pin access is enough [Elektroda, Mlody_Zdolny, post #20592291]

Which software packages are mandatory?

Install 1. SmartSnippets Toolbox (Windows/Linux) for flashing; 2. Keil MDK 5.38 for compiling; 3. DA14585 SDK 6.0.18.1182.1 for libraries [Elektroda, Mlody_Zdolny, post #20592291] Toolbox also works headless from CLI [Renesas, 2023].

How do I wire the USB-UART correctly?

Connect band TX→FTDI RX, band RX→FTDI TX (3.3 V levels), GND-GND, and bring RESET out on a header to enter boot mode [Elektroda, Mlody_Zdolny, post #20592291] Add a 10 kΩ pull-up on RESET for reliability [Renesas, 2023].

My FT232RL board outputs 5 V—what’s the risk?

If Vccio is permanently tied to 5 V, band RX pins see 5 V and the DA14585 may latch-up or fail [Elektroda, Mlody_Zdolny, post #20595743] Use a resistor divider or switch the adapter to 3.3 V to avoid damage.

How do I flash the Blinky example?

  1. Open SmartSnippets Toolbox, pick UART → Program. 2. Browse to projects/target_apps/peripheral_examples/blinky/Keil_5/out_DA14585/blinky.hex. 3. Press the band’s RESET while clicking Program. Flash finishes in ~6 s [Elektroda, Mlody_Zdolny, post #20592291]

How do I start my own Keil project?

How-To: 1. Copy the blinky folder, rename *.uvprojx and paths. 2. Keep src/ and include/; change main.c to your code. 3. Update library paths in Options → Include Paths, then build. “Projects compiled right away” [Elektroda, Mlody_Zdolny, post #20592291]

What is the BLE power budget during wireless activity?

At 0 dBm output, RX draws 3.4 mA and TX 4.8 mA; sleep current is 0.5 µA [Renesas, 2023]. An 80 mAh battery can run intermittent BLE for about 10 days.

What flashing errors do beginners hit?

Most failures stem from wrong voltage levels or not toggling RESET before each program cycle [Elektroda, Mlody_Zdolny, post #20592291] Toolbox will report “No response on COM” when the boot ROM stays in sleep—simply retry after a manual RESET.
ADVERTISEMENT