⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
10 posts / 0 new
Last post
dlo
Offline
Last seen:1 day 2 hours ago
Joined:2017-05-26 16:21
Enabling CFG_TRNG error

I would like to enable the True Random Number Generator to create advertising intervals to prevent collision among several units.

I'm editing the DA1458x_beacon_v_5.40.2 project files.

In DA1458x_config_advanced.h I define:

#define CFG_TRNG

Using Keil uVision v5.27.1.0 I click rebuild all target files. I then end up with this error:

.\out_580\dialog_beacon_580.axf: Error: L6218E: Undefined symbol trng_acquire (referred from arch_system.o).

At first the trng.h file gave me an error:error: unknown type name 'uint8_t'

To fix this error I added this to trng.h:

#include // standard integer definition
#include "compiler.h" // inline functions
#include "stdbool.h"

The error went away, but I still have the L6218E linker error.

Have anyone else run into this problem?

Thank you for your time.

Keywords:
Device:
PM_Dialog
Offline
Last seen:3 hours 57 min ago
Staff
Joined:2018-02-08 11:03
Hi dlo,

Hi dlo,

The beacon for DA14580 products is not currently supported because we have moved into DA15585/56 product family and our new SDK6. Please check DA14585/6 in our support website:

//www.xmece.com/products/connectivity/bluetooth-low-energy/smartbond-da14585-and-da14586

There is a reference designs named Multi-Sensor Kit which supports beacon implementation. Be aware that DA14585 IoT Multi Sensor Development Kit is recommended for new designs.

//www.xmece.com/products/da14585-iot-multi-sensor-development-kit

If you are not interested in moving into DA14585/6, please use one of the examples of SDK5.0.4 which is the attest SDK for DA14580/1/3 products.

Regarding your question for True Random Number Generator (TRNG),it is not existed as a hardware block, but we have an available API of this kind of usage, so I would highly recommended to have a look at the SDK and follow the USE_TRNG definition. You can get a 128-bit random number by calling the function trng_acquire() from trng.h/c library. To enable the True Random Number Generator you need to define the CFG_TRNG flag. A random number is generated at system initialization and used to seed the C standard library random number generator. In order to get from the 580 a random number the SDK uses the radio module and by altering the values of the radio registers it obtains the random number. Please, check the source code of trng_acquire() function.

Thanks, PM_Dialog

dlo
Offline
Last seen:1 day 2 hours ago
Joined:2017-05-26 16:21
Hello PM_Dialog,

Hello PM_Dialog,

We are in a production environment already, so we can't switch to the DA14585/6.

I am following the SDK example and enable the CFG_TRNG flag as previously posted in the original question. Following the code I could see USE_TRNG is set to 1 when CFG_TRNG is defined, however as you see in my previous comment, when I try to build. I get this linker error that doesn't seem to make any sense since I can see the include files for the trg.h and .c file included but somehow it's not able to link to the trng_acquire() function.

这是非常紧急的在这一点上,我们需要重新lease this firmware for mass production.

PM_Dialog
Offline
Last seen:3 hours 57 min ago
Staff
Joined:2018-02-08 11:03
Ho dlo,

Ho dlo,

The L6218E linker error is typically relating to variable declarations. Could you please send me a screenshot?

Thanks, PM_DIalog

dlo
Offline
Last seen:1 day 2 hours ago
Joined:2017-05-26 16:21
This is the build log:

This is the build log:

Rebuild started: Project: dialog_beacon
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'beacon_580'
assembling boot_vectors.s...
compiling system_ARMCM0.c...
compiling arch_console.c...
compiling nvds.c...
compiling hardfault_handler.c...
compiling nmi_handler.c...
compiling syscntl.c...
compiling uart_ext_wkup.c...
compiling arch_sleep.c...
compiling jump_table.c...
compiling arch_main.c...
compiling arch_patch.c...
compiling adc.c...
compiling spi.c...
compiling gpio.c...
compiling spi_flash.c...
compiling arch_system.c...
compiling prf_utils.c...
compiling gapm.c...
compiling bass.c...
compiling rf_580.c...
compiling rwip.c...
compiling rwble.c...
compiling bass_task.c...
compiling spotar_task.c...
compiling spotar.c...
compiling diss.c...
compiling diss_task.c...
compiling app_default_handlers.c...
compiling app_security_task.c...
compiling app_msg_utils.c...
compiling app_security.c...
compiling app.c...
compiling app_task.c...
compiling app_entry_point.c...
compiling app_easy_msg_utils.c...
compiling app_bass.c...
compiling app_bass_task.c...
compiling app_diss.c...
compiling app_diss_task.c...
compiling app_easy_timer.c...
compiling app_easy_security.c...
compiling app_spotar_task.c...
compiling app_spotar.c...
compiling adc_notify.c...
compiling adc_notify_task.c...
compiling device_config.c...
compiling device_config_task.c...
compiling user_periph_setup.c...
compiling user_adc_notify.c...
compiling user_device_config.c...
compiling user_device_config_task.c...
compiling user_adc_notify_task.c...
compiling crc32.c...
compiling user_config_storage.c...
compiling user_dialog_beacon.c...
compiling battery.c...
compiling user_beacon_utilities.c...
linking...
.\out_580\dialog_beacon_580.axf: Error: L6218E: Undefined symbol trng_acquire (referred from arch_system.o).
Not enough information to produce a SYMDEFs file.
Not enough information to produce a FEEDBACK file.
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 4 information, 0 warning and 1 error messages.
”。\ out_580 \ dialog_beacon_580。axf”(s) - 1错误,0Warning(s).
Target not created.
Build Time Elapsed: 00:00:08

PM_Dialog
Offline
Last seen:3 hours 57 min ago
Staff
Joined:2018-02-08 11:03
Hi dlo,

Hi dlo,

Did you have include the trng library in arch_system file? I am not able to replicate your issue. Are you using the trng_acquire in this file?

Thanks, PM_DIalog

dlo
Offline
Last seen:1 day 2 hours ago
Joined:2017-05-26 16:21
I didn't edit the arch_system

I didn't edit the arch_system file. I do see in the file the following, which I assume has been tested and works:

#if (USE_TRNG)
#include "trng.h" // True random number generator API
#endif

dlo
Offline
Last seen:1 day 2 hours ago
Joined:2017-05-26 16:21
In the include path for the

In the include path for the build, I see the folder trng is included.

PM_Dialog
Offline
Last seen:3 hours 57 min ago
Staff
Joined:2018-02-08 11:03
Hi dlo,

Hi dlo,

I opened your project and as you can see in the img1 of attached snapshots, the trng, the uart2 and systick drivers are not correctly included. Follow the steps that you will find in the attachments in order to remove and add them again. The drivers are located under DA1458x_beacon\v_5.40.2\sdk_580\sdk\platform\driver folder path. After that, I am able to compile your project.

Thanks, PM_Dialog

Attachment:
dlo
Offline
Last seen:1 day 2 hours ago
Joined:2017-05-26 16:21
Thanks so much for the help!

Thanks so much for the help!