Programming the DA14531 TINY with STM32/Arduino

Learn MoreFAQsTutorials

10 posts / 0 new
Last post
simonlasnier
Offline
Last seen: 6 days 7 hours ago
Joined: 2020-07-20 10:37
Programming the DA14531 TINY with STM32/Arduino

Hi :) 

I just discovered both the product and this company, and it looks very promising! I have a project/product which needs bluetooth and I decided to go with the DA14531 TINY instead of the ESP32 :) Thank you for the opportunity, and looking forward to using the product!

I bought the TINY module but I was wondering if there was an easy way to program it (over SWD f.x.) using either an Arduino or an STM32. I have for example many STM32 programmers, which also use SWD, so what I was looking for a ready-made code/binary which I can upload either on the arduino or the STM32, which will then communicate with an IDE (or any software really) on my computer to program the module?

Thank you!

Simon

PM_Dialog
Offline
Last seen: 2 days 6 hours ago
Staff
Joined: 2018-02-08 11:03
Hi simonlasnier,

Hi simonlasnier,

Thanks for your question and for posting on our public BLE forums.  Would it be possible to share a high level of your application? Are you planning to use the TINY module as the basic microcontroller, or use together with another MCU?

In order to program the module you can use either JTAG or the 1-wire UART interface (P0_5). In case of JTAG, you can use any of our Development Boards or any external JTAG interface.   In case of 1-wire UART interface (P0_5), you should reset the DA14531. This can be achieved by cycling power to the module or by using the RST input (active High).​

Especially for the TINY, you can also use the Dialog Smartbond Flash Programmer for Windows OS in order to program the on-module SPI flash.

In the TINY module and DA14531 product page, you will find all the available documentation SW examples and HW collaterals you need to get started with Dialog products.

There also reference designs available that you will help you to reduce the developing stage, as you don’t need to spend so much time in developing your application code.

https://www.dialog-semiconductor.com/products/connectivity/bluetooth-low-energy/products/da14531

https://www.dialog-semiconductor.com/products/bluetooth-module-da14531-smartbond-tiny

CodeLess

The CodeLess allows you to quickly get started with wireless IoT applications with a set of AT Commands.  The CodeLess AT commands platform allows control over a local UART connected device as well as a remote device via BLE. You can create simple demos / applications / proof of concepts without any code development or build you own application on top!

https://www.dialog-semiconductor.com/products/smartbond-codeless-commands

Dialog Serial Port Service (DSPS)

The DSPS emulates a serial cable communication. It provides a simple substitute for RS-232 connections, including the familiar software flow control logic via Bluetooth low energy. The SPS software distribution includes the application and profile source codes and supports GAP Central/Peripheral roles.

https://www.dialog-semiconductor.com/products/dialog-serial-port-service-dsps

Since you are new with our products, you recommend getting started with following documents:

http://lpccs-docs.dialog-semiconductor.com/Tutorial_SDK6/index.html

http://lpccs-docs.dialog-semiconductor.com/UM-B-117-DA14531-Getting-Started-With-The-Pro-Development-Kit/index.html

http://lpccs-docs.dialog-semiconductor.com/UM-B-119_DA14585-DA14531_SW_Platform_Reference/index.html

Thanks, PM_Dialog

simonlasnier
Offline
Last seen: 6 days 7 hours ago
Joined: 2020-07-20 10:37
Thank you very much for the

Thank you very much for the quick reply - that is great info! :)

The application will run mainly on an STM32 MCU, so the module will only be used as Bluetooth module. I have not decided yet what communication channel they will use but both MCU's have plenty of possibilities (I2C, SPI, UART), so it really should not be any problem. Also once in the market my product will have a way to upgrade its firmware (i.e. the flash of the STM32), and I want to make sure upgrading the firmware of the DA14531 at the same time is also possible.

My knowledge about JTAG/SWD is quite limited - I thought they were different things but it seems I am wrong - looking through the datasheet I can see both terms are used interchangeably. So then I guess you are saying I can simply use my ST/Link V2 and connect the SWDIO and SWCLK pins to the correct pins on the module - that is great! :D 

Do you know what firmware is loaded on the module when it is new (I bought it from Digikey)?

Thank you again for the links, I will go through them all.

PM_Dialog
Offline
Last seen: 2 days 6 hours ago
Staff
Joined: 2018-02-08 11:03
Hi simonlasnier,

Hi simonlasnier,

You could connect the module with the other MCY over UART (UTX/URX/RTS/CTS), so that you can easily use CodeLess or DSPS! Software Update Over The Air (SUOTA) is available on DA14531 too.  Regarding your last question, the DA14531 modules come without any pre0installed firmware, so you should program them in your side.

Thanks, PM_Dialog

simonlasnier
Offline
Last seen: 6 days 7 hours ago
Joined: 2020-07-20 10:37
Ok thank you.

Ok thank you.

simonlasnier
Offline
Last seen: 6 days 7 hours ago
Joined: 2020-07-20 10:37
Hi again!

Hi again!

I know this is quite specific, but the ST-Link V2 is not recognized at all by the tools provided (f.x. the Smartbond Flash Programmer). As I said my knowledge of JTAG and SWD is quite limited, but I guess it does not fall in the "Any JTAG programmer" category?

I will keep on trying to get it to work, but I am thinking I might not be the only one in this situation and native support would be really really appreciated :) 

simonlasnier
Offline
Last seen: 6 days 7 hours ago
Joined: 2020-07-20 10:37
Ok this is interesting -

Ok this is interesting - following the blinky example (http://lpccs-docs.dialog-semiconductor.com/UM-B-117-DA14531-Getting-Started-With-The-Pro-Development-Kit/06_Your_First_DA145x_Applications/Your_First_DA145x_Applications.html#), but selecting ST-Link instead of J-Link in the Keil "Options for Target", I managed to execute some code in Debug mode on the chip! The blinky code was running in the RAM, that works great.

This works as the Keil software supports communication with the ST-Link and then communicates with the ARM Cortex chip like any other chip I suppose. But when t comes to writing a hex/binary file to the SPI Flash I have to use the Dialog tools, and none of them detect the ST-Link. Is there any way to upload the code to the SPI Flash directly from Keil uVision?

FYI I am attaching my configuration in Keil uVision for those who have the same issue.

simonlasnier
Offline
Last seen: 6 days 7 hours ago
Joined: 2020-07-20 10:37
Alternatively, will a CMSIS

Alternatively, will a CMSIS-DAP interface instead of a J-Link interface work with the tools provided by Dialog?

PM_Dialog
Offline
Last seen: 2 days 6 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Simon, 

Hi Simon, 

Thanks for your question - let me cjeck it internally.

Thanks, PM_Dialog 

simonlasnier
Offline
Last seen: 6 days 7 hours ago
Joined: 2020-07-20 10:37
Ok great thanks. Just FYI it

Ok great thanks. Just FYI it seems Keil uVision has a way to upload to the SPI using the ST-Link, the "Settings" window of the ST-Link debugger has a "Flash Download" tab, which seems to be the way forward. I am just not sure what to put there :/