I use JTAG to connect with the DA14580, then use Smartsnippet OTP Image to burn custom image. And then burn OTP header with 2 flags set to Yes, and edit the DMA length to my code length.
I use Read from memory to check and the operation is done correctly.
But now I cant find my chip using my cellphone. I use booter to download firmware it still cannot be found.
Is there anything wrong?
Device:

Hi daniel,
如果您使用的是专业开发工具可以检查通过the power profiler if the device is actually advertising or not via the indicated power consumption. If you ve burned the application flags in the OTP you wont be able to download code via the UART or any other peripheral instead of the JTAG (since the bootloader is deactivated). So what you can do is to try and download code via the JTAG (hope you haven't disabled the JTAG in the OTP header) and check if the application responds.
Thanks MT_dialog
Yes, I download code via JTAG, and there is no respond.
The code can work on the chip that haven't been burned, so the code is correct.
Is there anything I need to change in da1458x_config_basic and da1458x_config_advanced? I only change CFG_DEVELOPMENT_DEBUG to undef.
Hi daniel59,
In the OTP header there is a flag named JTAG ENABLE if you have set this to disabled you wont be able to attach the debugger and download code to it, so if you haven't set this you should be able to attach the debugger and download code. In case you have the JTAG ENABLE flag enabled and you can't run or download code even with the debugger i suppose that something is wrong with the burned 580. There aren't any special setting to do with image, even with the CFG_DEVELOPMENT_DEBUG the image should work (the specific flag just adds some breakpoints in order for the developer to identify any problems, if you downloaded the image as is this shouldn't occur). Also try to re-attach to the OTP header and check if you can reburn the size of the DMA Length in order to make it bigger (the maximum value that this field can take is 1FC0 meanning 32512 bytes in words), perhaps you miscalculated the size of your image, and the DMA length should be larger or equal to the size of your image. Additionally make sure that the Remapping flag is set as SRAM at 0.
Thanks MT_dialog
Yes the flag is Enable, and the DMA length I set is 0x1406 because when I burn DA14580, it says that DMA length (0 words) should not be smaller than the image file code length (5126 words).
After I input 1FC0 and burn, it change to 1FE6.
The attachment is OTP header picture, and download success picture via Booter. But still can't find by cellphone.
Hi daniel59,
If you burned the same chip you wont be able to reburn the OTP to the values you want, you can only switch from zeros to ones, thats why you got that value. Since you have the JTAG enabled you should be able to download code directly to the burned chip, if not by smart snippets at least by using keil, can you try that (download via keil) in order to make sure that the device is still working properly and that something went wrong with burning process. I had a test on an allready burned board with a DMA length over 1FC0 and placed the value that you mentioned (1FE6), seems that the mirroring is occuring just fine and the program runs, so, thats not your probelm. I suppose that something is wrong with the current 580 chip, although i insist on having your device on the power profiler and check what is it doing.
Thanks MT_dialog
I cant find the chip via keil after change SW to JTAG. I think the chip is fine because I can still connect it.
How to check the chip using power profiler?
Hi daniel59,
Dont change in keil from SWD to JTAG, just try to download code into the chip via keil through SWD and check if you can find it by using your phone. You will have to use a pro kit for this (only the expert and the pro kit have the power measurement circuit) you can attach the pro daughter board with the burned OTP on the pro kit and check using Smart Snippets in the power profiler tab if indeed the chip doesn't advertise (check the three current peaks when the system is advertising). Also you can check the current consumption after reset and check for any weird behaviour.
Thanks MT_dialog
I use debug in keil, and the code can be downloaded into the chip. I can see the data that do ++ operation works fine, but still cant find by my phone. Does OTP NVDS need to burn?
I use DA14580 with my own circuit, so I cant use power profiler.
Hi daniel59,
No, if you burned the image with the CFG_INITIALIZE_NVDS_STRUCT the nvds struct will be filled with the data from the SDK and the device will use those data as a bd address etc. If you dont use this flag and the NVDS of the OTP is empty, then yes you will have a problem. Check the above flag and make sure its defined, also if from the keil you can download code and you can see the code running but you can't see your device advertising by your phone then its not the OTP burning its either the current 580 chip or the antenna on your custom design.
Thanks MT_dialog
I checked the flag and it is defined.
But before OTP burning the circuit can work, after burning it cant.
Hi daniel59,
I am sorry, but i cant pinpoint the problem to anything else than a damaged 580, please try to burn another chip.
Thanks MT_dialog
I have thinked about it...but if it is damaged why Smartsnippet can connect to it? I'm afraid of damage another one...
Hi daniel59,
Try to measure the voltage supply of the 580 (in case you are trying to power it via a coin cell battery), if the power is less that 2.35V the 580 wont boot from the OTP. Also regarding the fact that the 580 can connect to Smart Snippets and is not able to transmit, perhaps the radio of the module has been damaged or even perhaps the chip is transmitting but the antenna has been damaged in result the week signal that your device transmits can't be picked up by your phone device.
Thanks MT_dialog
I found that the problem is on the code. I download an unchanged template hex file to the chip my phone can find it, but download my own code my phone can't. I'll look my code and find out what's going on.
I change the app_on_set_dev_config_complete callback with my user one, add 2 easy timer in it.
void user_app_on_set_dev_config_complete(void)
{
data_used = app_easy_timer(8, app_data_timer_cb_handler);
timer_used = app_easy_timer(100, app_adcval1_timer_cb_handler);
default_app_on_set_dev_config_complete();
}
then the chip cannot be found.Why it happens? Is there any different after OTP when running app_on_set_dev_config_complete callback?
I want to know if I want the code run when the chip is powered, and only run one time, where should I place the code? Easy timer seems not work in the app_on_init callback. And if I put them in app_on_sytem_powered with an if statement I think it will waste some processing time.
I just comment and uncomment 2 timer callbacks and it can work on the OTPed chip...
Hi daniel59,
There is no difference between the fw running on the OTP and while running on sysram, the callbacks and the functions executed are the one that you defined when building the code.
"Run the code when the chip is powered, and only run one time, where should i place the code", i am afraid that i dont understand what you would like to do, please clarify.
easy timers dont work in the app_on_init() because after the app_on_init callback is invoked a reset of the stack is invoked as well and that cancels any timers that you ve set during the app_on_init(). Regarding the placing of the timers setting in the app_on_system_powered() if you dont want to place an if statement in the app_on_system_powered, you can place the setting of the timers in the _on_set_dev_config_complete() (as you did), or when you start advertise as most of the SDK examples do, or when you are finished with setting up your database on the _app_on_db_init_complete().
Thanks MT_dialog